/* ==========================================================================
   home.css — styles used ONLY by the homepage (index.html)'s hero carousel.
   Loaded in addition to style.css, gated on `is_home: true` in a page's
   front-matter (see layout.html). Everything else (header, nav, footer,
   forms, cards, etc.) stays in style.css since every page needs it.
   ========================================================================== */
/* ==========================================================================
   Hero carousel — full viewport width, lighter overlay, animated logo,
   per-slide text position/animation, prev/next controls.
   ========================================================================== */
.hero--carousel {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
  overflow: hidden;
  background: #000;
}

.hero__slides {
  position: relative;
  height: 62vh;
  min-height: 380px;
  max-height: 720px;
}

.hero__slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero__slide[aria-current="true"] { opacity: 1; z-index: 1; }

/* Lighter, bottom-weighted overlay instead of one flat dark layer — keeps
   the photo bright while still giving the caption text somewhere to sit. */
.hero__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.12) 45%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  padding: 22px 30px;
  max-width: 760px;
  margin: 0 6%;
  /* A dedicated scrim behind the text so legibility doesn't depend on how
     bright the underlying photo is. */
  background: rgba(0,0,0,0.26);
  backdrop-filter: blur(3px);
  border-radius: 14px;
  opacity: 0;
}
.hero__content h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3.6vw, 2.3rem);
  color: #fff;
  margin: 0 0 8px;
}
.hero__content p {
  font-size: clamp(0.9rem, 1.8vw, 1.05rem);
  margin: 0 auto;
  opacity: 0.95;
}

/* Text position variants — set per slide (data-position via a modifier class) */
.hero__slide--pos-left { justify-content: flex-start; }
.hero__slide--pos-left .hero__content { text-align: left; margin-left: 7%; }
.hero__slide--pos-right { justify-content: flex-end; }
.hero__slide--pos-right .hero__content { text-align: right; margin-right: 7%; }
.hero__slide--pos-bottom { align-items: flex-end; padding-bottom: 56px; }

/* Entrance animations — replay every time a slide becomes current, since
   toggling aria-current re-triggers the animation on the newly-matched rule. */
@keyframes heroFadeUp   { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heroSlideL   { from { opacity: 0; transform: translateX(-46px); } to { opacity: 1; transform: translateX(0); } }
@keyframes heroSlideR   { from { opacity: 0; transform: translateX(46px); } to { opacity: 1; transform: translateX(0); } }
@keyframes heroZoom     { from { opacity: 0; transform: scale(0.86); } to { opacity: 1; transform: scale(1); } }

.hero__slide[aria-current="true"] .hero__content {
  animation-duration: 0.9s;
  animation-timing-function: cubic-bezier(.22, 1, .36, 1);
  animation-fill-mode: both;
  animation-name: heroFadeUp; /* default for slides with no explicit modifier */
}
.hero__slide[aria-current="true"] .hero__content--slide-left  { animation-name: heroSlideL; }
.hero__slide[aria-current="true"] .hero__content--slide-right { animation-name: heroSlideR; }
.hero__slide[aria-current="true"] .hero__content--zoom        { animation-name: heroZoom; }
.hero__slide[aria-current="true"] .hero__content--fade-up     { animation-name: heroFadeUp; }

/* Floating VK logo, shown once the first hero image has finished loading */
.hero__logo {
  position: absolute;
  top: 18px; left: 50%;
  width: 92px; height: auto;
  z-index: 3;
  transform: translate(-50%, -14px) scale(0.82);
  opacity: 0;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
  transition: opacity 0.7s ease 0.15s, transform 0.7s cubic-bezier(.34, 1.56, .64, 1) 0.15s;
  pointer-events: none;
}
.hero--carousel.is-loaded .hero__logo {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

/* Prev/next controls */
.hero__nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  z-index: 4;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.32);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.hero__nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hero__nav:hover { background: rgba(0,0,0,0.55); transform: translateY(-50%) scale(1.06); }
.hero__nav--prev { left: 16px; }
.hero__nav--next { right: 16px; }
.hero__nav[hidden] { display: none; }

.hero__dots {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 8px;
  z-index: 4;
}
.hero__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(255,255,255,0.35);
  padding: 0; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.hero__dot--active { background: #fff; transform: scale(1.15); }
.hero__dot:hover { background: rgba(255,255,255,0.7); }

@media (max-width: 640px) {
  .hero__slides { height: 46vh; min-height: 300px; }
  .hero__logo { width: 64px; top: 12px; }
  .hero__nav { width: 36px; height: 36px; }
}
