/* Agints School adapter.
   Maps School onto the shared Agints primitives (assets/agints-system.css) and is loaded last:
   styles.css -> classroom.css -> assets/agints-system.css -> school-brand.css.
   Refinement only: palette, fonts, imagery, copy, gates and layout structure stay as authored.
   styles.css and lesson files carry concurrent course work, so School fixes live here, not there. */

:root {
  /* School color roles. Values match styles.css except --muted, darkened for AA text contrast
     (#687b71 measured 4.1:1 on the canvas; #52685b is 5.6:1 on canvas and 6.0:1 on paper). */
  --ink: #17342c;
  --ink-soft: #38584d;
  --muted: #52685b;
  --line: #dfe7e0;
  --line-strong: #cad8ce;
  --paper: #fff;
  --green: #20503e;
  --green-hover: #153f30;
  --mint: #91f0c4;
  --mint-ink: #123d2c;
  --radius: var(--ag-radius-panel);

  --school-surface-hover: #f7faf6;
  --school-mint-wash: #eaf4ee;
  --school-disabled-bg: #e6ede8;
  --school-disabled-ink: #38584d;
  --school-media: #102522;
  --school-on-media: #fffaf0;
  --school-elev-1: 0 1px 2px rgba(22, 54, 41, .06);
  --school-elev-2: 0 1px 2px rgba(22, 54, 41, .06), 0 12px 30px rgba(22, 54, 41, .09);
  --shadow: var(--school-elev-2);

  /* Classroom aliases (classroom.css) */
  --cr-surface: var(--paper);
  --cr-surface-hover: var(--school-surface-hover);
  --cr-surface-hover-strong: var(--school-surface-hover);
  --cr-surface-accent: var(--school-mint-wash);
  --cr-success-surface: var(--school-mint-wash);
  --cr-track: #dfe8e2;
  --cr-media-bg: var(--school-media);
  --cr-overlay: rgba(16, 37, 34, .86);
  --cr-overlay-hover: rgba(16, 37, 34, .96);
  --cr-on-overlay: var(--school-on-media);
  --cr-elev-1: var(--school-elev-1);
  --cr-elev-2: var(--school-elev-2);
  --cr-radius-card: var(--ag-radius-panel);
  --cr-radius-row: var(--ag-radius-panel);
  --cr-radius-list: var(--ag-radius-panel);
  --cr-radius-control: var(--ag-radius-control);
}

/* Reading text and browser surfaces */
body { font-size: var(--ag-type-body); line-height: var(--ag-leading-body); }
p { overflow-wrap: break-word; }
h1, h2, h3 { text-wrap: balance; }
::selection { background: var(--mint); color: var(--mint-ink); }
input, textarea { caret-color: var(--green); }

/* Page headings: one Manrope role across Classroom, Membership, Community, Updates and About */
.cr-head h1, .page-heading h1 {
  font-family: var(--ag-font-interface);
  font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.25rem);
  line-height: 1.13;
  letter-spacing: -.03em;
  font-weight: 720;
}
.cr-continue-body h2, .cr-map > h2 { font-family: var(--ag-font-interface); font-weight: 700; letter-spacing: -.025em; }
.page-heading > p:not(.section-label) { font-size: var(--ag-type-lead); line-height: var(--ag-leading-body); max-width: var(--ag-measure); }

/* Section labels read as labels, not shouted kickers */
.section-label, .owner-label {
  font-size: var(--ag-type-caption);
  line-height: 1.4;
  letter-spacing: .01em;
  text-transform: none;
  font-weight: 700;
}

/* Type floor: captions 13px, explanatory text 14px, reading text 16px */
.module-status, .availability, .path-part-heading .availability, .chapter-index, .chapter-name small,
.compose-actions span, .lesson-chapter-tab small, .lesson-chapter-tab span, .lesson-toolbar > span,
.offer-status, .pricing-heading span, .discussion-meta, .post-meta, .comment-count, .sidebar-meta,
.comments-section h2 span, .module-number, .module-title small, .price-choice strong small,
.account-email, .preview-caption, .path-steps li::before, .site-footer, .cr-progress-text,
.cr-next-label, .cr-next-meta, .cr-module-number, .cr-module-status, .cr-chapter-meta {
  font-size: var(--ag-type-caption);
}
.price-choice p, .program-notes dt, .program-notes dd, .form-error, .inline-error, .lesson-footnote,
.membership-availability li, .membership-availability li span, .membership-availability-empty,
.membership-availability summary, .path-details summary, .school-preview summary, .path-details p,
.path-details li, .path-finish, .path-heading p, .path-heading p.path-time-caption, .path-lanes p,
.path-outcome, .path-steps li, .path-work-choice > p, .path-foundation p, .post-excerpt, .empty-copy,
.sidebar-note, .sidebar-copy, .toast, .verification-banner, .checkout-banner, .compose-panel label,
.form-stack label, .comment-form label, .auth-tabs button, .back-link, .button-small, .dialog-intro,
.empty-panel > p, .text-action, .button, .chapter-link, .chapter-name, .cr-meta, .cr-facts, .cr-chapter {
  font-size: var(--ag-type-small);
  line-height: 1.5;
}
.price-choice p, .post-excerpt, .sidebar-copy, .sidebar-note, .dialog-intro, .empty-panel > p,
.path-details p, .path-details li, .program-notes dd { line-height: var(--ag-leading-body); }
.comment p, .about-note p, .membership-intro > p:not(.section-label) { font-size: var(--ag-type-body); line-height: var(--ag-leading-body); }
.path-steps strong, .path-lanes h4, .module-title strong { font-size: .9375rem; }
.plan-name { font-size: var(--ag-type-small); }
/* 16px fields keep iOS from zooming on focus */
.compose-panel input, .compose-panel textarea, .form-stack input, .comment-form textarea,
.wl-form input { font-size: var(--ag-type-body); }
.mobile-nav a { font-size: var(--ag-type-body); }

/* Controls: 44px targets, 9px control radius, explicit disabled state */
.button { min-height: var(--ag-control-height); border-radius: var(--ag-radius-control); font-weight: 700; }
.button:disabled, .button[aria-disabled="true"] {
  opacity: 1;
  background: var(--school-disabled-bg);
  color: var(--school-disabled-ink);
  border-color: var(--line-strong);
}
.mobile-menu-button, .icon-button { width: var(--ag-control-height); height: var(--ag-control-height); border-radius: var(--ag-radius-control); }
.brand { min-height: var(--ag-control-height); }
.text-action, .chapter-link, .back-link, .wl-top-cta, .site-footer a, .wl-footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--ag-control-height);
}
.site-footer a, .wl-footer a { min-width: var(--ag-control-height); justify-content: center; }
.auth-tabs button, .account-menu button, .cr-play,
.form-stack input, .compose-panel input, .wl-form input, .wl-form button { min-height: var(--ag-control-height); }
.cr-chapter-link { min-height: var(--ag-control-height); padding-inline: var(--ag-space-4); border-radius: var(--ag-radius-control); font-size: var(--ag-type-small); }
.cr-chapter { min-height: 3.25rem; }
.cr-about > summary { min-height: var(--ag-control-height); }
/* Disclosures keep their native open/closed marker (display: list-item) and gain a full-height target */
.school-preview summary, .path-details summary, .membership-availability summary, .network-note summary {
  min-height: var(--ag-control-height);
  padding-block: .6875rem;
  box-sizing: border-box;
}
.text-action.sidebar-secondary { display: flex; margin-top: 0; width: max-content; }
.account-menu, .toast { border-radius: var(--ag-radius-control); }
.dialog-content h2 { font-family: var(--ag-font-interface); }

/* One focus ring: forest on light surfaces, mint on the dark video plate */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, :where([tabindex]:not([tabindex="-1"])):focus-visible {
  outline: var(--ag-focus-width) solid var(--green);
  outline-offset: var(--ag-focus-offset);
}
.cr-play:focus-visible, .cr-media :focus-visible { outline: var(--ag-focus-width) solid var(--mint); outline-offset: var(--ag-focus-offset); }
.cr-media video:focus-visible { outline-color: var(--mint); outline-offset: calc(var(--ag-focus-width) * -1); }
.wl-final :focus-visible { outline-color: var(--mint); }
.post-row:focus-visible { outline-offset: calc(var(--ag-focus-width) * -1); }
.cr-module summary:focus-visible { outline: var(--ag-focus-width) solid var(--green); outline-offset: calc(var(--ag-focus-width) * -1); }

.skip-link {
  position: fixed;
  top: var(--ag-space-2);
  left: var(--ag-space-4);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: var(--ag-control-height);
  padding: 0 var(--ag-space-4);
  border-radius: var(--ag-radius-control);
  background: var(--green);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

/* Footer: links stay tappable and group cleanly on phones */
.site-footer { height: auto; min-height: 3.5rem; padding-block: var(--ag-space-2); flex-wrap: wrap; column-gap: var(--ag-space-6); }
@media (max-width: 760px) {
  .site-footer { row-gap: 0; padding-block: var(--ag-space-3); }
  .site-footer span { flex-basis: 100%; }
  .site-footer span + span { margin-bottom: var(--ag-space-1); }
  .site-footer a:first-of-type { margin-left: 0; }
  .cr-chapter-link { padding-inline: var(--ag-space-3); }
}

/* Waitlist: struck "was" prices stay readable (#8a978e measured 3.0:1 on white) */
.wl-price del { color: var(--muted); }
.wl-prices .wl-price-all del { color: #bfdccf; }

/* Membership: struck prices readable; the selected plan's (closed) action keeps its emphasis */
.price-choice del { color: var(--muted); }
.price-choice:has(.price-radio.is-selected) .button:disabled { border-color: var(--green); }
.availability-planned { color: var(--muted); }
.wl-price > span { text-transform: none; letter-spacing: .01em; }

/* Continue card: the photo keeps its full 16:9 frame and never spills onto the title and button.
   It is capped to its column; between phone and wide desktop the card stacks instead of squeezing. */
.cr-media { min-width: 0; max-width: 100%; }
@media (min-width: 761px) and (max-width: 1180px) {
  .cr-continue { grid-template-columns: 1fr; }
  .cr-media { min-height: 0; }
}
/* About: one column until there is room for a readable measure beside the sidebar */
@media (max-width: 1000px) { .about-layout { grid-template-columns: 1fr; } }
/* In-app lesson toolbar on phones: title on its own line, both actions share the next row */
@media (max-width: 760px) {
  .lesson-toolbar { row-gap: 0; }
  .lesson-toolbar > span { flex-basis: 100%; order: -1; }
}

/* The in-classroom lesson frame matches the Quiet paper player while it loads */
.lesson-embed { background: #f6f5ef; }

/* Policies page shares the School shell roles */
body > main > .back { display: inline-flex; align-items: center; min-height: var(--ag-control-height); }

/* Soft-exit end card from video-exit.js. Its inline cssText can only be refined with !important;
   remove these once the script uses classes. */
.agints-video-ended { font: 600 var(--ag-type-body)/1.5 var(--ag-font-body) !important; gap: var(--ag-space-4) !important; }
.agints-video-ended button {
  min-height: var(--ag-control-height) !important;
  padding: 0 var(--ag-space-6) !important;
  border-radius: var(--ag-radius-control) !important;
  font: 700 .9375rem/1.2 var(--ag-font-body) !important;
}
.agints-video-ended button:hover { background: #b5f6d8 !important; }
.agints-video-ended button:focus-visible { outline: var(--ag-focus-width) solid var(--school-on-media); outline-offset: var(--ag-focus-offset); }

/* Motion: targeted reduced-motion handling instead of a global kill */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toast { animation: none; }
  .skeleton::after { animation: none; }
  .button, .button:active { transition: none; transform: none; }
  .skip-link { transition: none; }
}
