/* ============================================
   Homepage — Gateway Bible Church
   Page-specific layouts only.
   Shared components come from components.css.
   ============================================ */

/* ============================================
   ENTRANCE OVERLAY — branded logo reveal
   Solid background + color logo, fades out after 2s
   to reveal the hero with white logo in same position.
   ============================================ */

.home-entrance {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--cream);
  opacity: 1;
  animation: homeEntranceFade 1.2s ease-in-out 0.9s forwards;
  pointer-events: none;
}

.home-entrance-logo {
  position: absolute;
  /* Hidden until JS positions it to match the hero logo */
  opacity: 0;
}

.home-entrance.is-hidden {
  display: none;
}

@keyframes homeEntranceFade {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}


/* ============================================
   HERO — Cinematic photo + centered bold type
   ============================================ */
.home-hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--dark-blue);
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.home-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  /* Homepage-specific — slightly heavier than the shared recipe so the subtitle reads clearly. */
  background:
    radial-gradient(ellipse at 50% 40%, rgba(13, 32, 56, 0.18) 0%, rgba(13, 32, 56, 0.45) 60%),
    linear-gradient(to bottom, rgba(0, 15, 35, 0.12) 0%, rgba(0, 15, 35, 0.25) 50%, rgba(13, 32, 56, 0.78) 100%);
}

.home-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
  padding: 0 var(--space-6);
}

/* Logo above headline */
.home-hero-logo {
  width: 160px;
  height: auto;
  margin: 0 auto var(--space-8);
  opacity: 0;
  animation: homeLogoAppear 0.6s ease-out 1.4s forwards;
}

@keyframes homeLogoAppear {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (min-width: 768px) {
  .home-hero-logo {
    width: 200px;
    margin-bottom: var(--space-10);
  }
}

/* Location label — tan accent */
.home-hero-location {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tan);
  margin-bottom: var(--space-4);
  opacity: 0;
  animation: fadeDown 0.7s var(--ease-out) 1.6s forwards;
}

/* Bold headline */
.home-hero-headline {
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: var(--font-weight-black);
  color: var(--white);
  letter-spacing: -0.04em;
  line-height: 1.0;
  margin-bottom: var(--space-5);
  opacity: 0;
  animation: fadeUp 0.9s var(--ease-out) 1.7s forwards;
}

.home-hero-sub {
  font-size: clamp(var(--text-base), 2vw, var(--text-lg));
  font-weight: var(--font-weight-book);
  color: var(--white);
  line-height: 1.7;
  max-width: 540px;
  margin: 0 auto var(--space-8);
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) 1.9s forwards;
}

.home-hero-actions {
  margin-bottom: var(--space-8);
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out) 2.1s forwards;
}

/* Line-grows-from-center entrance — hero button only */
.home-hero-actions .btn {
  clip-path: inset(48% 50% 48% 50%);
  animation: homeBtnLineGrow 0.8s var(--ease-out) 2.1s forwards;
}

@keyframes homeBtnLineGrow {
  0% { clip-path: inset(48% 50% 48% 50%); }
  40% { clip-path: inset(48% 0% 48% 0%); }
  100% { clip-path: inset(0% 0% 0% 0%); }
}

/* Gentle glow pulse — filter drop-shadow respects the button's rounded shape */
.home-hero-actions .btn.is-glow {
  animation: heroGlowPulse 1.4s ease-out forwards;
}

@keyframes heroGlowPulse {
  0% {
    filter: drop-shadow(0 0 0px rgba(0, 156, 255, 0.6));
  }
  40% {
    filter: drop-shadow(0 0 18px rgba(0, 156, 255, 0.5));
  }
  100% {
    filter: drop-shadow(0 0 0px rgba(0, 156, 255, 0));
  }
}

.home-hero-times {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-book);
  color: var(--white);
  opacity: 0;
  animation: fadeUp 0.6s var(--ease-out) 2.3s forwards;
}

.home-hero-times svg {
  color: var(--bright-blue);
}

.home-hero-watch {
  font-weight: var(--font-weight-bold);
  color: var(--white);
  border-bottom: 1px solid var(--bright-blue);
  padding-bottom: 1px;
  transition: border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.home-hero-watch:hover {
  border-color: var(--white);
  color: var(--bright-blue);
}

.home-hero-watch:focus-visible {
  outline: 2px solid var(--bright-blue);
  outline-offset: 4px;
  border-radius: 2px;
}

/* "Watch Live" attention callout — points new visitors to the live-stream link */
.home-hero-watch-wrap {
  position: relative;
  display: inline-block;
}

.home-watch-pop {
  position: absolute;
  bottom: calc(100% + 16px);
  /* Anchored to the link's left edge so the bubble grows rightward and clears
     the "I'm New" button sitting up and to the left. */
  left: 0;
  width: max-content;
  max-width: 240px;
  transform: translateY(8px) scale(0.94);
  transform-origin: bottom left;
  background: var(--dark-blue);
  color: var(--white);
  border: 1px solid var(--bright-blue);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.8125rem;
  font-weight: var(--font-weight-medium);
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  box-shadow: 0 12px 30px rgba(13, 32, 56, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.4s var(--ease-out),
              transform 0.4s var(--ease-out);
}

.home-watch-pop-eyebrow {
  display: block;
  color: var(--bright-blue);
  font-size: 0.625rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* downward connector — sits over the link near the bubble's left edge.
   Two stacked triangles: a larger bright-blue one behind gives the dark fill
   a light-blue outline so the border wraps the connector continuously. */
.home-watch-pop::before,
.home-watch-pop::after {
  content: "";
  position: absolute;
  top: 100%;
  width: 0;
  height: 0;
  border-style: solid;
}
.home-watch-pop::before {
  left: 35px;
  border-width: 8px;
  border-color: var(--bright-blue) transparent transparent transparent;
}
.home-watch-pop::after {
  left: 36px;
  border-width: 7px;
  border-color: var(--dark-blue) transparent transparent transparent;
  margin-top: -1px;
}

.home-watch-pop.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: homeWatchPopWiggle 0.6s var(--ease-out) 0.4s;
}

@keyframes homeWatchPopWiggle {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-3px) scale(1.02); }
  60% { transform: translateY(0) scale(1); }
}

/* On narrow screens (phones/tablets) the link sits near the right edge — anchor
   the bubble to the right and move the arrow so it never runs off the edge. */
@media (max-width: 767px) {
  .home-watch-pop {
    left: auto;
    right: -8px;
    transform-origin: bottom right;
  }
  .home-watch-pop::before {
    left: auto;
    right: 27px;
  }
  .home-watch-pop::after {
    left: auto;
    right: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-watch-pop {
    transform: none;
    transition: opacity 0.4s ease;
  }
  .home-watch-pop.is-visible {
    transform: none;
    animation: none;
  }
}

/* Scroll hint */
.home-hero-scroll {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  color: var(--white-50);
  z-index: 1;
  animation: homeBounce 2.5s infinite;
}

@keyframes homeBounce {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
    opacity: 0.3;
  }
  50% {
    transform: translateX(-50%) translateY(8px);
    opacity: 0.7;
  }
}


/* ============================================
   THREE CTAs — Bands with dark-mode hover
   ============================================ */
.home-ctas {
  background: var(--white);
  position: relative;
  overflow: hidden;
}

.home-cta-band {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6) var(--space-6);
  border-bottom: 1px solid var(--dark-blue-10);
  text-decoration: none;
  color: var(--dark-blue);
  background: var(--white);
  position: relative;
  overflow: visible;
  z-index: 1;
  transition: color 0.3s var(--ease-out),
              background 0.3s var(--ease-out);
}

.home-cta-band:hover {
  background: var(--dark-blue);
  color: var(--white);
}

.home-cta-band:active {
  background: var(--dark-blue);
}

.home-cta-band:first-child {
  border-top: 1px solid var(--dark-blue-10);
}

@media (min-width: 768px) {
  .home-cta-band {
    padding: var(--space-8) var(--space-10);
    max-width: var(--max-width);
    margin: 0 auto;
  }
}

.home-cta-band:focus-visible {
  outline: 2px solid var(--bright-blue);
  outline-offset: -2px;
}

.home-cta-number {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: var(--font-weight-thin);
  color: var(--gray-blue);
  letter-spacing: -0.02em;
  line-height: 1;
  min-width: 48px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.home-cta-num-inner {
  display: inline-block;
  transition: transform 0.4s var(--ease-out),
              opacity 0.4s var(--ease-out);
}

.home-cta-band:hover .home-cta-num-inner {
  animation: homeNumWipe 0.5s var(--ease-out);
}

@keyframes homeNumWipe {
  0% { transform: translateY(0); opacity: 1; }
  40% { transform: translateY(100%); opacity: 0; }
  41% { transform: translateY(-100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.home-cta-title {
  font-size: clamp(1.25rem, 2.5vw, var(--text-3xl));
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
  line-height: 1.1;
  flex: 1;
  transition: color 0.3s var(--ease-out);
}

.home-cta-band:hover .home-cta-title {
  color: var(--white);
}

.home-cta-arrow {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-light);
  color: var(--dark-blue-20);
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-spring),
              color 0.3s var(--ease-out);
  margin-left: auto;
}

.home-cta-band:hover .home-cta-arrow {
  transform: translateX(6px);
  color: var(--white);
}

@media (max-width: 767px) {
  .home-cta-arrow {
    display: none;
  }
}


/* Current series styles moved to components.css as .series-block */


/* ============================================
   COMMUNITY LIFE — Photo mosaic
   ============================================ */
.home-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .home-mosaic {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto;
    gap: var(--space-4);
  }
}

.home-mosaic-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 3;
}

.home-mosaic-item--large {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 9;
}

@media (min-width: 768px) {
  .home-mosaic-item--large {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    aspect-ratio: auto;
  }
}

.home-mosaic-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease-out),
              filter 0.5s var(--ease-out);
  filter: saturate(0.85);
}

.home-mosaic-item:hover img {
  transform: scale(1.06);
  filter: saturate(1.1);
}


/* ============================================
   TESTIMONY — Cream editorial carousel
   A quiet light moment between two dark sections.
   Bright blue stays out of here on purpose so it lives
   exclusively in the Global Impact section that follows.
   ============================================ */
.home-testimony {
  padding: var(--section-padding) 0;
  background: var(--cream);
  position: relative;
  color: var(--dark-blue);
}

.home-testimony .quote {
  color: var(--dark-blue);
  overflow: hidden;
}

.home-testimony .quote-cite {
  color: var(--gray-blue);
}

.home-testimony-inner {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  padding: 0 var(--space-8);
}

@media (min-width: 768px) {
  .home-testimony-inner {
    padding: 0 var(--space-12);
  }
}

/* Gold accent bar — left side */
.home-testimony-inner::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--space-10);
  bottom: var(--space-10);
  width: 3px;
  background: var(--gold);
  border-radius: 3px;
}

/* Decorative dot row replacing the old giant quote mark */
.home-testimony-dotrow {
  display: flex;
  gap: 10px;
  margin-bottom: var(--space-8);
}

.home-testimony-dotmark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.home-testimony-dotmark--gold  { background: var(--gold); }
.home-testimony-dotmark--tan   { background: var(--tan); }
.home-testimony-dotmark--slate { background: var(--gray-blue); }

/* Carousel */
.home-testimony-carousel {
  position: relative;
  min-height: 180px;
  display: flex;
  align-items: center;
}

.home-testimony-slide {
  position: absolute;
  width: 100%;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s var(--ease-out),
              transform 0.6s var(--ease-out);
  pointer-events: none;
}

.home-testimony-slide.is-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
}

/* Carousel navigation dots — gold-on-cream, no glow */
.home-testimony-dots {
  display: flex;
  gap: 0;
  margin-top: var(--space-8);
}

.home-testimony-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--duration-fast) var(--ease-spring);
}

.home-testimony-dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(80, 109, 124, 0.35); /* gray-blue @ 35% */
  transition: background-color var(--duration-normal) var(--ease-out),
              transform var(--duration-fast) var(--ease-spring);
}

.home-testimony-dot:hover::after {
  background: var(--gray-blue);
  transform: scale(1.3);
}

.home-testimony-dot:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -6px;
}

.home-testimony-dot.is-active::after {
  background: var(--gold);
  transform: scale(1.2);
}


/* ============================================
   GLOBAL IMPACT — Dark bg, glowing numbers
   ============================================ */
.home-impact {
  padding: var(--section-padding) 0;
  background: var(--deep-blue);
  position: relative;
  overflow: hidden;
}

/* V2-style giant watermark number */
.home-impact-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(10rem, 28vw, 30rem);
  font-weight: var(--font-weight-black);
  letter-spacing: -0.04em;
  line-height: 1;
  color: rgba(0, 120, 220, 0.18);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* Radial blue glow */
.home-impact-glow {
  position: absolute;
  top: 50%;
  right: 10%;
  transform: translate(0, -50%);
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 156, 255, 0.08) 0%, transparent 65%);
  pointer-events: none;
}

.home-impact-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}

@media (min-width: 768px) {
  .home-impact-layout {
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-16);
  }
}

.home-impact-headline {
  font-size: clamp(1.75rem, 4vw, var(--text-4xl));
  font-weight: var(--font-weight-bold);
  color: var(--white);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--space-5);
}

.home-impact-accent {
  color: var(--bright-blue);
  font-weight: var(--font-weight-extrabold);
}

.home-impact-desc {
  font-size: var(--text-base);
  font-weight: var(--font-weight-book);
  color: var(--white-70);
  line-height: 1.7;
  margin-bottom: var(--space-8);
  max-width: 480px;
}

.home-impact-numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10);
}

.home-impact-number-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}


/* ============================================
   INVITATION — Bright blue + massive type
   ============================================ */
.home-invitation {
  padding: var(--section-padding) 0;
  background: var(--bright-blue);
  position: relative;
  overflow: hidden;
}

/* Grain */
.home-invitation::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  pointer-events: none;
}

/* Decorative glow */
.home-invitation::after {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.home-invitation-inner {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .home-invitation-inner {
    padding: 0 var(--space-10);
  }
}

.home-invitation-headline {
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: var(--font-weight-black);
  color: var(--white);
  letter-spacing: -0.04em;
  line-height: 1.0;
  margin-bottom: var(--space-6);
}

.home-invitation-sub {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-book);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto var(--space-10);
}

.home-invitation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.home-invitation-times {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--dark-blue);
}


/* ============================================
   RESPONSIVE POLISH
   ============================================ */
@media (max-width: 767px) {
  .home-hero-scroll {
    display: none;
  }

  .home-invitation-headline {
    font-size: clamp(2rem, 10vw, 3.5rem);
  }

  .home-testimony {
    padding: var(--section-padding-mobile) 0;
  }

  .home-impact {
    padding: var(--section-padding-mobile) 0;
  }
}
