/* Reading rhythm. Loaded last; photo, poster and document fit contracts remain intact. */
body.jciq-youth-site {
  --reading-space-1: .25rem;
  --reading-space-2: .5rem;
  --reading-space-3: .75rem;
  --reading-space-4: 1rem;
  --reading-space-5: 1.25rem;
  --reading-space-6: 1.5rem;
  --reading-space-8: 2rem;
  --reading-space-10: 2.5rem;
  --reading-space-12: 3rem;
  --reading-space-16: 4rem;
  --reading-measure: 68ch;
  --reading-header-offset: 5.4rem;
  --reading-glow: 0 3px 14px rgba(42, 121, 189, .16), 0 0 0 1px rgba(69, 174, 224, .25);
  --reading-focus: #0b4f9c;
  font-size: 1rem;
}
body.jciq-youth-site.language-zh-hant { --reading-measure: 38em; }
body.jciq-youth-site :is(.content-section, .single-entry) { padding-block: clamp(var(--reading-space-10), 4.5vw, var(--reading-space-16)); }
body.jciq-youth-site :is(.events-hero, .insights-page__hero, .information-hero, .progress-hero, .area-detail-hero, .handbook-hero, .about-intro) {
  padding-block: clamp(var(--reading-space-10), 4.5vw, var(--reading-space-16));
}
body.jciq-youth-site :is(.youth-home-hero__grid, .annual-hero .hero__content) { padding-block: var(--reading-space-10); }
body.jciq-youth-site :is(.section-heading, .activity-story .section-heading) { gap: var(--reading-space-6); margin-bottom: var(--reading-space-8); }
body.jciq-youth-site :is(.information-hero__grid, .insights-page__hero-grid, .area-detail-hero__grid, .areas-introduction__grid, .area-detail-overview__grid, .area-practice__grid) {
  gap: clamp(var(--reading-space-6), 3.5vw, var(--reading-space-12));
}
body.jciq-youth-site :is(.events-hero, .insights-page__hero, .information-hero, .progress-hero, .area-detail-hero, .handbook-hero, .about-intro, .youth-home-hero) h1 {
  font-size: clamp(2.25rem, 4.7vw, 4.5rem);
  line-height: 1.12;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
body.jciq-youth-site :is(.single-entry h1, .single-entry .article-layout h1, .youth-news .article-layout .youth-news-article h1) {
  max-width: 25ch;
  font-size: clamp(2rem, 3.5vw, 3.25rem);
  line-height: 1.2;
}
body.jciq-youth-site :is(.section-heading h2, .agm-feature__intro h2, .next-chapter h2, .home-board-feature h2, .area-feature h2, .about-org-chart__copy h2) {
  font-size: clamp(1.875rem, 3.2vw, 3rem);
  line-height: 1.16;
  letter-spacing: -.025em;
}
body.jciq-youth-site.language-zh-hant :is(h1, h2, h3, h4, .eyebrow, .youth-kicker, .youth-word-strip, .agm-feature__date time) { letter-spacing: 0; }
body.jciq-youth-site :is(.entry-content, .areas-introduction .entry-content, .area-detail-overview .entry-content, .area-feature p, .area-outcomes p:not(.eyebrow), .event-long-content, .youth-news-article p, .youth-news-article li) {
  max-width: var(--reading-measure);
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  line-height: 1.75;
  overflow-wrap: anywhere;
}
body.jciq-youth-site .entry-content :is(p, ul, ol) { margin-block: 0 var(--reading-space-5); }
body.jciq-youth-site .entry-content :is(h2, h3) { margin-block: var(--reading-space-10) var(--reading-space-4); line-height: 1.3; }
body.jciq-youth-site .entry-content :is(h2, h3):first-child { margin-top: 0; }
body.jciq-youth-site :is(.events-hero__lead, .information-hero__lead, .area-detail-hero__lead, .member-zone__lead, .insights-page__hero-grid > p) { max-width: var(--reading-measure); font-size: 1.125rem; line-height: 1.7; }
body.jciq-youth-site .event-card .content-card__body { min-height: 0; padding: var(--reading-space-5); }
body.jciq-youth-site .event-card .content-card__body p:not(.content-card__meta) { font-size: 1rem; line-height: 1.65; }
body.jciq-youth-site .events-toolbar { margin-bottom: var(--reading-space-10); }
body.jciq-youth-site .events-months { gap: var(--reading-space-12); }
body.jciq-youth-site .activity-story { padding-bottom: clamp(var(--reading-space-10), 4.5vw, var(--reading-space-16)); }

/* Size the frame; natural photographs and full artwork keep their proportions. */
body.jciq-youth-site :is(.about-gallery figure, .project-hero) { display: grid; place-items: center; background: var(--surface); }
body.jciq-youth-site .about-gallery img { width: 100%; height: clamp(12rem, 20vw, 18rem); object-fit: contain; }
body.jciq-youth-site .about-feature figure img { aspect-ratio: 8 / 5; object-fit: contain; background: var(--surface); }
body.jciq-youth-site .content-card img.project-preview { object-fit: contain; background: var(--surface); }
body.jciq-youth-site .media-gallery img { object-fit: contain; }
body.jciq-youth-site .media-gallery button:is(:hover, :focus-visible) img { transform: none; }
body.jciq-youth-site .project-hero { margin-block: var(--reading-space-6); padding: var(--reading-space-3); }
body.jciq-youth-site .project-hero img { width: auto; max-width: 100%; max-height: 30rem; margin-inline: auto; }
body.jciq-youth-site .project-hero img.project-preview--brand { padding: var(--reading-space-6); }
body.jciq-youth-site .event-card .event-card__media { background: var(--surface); }
body.jciq-youth-site .event-card .event-card__media img { object-fit: contain; }
body.jciq-youth-site .event-card .event-card__media::after { display: none; }
body.jciq-youth-site .event-detail-main .single-entry__photo:not(.single-entry__photo--poster) img {
  width: auto;
  max-width: 100%;
  max-height: 34rem;
  margin-inline: auto;
}
body.jciq-youth-site .related-reading__card .related-reading__image { object-fit: contain; }
body.jciq-youth-site .youth-snapshot { box-shadow: 0 12px 30px rgba(11, 45, 91, .08); }
body.jciq-youth-site .assistant-fab { box-shadow: 0 6px 16px rgba(11, 45, 91, .14); }

/* Interactions retain the chapter's blue identity and a visible keyboard edge. */
body.jciq-youth-site :is(a, button, summary, input, select, textarea):focus-visible {
  outline: 3px solid var(--reading-focus);
  outline-offset: 3px;
}
body.jciq-youth-site :is(.site-footer, .events-hero, .insights-page__hero, .agm-feature__date, .handbook-band, .member-zone__benefit) { --reading-focus: #8cdbff; }
body.jciq-youth-site :is(.site-nav a, .language-switch a, .nav-toggle, .area-submenu-toggle, .header-search-toggle) { min-height: 2.75rem; }
body.jciq-youth-site .site-nav .menu-item--join a { min-height: 2.75rem; }
body.jciq-youth-site :is(.site-nav a[aria-current="page"], .language-switch a[aria-current="page"]) {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), var(--reading-glow);
}
body.jciq-youth-site :is(.button, .text-link, .quick-links a, .site-nav a, .language-switch a, .assistant-fab, .reading-tools a, .chapter-calendar__preview-more) {
  transition: box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}
body.jciq-youth-site :is(.button, .text-link, .quick-links a, .site-nav a, .language-switch a, .assistant-fab, .reading-tools a, .chapter-calendar__preview-more):is(:hover, :focus-visible) {
  box-shadow: var(--reading-glow);
}
body.jciq-youth-site :is(.content-card, .progress-issue, .chapter-story-card, .event-recommendation-card, .activity-story__item) {
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
body.jciq-youth-site :is(.content-card, .progress-issue, .chapter-story-card, .event-recommendation-card, .activity-story__item):is(:hover, :focus-within) {
  border-color: #629bca;
  box-shadow: var(--reading-glow);
  transform: none;
}
body.jciq-youth-site :is(.content-card, .progress-issue, .chapter-story-card, .event-recommendation-card, .activity-story__item):focus-within {
  outline: 3px solid var(--reading-focus);
  outline-offset: 3px;
}
body.jciq-youth-site :is(.content-card, .progress-issue, .chapter-story-card, .event-recommendation-card, .activity-story__item) a:focus-visible { outline-offset: -4px; }
body.jciq-youth-site :is(.site-nav a, .button, .text-link):is(:hover, :focus-visible) { transform: none; }
body.jciq-youth-site .activity-story.is-enhanced .activity-story__item:hover { filter: none; transform: none; }

/* A completed AGM is a recap, with its original material still one click away. */
body.jciq-youth-site .agm-feature--recap .agm-feature__layout { grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr); gap: var(--reading-space-6); }
body.jciq-youth-site .agm-feature--recap .agm-feature__date { position: static; padding: var(--reading-space-5); }
body.jciq-youth-site .agm-feature--recap .agm-feature__date time { margin-top: var(--reading-space-3); font-size: clamp(2rem, 3vw, 2.75rem); line-height: 1.1; }
body.jciq-youth-site .agm-feature__details-disclosure { min-width: 0; align-self: start; border: 1px solid var(--line); border-radius: 1rem; background: #fff; }
body.jciq-youth-site .agm-feature__details-disclosure > summary {
  min-height: 2.75rem;
  padding: var(--reading-space-4) var(--reading-space-5);
  color: var(--navy);
  font-size: 1rem;
  font-weight: 750;
  cursor: pointer;
  border-radius: inherit;
}
body.jciq-youth-site .agm-feature__details-disclosure > summary:is(:hover, :focus-visible) { background: var(--surface); box-shadow: inset 0 0 0 1px rgba(42, 121, 189, .25); }
body.jciq-youth-site .agm-feature__details-disclosure[open] > summary { border-bottom: 1px solid var(--line); border-radius: 1rem 1rem 0 0; }
body.jciq-youth-site .agm-feature__details-disclosure .agm-feature__information { padding: var(--reading-space-5); }
body.jciq-youth-site .agm-feature--recap .agm-feature__photos-heading { margin-bottom: var(--reading-space-4); }
body.jciq-youth-site .agm-feature--recap .agm-feature__photo-grid { gap: var(--reading-space-4); }
body.jciq-youth-site .agm-feature--recap .agm-feature__photo-grid figure { display: grid; place-items: center; }
body.jciq-youth-site .agm-feature--recap .agm-feature__photo-grid img { width: auto; max-width: 100%; max-height: 19rem; margin-inline: auto; }
body.jciq-youth-site .agm-feature--recap .agm-candidate-booklet {
  grid-template-columns: minmax(0, 7rem) minmax(0, 1fr);
  gap: var(--reading-space-5);
  margin-top: 0;
  padding: var(--reading-space-5);
}
body.jciq-youth-site .agm-feature--recap .agm-candidate-booklet figure {
  width: 100%;
  max-width: 7rem;
  padding: var(--reading-space-1);
  box-shadow: 3px 3px 0 var(--accent);
}
body.jciq-youth-site .agm-feature--recap .agm-candidate-booklet h3 { margin-block: var(--reading-space-1) var(--reading-space-3); font-size: clamp(1.375rem, 2vw, 1.875rem); line-height: 1.3; }
body.jciq-youth-site .agm-feature--recap .agm-candidate-booklet p:not(.eyebrow) { margin-block: var(--reading-space-3); font-size: 1rem; }
body.jciq-youth-site .agm-feature--recap .agm-candidate-booklet__actions { margin-top: var(--reading-space-3); }

/* Home shows a compact agenda; archive controls and month-grid semantics stay local. */
body.jciq-youth-site .chapter-calendar--home .chapter-calendar__agenda-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
body.jciq-youth-site .chapter-calendar--home .chapter-calendar__agenda-list > li {
  min-width: 0;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}
body.jciq-youth-site .chapter-calendar--home .chapter-calendar__agenda-event {
  height: 100%;
  min-height: 2.75rem;
  flex-direction: column;
  align-items: stretch;
  gap: var(--reading-space-2);
  padding: var(--reading-space-4);
}
body.jciq-youth-site .chapter-calendar--home .chapter-calendar__agenda-when {
  width: auto;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--reading-space-3);
}
body.jciq-youth-site .chapter-calendar--home .chapter-calendar__agenda-title { font-size: 1rem; }
body.jciq-youth-site .chapter-calendar--home .chapter-calendar__preview-more {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  margin: var(--reading-space-4);
  padding: var(--reading-space-3) var(--reading-space-5);
  border: 1px solid var(--blue);
  border-radius: .5rem;
  background: #fff;
  color: var(--blue);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
body.jciq-youth-site .member-zone__benefit { min-height: 15rem; gap: var(--reading-space-5); padding: var(--reading-space-6); transform: none; box-shadow: 5px 5px 0 var(--accent); }
body.jciq-youth-site .member-zone__benefit > span { font-size: clamp(3rem, 5.5vw, 5rem); }
body.jciq-youth-site .member-zone__benefit strong { font-size: clamp(1.5rem, 2.2vw, 2.25rem); line-height: 1.25; }
body.jciq-youth-site :is(.mw-feature-list p, .mw-hint) { font-size: 1rem; line-height: 1.65; }
body.jciq-youth-site .member-zone__hero .quick-links a[href="#member-workspace"] { min-height: 2.75rem; font-size: 1rem; }

/* Archive embeds open on demand; dedicated document readers retain their size. */
body.jciq-youth-site .progress-reader__preview { border-top: 1px solid var(--line); }
body.jciq-youth-site .progress-reader__preview > summary {
  min-height: 2.75rem;
  padding: var(--reading-space-4) var(--reading-space-2);
  color: var(--navy);
  font-size: 1rem;
  font-weight: 750;
  cursor: pointer;
}
body.jciq-youth-site .progress-reader__preview > summary:is(:hover, :focus-visible) { background: #fff; box-shadow: inset 0 -2px 0 rgba(42, 121, 189, .4); }
body.jciq-youth-site .progress-reader__preview[open] > summary { margin-bottom: var(--reading-space-4); }

/* Article navigation is a small inline aid, with a silent visual progress cue. */
body.jciq-youth-site .reading-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--reading-space-2) var(--reading-space-5);
  max-width: var(--reading-measure);
  margin-block: var(--reading-space-5) var(--reading-space-6);
  padding-block: var(--reading-space-3);
  border-block: 1px solid var(--line);
}
body.jciq-youth-site .reading-tools__label { color: var(--muted); font-size: 1rem; font-weight: 700; }
body.jciq-youth-site .reading-tools__links { display: flex; min-width: 0; flex-wrap: wrap; gap: var(--reading-space-2) var(--reading-space-5); }
body.jciq-youth-site .reading-tools a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding-inline: var(--reading-space-1);
  color: var(--blue);
  font-size: 1rem;
  line-height: 1.5;
  text-underline-offset: .2em;
  overflow-wrap: anywhere;
}
body.jciq-youth-site :is(.entry-content, .event-long-content) [id] { scroll-margin-top: calc(var(--reading-header-offset) + var(--reading-space-6)); }
body.jciq-youth-site .reading-progress {
  position: fixed;
  z-index: 31;
  inset: var(--reading-header-offset) 0 auto;
  height: 3px;
  background: #2a79bd;
  transform: scaleX(var(--reading-progress, 0));
  transform-origin: left center;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  body.jciq-youth-site :is(.content-card, .progress-issue, .chapter-story-card, .event-recommendation-card, .activity-story__item) { transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
  body.jciq-youth-site :is(.content-card, .progress-issue, .chapter-story-card, .event-recommendation-card, .activity-story__item):hover { transform: translateY(-2px); }
  body.jciq-youth-site :is(.button, .site-nav a):hover { transform: translateY(-1px); }
}
@media (min-width: 1241px) {
  body.jciq-youth-site .site-nav .menu-item--areas { grid-template-columns: auto 2.75rem; }
  .js body.jciq-youth-site .site-nav .menu-item--areas > .area-submenu-toggle { width: 2.75rem; min-height: 2.75rem; }
}
@media (max-width: 1240px) {
  body.jciq-youth-site { --reading-header-offset: 5.15rem; }
}
/* Keep navigation in document flow when script controls are unavailable. */
@media (max-width: 1240px) {
  html:not(.js) body.jciq-youth-site .site-header { position: relative; }
  html:not(.js) body.jciq-youth-site .site-header__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  html:not(.js) body.jciq-youth-site .site-brand { grid-area: 1 / 1; }
  html:not(.js) body.jciq-youth-site .language-switch { grid-area: 1 / 2; }
  html:not(.js) body.jciq-youth-site .site-nav {
    position: static;
    grid-area: 2 / 1 / auto / -1;
    width: 100%;
    max-height: none;
    overflow: visible;
  }
  html:not(.js) body.jciq-youth-site :is(.nav-toggle, .header-search-toggle, .mobile-assistant-toggle) { display: none; }
}
@media (max-width: 1023px) {
  body.jciq-youth-site .agm-feature--recap .agm-feature__layout { grid-template-columns: minmax(0, 1fr); }
  body.jciq-youth-site .agm-feature--recap .agm-feature__date time { display: flex; flex-wrap: wrap; gap: var(--reading-space-3); }
}
@media (max-width: 720px) {
  body.jciq-youth-site { --reading-header-offset: 4.65rem; }
  body.jciq-youth-site :is(.content-section, .single-entry, .events-hero, .insights-page__hero, .information-hero, .progress-hero, .area-detail-hero, .handbook-hero) { padding-block: var(--reading-space-10); }
  body.jciq-youth-site .about-intro { padding: var(--reading-space-8) var(--reading-space-4); }
  body.jciq-youth-site .youth-home-hero__grid { padding-block: var(--reading-space-6) var(--reading-space-8); }
  body.jciq-youth-site .section-heading { margin-bottom: var(--reading-space-6); }
  body.jciq-youth-site :is(.events-hero, .insights-page__hero, .information-hero, .progress-hero, .area-detail-hero, .handbook-hero, .about-intro, .youth-home-hero) h1 { font-size: clamp(2.125rem, 9.5vw, 3rem); }
  body.jciq-youth-site .language-switch a { min-width: 2.25rem; min-height: 2.75rem; }
  body.jciq-youth-site .chapter-calendar--home .chapter-calendar__agenda-list { grid-template-columns: minmax(0, 1fr); }
  body.jciq-youth-site .member-zone__benefit { min-height: 12rem; padding: var(--reading-space-5); }
  body.jciq-youth-site .mw-gate-grid > form[data-mw-gate] { order: -1; }
  body.jciq-youth-site .agm-feature--recap .agm-feature__photo-grid img { max-height: 16rem; }
  body.jciq-youth-site .agm-feature--recap .agm-candidate-booklet { gap: var(--reading-space-4); padding: var(--reading-space-4); }
}
@media (max-width: 420px) {
  body.jciq-youth-site .agm-feature--recap .agm-candidate-booklet { grid-template-columns: minmax(0, 5rem) minmax(0, 1fr); }
  body.jciq-youth-site .agm-feature--recap .agm-candidate-booklet .button { min-height: 2.75rem; padding: var(--reading-space-3); font-size: 1rem; line-height: 1.4; }
}
@media (prefers-reduced-motion: reduce) {
  body.jciq-youth-site :is(.button, .text-link, .quick-links a, .site-nav a, .language-switch a, .assistant-fab, .reading-tools a, .chapter-calendar__preview-more, .content-card, .progress-issue, .chapter-story-card, .event-recommendation-card, .activity-story__item) { transition: none; }
}
