/* ==========================================================================
   Thrive Apostolic Church : animations
   Adds motion only. Nothing here changes layout, text, colors or fonts:
   every effect uses opacity, `translate`, `scale` or shadows, which never
   move surrounding content. Visitors who turn on "reduce motion" on their
   phone or computer see the site with no animation (see bottom of file).
   ========================================================================== */

:root {
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}


/* ---------- 1. Text fading in when a page opens ---------- */

@keyframes thrive-fade-up {
  from { opacity: 0; translate: 0 22px; }
  to   { opacity: 1; translate: 0 0; }
}

@keyframes thrive-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Home page hero: eyebrow, headline, line of copy, then the button */
.hero-content > * {
  animation: thrive-fade-up .9s var(--ease-out) backwards;
}
.hero-content > *:nth-child(1) { animation-delay: .10s; }
.hero-content > *:nth-child(2) { animation-delay: .25s; }
.hero-content > *:nth-child(3) { animation-delay: .45s; }
.hero-content > *:nth-child(4) { animation-delay: .60s; }
.hero-bottom { animation: thrive-fade-in 1.2s .8s var(--ease-out) backwards; }

/* Top section of every other page */
.page-intro > div > *,
.watch-intro > *,
.contact-layout > div:first-child > *,
.give-intro > div > * {
  animation: thrive-fade-up .8s var(--ease-out) backwards;
}
.page-intro > div > *:nth-child(2),
.watch-intro > *:nth-child(2),
.contact-layout > div:first-child > *:nth-child(2),
.give-intro > div > *:nth-child(2) { animation-delay: .12s; }
.page-intro > div > *:nth-child(3),
.watch-intro > *:nth-child(3),
.contact-layout > div:first-child > *:nth-child(3),
.give-intro > div > *:nth-child(3) { animation-delay: .24s; }
.page-intro > div > *:nth-child(n+4),
.watch-intro > *:nth-child(n+4),
.contact-layout > div:first-child > *:nth-child(n+4),
.give-intro > div > *:nth-child(n+4) { animation-delay: .36s; }
.page-intro > img,
.page-intro > .logo-stage,
.give-intro > img {
  animation: thrive-fade-in 1.1s .2s var(--ease-out) backwards;
}


/* ---------- 2. Sections animating in as you scroll ----------
   app.js marks content that starts below the screen with .reveal, then
   removes it as the content scrolls into view. Content already on screen
   is never hidden, and without JavaScript everything simply shows. */

.reveal {
  opacity: 0;
  translate: 0 34px;
}
.reveal-animate {
  transition: opacity .9s var(--ease-out), translate .9s var(--ease-out);
}


/* ---------- 3. Hover animations (mouse / trackpad) ---------- */

@media (hover: hover) {

  /* Buttons: lift (already in the original) plus a soft shadow and arrow nudge */
  .button {
    transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), filter .25s;
  }
  .button:hover {
    box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .55);
    filter: brightness(1.04);
  }
  .button span,
  .nav-visit span {
    display: inline-block;
    transition: translate .25s var(--ease-out);
  }
  .button:hover span,
  .nav-visit:hover span {
    translate: 4px 0;
  }

  /* Menu links: underline grows from the left */
  nav a {
    position: relative;
    transition: color .2s;
  }
  nav a:not(.nav-visit)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--lime);
    scale: 0 1;
    transform-origin: left;
    transition: scale .35s var(--ease-out);
  }
  nav a:not(.nav-visit):hover::after {
    scale: 1 1;
  }
  .nav-visit {
    transition: border-color .25s, color .2s;
  }
  .nav-visit:hover {
    border-color: var(--lime);
  }

  /* Text links with arrows */
  .text-link,
  .detail-link,
  .detail-grid a,
  details p a,
  .contact-details a,
  .visit-location a {
    transition: color .2s, text-underline-offset .25s;
  }
  .detail-link:hover,
  .detail-grid a:hover,
  details p a:hover {
    text-underline-offset: 8px;
  }
  .text-link .arrow,
  .detail-link .arrow,
  a .arrow {
    transition: translate .3s var(--ease-out);
  }
  a:hover .arrow {
    translate: 3px -3px;
  }
  .text-link {
    transition: padding-left .3s var(--ease-out), border-color .3s;
  }
  .text-link:hover {
    border-color: currentColor;
  }

  /* Round arrow button next to the service times */
  .circle-link {
    transition: rotate .4s var(--ease-out), background-color .3s, border-color .3s;
  }
  .circle-link:hover {
    rotate: 45deg;
    border-color: currentColor;
  }

  /* Cards and info blocks lift slightly */
  .family-grid article,
  .detail-grid article,
  .belief-grid article,
  .ministry-info,
  .time {
    transition: translate .35s var(--ease-out);
  }
  .family-grid article:hover,
  .detail-grid article:hover,
  .belief-grid article:hover,
  .ministry-info:hover,
  .time:hover {
    translate: 0 -5px;
  }

  /* Photos lift with a soft shadow */
  .real-photo,
  .church-photo,
  .city-mural,
  .pastor img,
  .give-intro img {
    transition: translate .45s var(--ease-out), box-shadow .45s var(--ease-out);
  }
  .real-photo:hover,
  .church-photo:hover,
  .city-mural:hover,
  .pastor img:hover,
  .give-intro img:hover {
    translate: 0 -6px;
    box-shadow: 0 26px 40px -24px rgba(0, 0, 0, .6);
  }

  /* Kids and Youth logos both pop bigger the same way */
  .ministry-logo,
  .youth-mark,
  .logo-stage img {
    transition: scale .4s var(--ease-out);
  }
  .ministry-logo:hover,
  .youth-mark:hover,
  .logo-stage img:hover,
  article:hover > .ministry-logo,
  article:hover > .youth-mark {
    scale: 1.08;
  }

  /* Beliefs and FAQ questions */
  summary {
    transition: color .2s;
  }
  summary:hover {
    color: var(--lime);
  }

  /* Social links, footer logos */
  .social-links a {
    display: inline-block;
    transition: color .2s, translate .25s var(--ease-out);
  }
  .social-links a:hover {
    translate: 0 -2px;
  }
  .footer-brand img,
  .footer-upci img {
    transition: opacity .3s;
  }
  .footer-brand:hover img,
  .footer-upci:hover img {
    opacity: .8;
  }
}

/* Tap feedback on phones: buttons and links press in slightly */
@media (hover: none) {
  .button,
  .nav-visit,
  .circle-link {
    transition: scale .15s;
  }
  .button:active,
  .nav-visit:active,
  .circle-link:active {
    scale: .97;
  }
}


/* ---------- 4. Opening a belief / FAQ answer ---------- */

@keyframes thrive-open {
  from { opacity: 0; translate: 0 -6px; }
  to   { opacity: 1; translate: 0 0; }
}
details[open] > :not(summary) {
  animation: thrive-open .45s var(--ease-out);
}
/* the + turns into an × smoothly (the rotation itself is in style.css) */
summary b {
  transition: transform .3s var(--ease-out);
}


/* ---------- 5. Form fields ---------- */

.contact-form input:not([type=hidden]),
.contact-form select,
.contact-form textarea {
  transition: border-color .2s, box-shadow .2s;
}


/* ---------- 6. Respect "reduce motion" ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1;
    translate: none;
  }
}
