/* JCI Queensway interaction layer. The theme owns layout, type and palette. */
body.jciq-youth-site :is(.site-header, .site-footer, .site-assistant, .qjc-page-actions)
  :is(a[href], button, input:not([type="hidden"]), select, textarea, summary):focus-visible,
body.jciq-youth-site main :is(.button, .qjc-enquiry-link):focus-visible,
body.jciq-youth-site main form :is(input:not([type="hidden"]), select, textarea, summary):focus-visible,
body.jciq-youth-site .qjc-fx-contact:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--white);
}

body.jciq-youth-site :is(.pm-form, .join-interest-form) label:focus-within,
body.jciq-youth-site .pm-form :focus-within > #pm-id-help {
  color: var(--navy);
}

body.jciq-youth-site .site-header.qjc-fx-scrolled {
  box-shadow: 0 4px 12px color-mix(in srgb, var(--navy) 12%, transparent);
}

body.jciq-youth-site .qjc-fx-contact {
  position: fixed;
  z-index: 29;
  inset-inline-end: max(.875rem, env(safe-area-inset-right));
  inset-block-end: calc(max(.875rem, env(safe-area-inset-bottom)) + 3.5rem);
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  min-height: 44px;
  max-inline-size: calc(100% - 1.75rem);
  padding: .5rem .875rem;
  border: 1px solid var(--accent);
  border-radius: 2rem;
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--navy) 24%, transparent);
}

body.jciq-youth-site .qjc-fx-contact[hidden],
body.jciq-youth-site:has(.nav-toggle[aria-expanded="true"], dialog[open]) .qjc-fx-contact {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  body.jciq-youth-site .site-header {
    transition: box-shadow 170ms ease-out;
  }

  body.jciq-youth-site :is(main .button, .site-footer .button, .qjc-page-top, .qjc-fx-contact) {
    transition: transform 140ms ease-out, box-shadow 150ms ease-out;
  }

  body.jciq-youth-site :is(main .button, .site-footer .button, .qjc-page-top, .qjc-fx-contact):active {
    transform: scale(.98);
  }

  body.jciq-youth-site .qjc-fx-reveal:not(:focus-within) {
    animation: qjc-fx-rise 240ms cubic-bezier(.2, 0, 0, 1) both;
  }

  @keyframes qjc-fx-rise {
    from { translate: 0 6px; }
    to { translate: 0 0; }
  }
}

@media (hover: hover) and (pointer: fine) {
  body.jciq-youth-site :is(main .button, .site-footer .button, .qjc-page-top, .qjc-fx-contact):hover:not(:focus-visible) {
    box-shadow: 0 0 0 2px var(--accent), 0 5px 12px color-mix(in srgb, var(--navy) 16%, transparent);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body.jciq-youth-site main :is(.good-news-card, .youth-news-card, .chapter-story__card, .event-card) {
    transition: transform 160ms ease-out;
  }

  body.jciq-youth-site main :is(.good-news-card, .youth-news-card, .chapter-story__card, .event-card):hover {
    transform: translateY(-2px);
  }

  body.jciq-youth-site main :is(.good-news-card__image, .youth-news-card__image, .chapter-story__card figure, .event-card__media) img {
    transition: transform 190ms ease-out;
  }

  body.jciq-youth-site main :is(.good-news-card, .youth-news-card, .chapter-story__card, .event-card):hover
    :is(.good-news-card__image, .youth-news-card__image, figure, .event-card__media) img {
    transform: scale(1.025);
  }
}

@media (prefers-reduced-motion: reduce) {
  html:has(body.jciq-youth-site),
  body.jciq-youth-site,
  body.jciq-youth-site *,
  body.jciq-youth-site::before,
  body.jciq-youth-site::after,
  body.jciq-youth-site *::before,
  body.jciq-youth-site *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Loading status already occupies this space. Keep fallback content visible. */
body.jciq-youth-site .qjc-fx-skeleton .chapter-calendar__status {
  position: relative;
}

body.jciq-youth-site .qjc-fx-skeleton:has(.chapter-calendar__surface[aria-busy="true"]) .chapter-calendar__status::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: -.5rem;
  inline-size: min(10rem, 60%);
  block-size: 3px;
  pointer-events: none;
  background:
    linear-gradient(var(--accent), var(--accent)) left / 58% 100% no-repeat,
    linear-gradient(var(--line), var(--line)) right / 36% 100% no-repeat;
}

@media (prefers-reduced-motion: no-preference) {
  body.jciq-youth-site.qjc-fx-arrived::after {
    content: "";
    position: fixed;
    z-index: 31;
    inset: 0 0 auto;
    height: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--accent), var(--sky), transparent);
    animation: qjc-fx-arrival 360ms ease-out both;
  }

  body.jciq-youth-site.qjc-fx-arrived .youth-home-hero__note::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    inset-block-end: -.5rem;
    inline-size: 2.5rem;
    block-size: 2px;
    pointer-events: none;
    background: linear-gradient(90deg, var(--accent), transparent);
    transform-origin: left;
    animation: qjc-fx-hero-accent 300ms ease-out both;
  }

  body.jciq-youth-site .youth-home-hero__note {
    position: relative;
  }

  body.jciq-youth-site .qjc-fx-number {
    animation: qjc-fx-number 230ms ease-out;
  }

  body.jciq-youth-site .qjc-fx-skeleton:has(.chapter-calendar__surface[aria-busy="true"]) .chapter-calendar__status::after {
    animation: qjc-fx-loading 900ms ease-in-out 2 alternate;
  }

  @keyframes qjc-fx-arrival {
    from { opacity: 0; }
    30% { opacity: .85; }
    to { opacity: 0; }
  }

  @keyframes qjc-fx-hero-accent {
    from { opacity: .55; transform: scaleX(.82); }
    to { opacity: 1; transform: scaleX(1); }
  }

  @keyframes qjc-fx-number {
    50% { translate: 0 -3px; }
  }

  @keyframes qjc-fx-loading {
    to { opacity: .45; }
  }
}
