/* ==========================================================================
   Hero slideshow — full-screen image transitions
   Isolated on purpose: this is the "tinker with the UX later" surface.
   Everything about HOW slides move (crossfade timing, ken-burns, arrows,
   dots, swipe affordances) lives here. Layout of the page around it stays
   in css/styles.css. See README.md in this folder for the knobs to turn.
   ========================================================================== */

.hero-slideshow {
  --slide-duration: 1.4s;      /* crossfade length */
  --slide-interval: 6s;        /* time each slide stays fully visible before advancing */
  --kenburns-scale: 1.06;      /* how far the slow zoom drifts */
  --kenburns-duration: 9s;     /* slide-interval + slide-duration, roughly */

  position: relative;
  width: 100%;
  /* header is sticky (occupies space above), so subtract its height —
     otherwise header + 100vh hero together run taller than one screen
     and push the bottom of the overlay (second button, dots) out of view */
  height: calc(100vh - var(--header-h));
  height: calc(100svh - var(--header-h));
  overflow: hidden;
  background: var(--ink);
  isolation: isolate;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 1;
  transition: opacity var(--slide-duration) ease;
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 2;
}

.hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1);
}

.hero-slide.is-active .hero-slide-img {
  animation: hero-kenburns var(--kenburns-duration) ease-out forwards;
}

@keyframes hero-kenburns {
  from { transform: scale(1); }
  to   { transform: scale(var(--kenburns-scale)); }
}

/* Placeholder state — shown until a real photo lands at the expected path.
   The <img> fires onerror and adds .hero-slide--missing to the parent,
   which hides the (broken) image and reveals this instead. Once a real
   file exists at that path, this whole block simply never shows.
   Label sits in a corner, not centered — the overlaid headline already
   owns the center of the frame, and a real photo won't have this text
   at all, so this only needs to avoid colliding with that headline. */
.hero-slide-placeholder {
  display: none;
  position: absolute;
  inset: 0;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 20px;
  background: var(--paper-warm);
  border: 1px solid var(--line);
}

.hero-slide--missing .hero-slide-img { display: none; }
.hero-slide--missing .hero-slide-placeholder { display: flex; }

.hero-slide-placeholder span {
  font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #A9A093;
}

/* Scrim so the overlaid headline text and dots/arrows stay legible over any
   photo — a flat wash rather than an edge gradient, since the text now sits
   centered over the middle of the frame, not just the edges. */
.hero-slideshow::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: rgba(30, 28, 24, .42);
}

/* Overlaid hero text — sits on top of the slideshow and stays put while
   slides crossfade behind it. pointer-events is disabled on the overlay
   itself (and re-enabled only on the buttons) so it doesn't block clicks
   on the dots/arrows underneath. */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 110px 24px 100px;
  pointer-events: none;
}

.hero-overlay .eyebrow { color: #E3CBA8; }
.hero-overlay h1 { color: var(--paper); }
.hero-overlay .hero-sub { color: rgba(250,248,245,.92); }
.hero-overlay .hero-meta { color: rgba(250,248,245,.8); }

.hero-overlay .btn {
  pointer-events: auto;
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.hero-overlay .btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.hero-overlay .btn-ghost {
  background: transparent;
  color: var(--paper);
  border-color: rgba(250,248,245,.5);
}
.hero-overlay .btn-ghost:hover {
  background: rgba(250,248,245,.12);
  color: var(--paper);
}

@media (max-width: 620px) {
  .hero-overlay { padding: 32px 20px; }
  .hero-overlay .hero-sub { font-size: 1.02rem; line-height: 1.5; margin: 18px auto 26px; max-width: 30ch; }
  .hero-overlay .eyebrow { margin-bottom: .8em; }
  .hero-overlay .btn { padding: 14px 30px; font-size: .88rem; }

  /* On a small screen there's no room to route text around the brighter
     parts of a photo (sky, glass, windows), so contrast varies a lot more
     across the same block of text than it does on desktop. Darken the
     scrim and add a soft shadow behind the overlay text so it stays
     legible no matter what's directly behind it. */
  .hero-slideshow::after { background: rgba(20, 18, 15, .58); }
  .hero-overlay .eyebrow,
  .hero-overlay h1,
  .hero-overlay .hero-sub,
  .hero-overlay .hero-meta { text-shadow: 0 1px 12px rgba(0,0,0,.55); }
  .hero-overlay .btn-ghost { background: rgba(0,0,0,.18); }
}

/* Short viewports (small phones, short laptop windows): drop the least
   essential line so the block never crowds the dots below it */
@media (max-height: 700px) {
  .hero-overlay .hero-meta { display: none; }
}

@media (max-height: 620px) {
  .hero-overlay .hero-sub { display: none; }
}

/* Dots */
.hero-slideshow-dots {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 4vh, 40px);
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 1px solid rgba(250,248,245,.85);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
  transition: background .25s ease, transform .25s ease;
}

.hero-dot:hover { transform: scale(1.15); }

.hero-dot.is-active {
  background: var(--paper);
  border-color: var(--paper);
}

/* Arrows — desktop hover affordance, always present (not hover-hidden) for
   touch/keyboard users, but visually quiet until interacted with */
.hero-slideshow-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--paper);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
  transition: opacity .25s ease, background .25s ease;
}

.hero-slideshow:hover .hero-slideshow-arrow,
.hero-slideshow-arrow:focus-visible {
  opacity: .85;
}

.hero-slideshow-arrow:hover { opacity: 1; background: rgba(0,0,0,.15); }
.hero-slideshow-arrow--prev { left: clamp(8px, 2vw, 24px); }
.hero-slideshow-arrow--next { right: clamp(8px, 2vw, 24px); }

@media (max-width: 720px) {
  /* Arrows are redundant with swipe on touch devices */
  .hero-slideshow-arrow { display: none; }
}

/* Respect reduced motion: hard cut instead of crossfade/zoom */
@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-dot {
    transition: none;
  }
  .hero-slide.is-active .hero-slide-img {
    animation: none;
  }
}
