/* Standalone learning resource adapter. Load after the unchanged shared theme.
 * Opt-in body only. Canonical token values are copied exactly from the versioned
 * campus baseline recorded in MANIFEST; old resource CSS still owns layout/print.
 */
@media screen {
  body.am-community-resource {
    --bg:#07111f; --panel:#0e1b2d; --panel2:#122238; --line:#263a52;
    --text:#f7fbff; --body:#c5d2df; --muted:#8da1b7;
    --cyan:#22d3ee; --pink:#d946ef; --green:#34d399; --danger:#fb7185;
    --font:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
    --display:"Space Grotesk",Inter,sans-serif;
    --field:var(--bg);
    background:var(--bg); color:var(--text); font-family:var(--font);
  }
  /* Landing meta CSP explicitly forbids fonts. Never select a downloadable face. */
  body.am-community-resource[data-resource-fonts="system"] {
    --font:system-ui,-apple-system,"Segoe UI",sans-serif;
    --display:system-ui,-apple-system,"Segoe UI",sans-serif;
  }
  body.am-community-resource :where(h1,h2,h3,legend) { font-family:var(--display); color:var(--text); }
  body.am-community-resource :where(a) { color:var(--cyan); }
  body.am-community-resource :where(.eyebrow,.step-caption) { color:var(--cyan); }
  body.am-community-resource :where(.meta,.copy-note,.hint,.save-note,.intro) { color:var(--body); }
  body.am-community-resource :where(.masthead,.session) { border-color:var(--line); }
  body.am-community-resource :where(details,.support,.export-panel) {
    background:var(--panel); border-color:var(--line); border-radius:var(--community-card-radius,18px);
  }
  body.am-community-resource :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),textarea,select) {
    background:var(--field); color:var(--text); border-color:var(--muted);
    border-radius:var(--community-control-radius,12px);
  }
  /* Preserve resource 48px buttons; shared 44px rule must not shrink them. */
  body.am-community-resource button { min-block-size:48px; line-height:1.35; }
  body.am-community-resource .step-nav button { font-size:.9rem; }
  body.am-community-resource button.secondary {
    background:var(--panel); color:var(--text); border-color:var(--line);
  }
  body.am-community-resource button.primary:not(.secondary):not(.danger):not(:disabled):not([aria-disabled="true"]),
  body.am-community-resource a.download:not([aria-disabled="true"]) {
    background:var(--cyan); color:var(--bg); border-color:var(--cyan);
    border-radius:var(--community-control-radius,12px);
  }
  body.am-community-resource button.primary:not(.secondary):not(.danger):not(:disabled):not([aria-disabled="true"]):hover,
  body.am-community-resource a.download:not([aria-disabled="true"]):hover { border-color:var(--text); }
  body.am-community-resource :where(a,button,input,textarea,select,summary,[tabindex]):focus-visible {
    outline:3px solid var(--cyan); outline-offset:4px;
  }
  body.am-community-resource :where(button.primary,a.download):focus-visible { outline-color:var(--text); }
}
@media screen and (forced-colors:active) {
  body.am-community-resource {
    --bg:Canvas; --panel:Canvas; --panel2:Canvas; --field:Canvas;
    --text:CanvasText; --body:CanvasText; --muted:CanvasText; --line:CanvasText;
    --cyan:LinkText; --pink:CanvasText;
  }
  body.am-community-resource button.primary:not(.secondary):not(.danger):not(:disabled):not([aria-disabled="true"]),
  body.am-community-resource a.download:not([aria-disabled="true"]) {
    background:Highlight; color:HighlightText; border-color:Highlight;
  }
  body.am-community-resource button.secondary {
    background:ButtonFace; color:ButtonText; border-color:ButtonText;
  }
  body.am-community-resource :is(button,input,textarea,select):is(:disabled,[aria-disabled="true"]),
  body.am-community-resource a.download[aria-disabled="true"] {
    background:ButtonFace; color:GrayText; border-color:GrayText; opacity:1;
  }
  body.am-community-resource :where(a,button,input,textarea,select,summary,[tabindex]):focus-visible { outline-color:Highlight; }
}
/* Keep the landing's original visible system fallback during print too.
 * Other resource print styles, layout and visibility stay fully untouched. */
@media print {
  body.am-community-resource[data-resource-fonts="system"],
  body.am-community-resource[data-resource-fonts="system"] :where(h1,h2,h3,legend) {
    font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  }
}
/* Entry session titles: allow a long word to reflow at text200. */
@media screen {
  body.am-community-resource .session h2 { overflow-wrap:anywhere; }
}
/* Real skip anchors use .skip (entry/cases) or .skip-link (S13-S16).
 * Keep their existing focus positioning; restore explicit foreground/background. */
@media screen {
  body.am-community-resource a.skip,
  body.am-community-resource a.skip-link { color:var(--bg); background:var(--cyan); }
}
@media screen and (forced-colors:active) {
  body.am-community-resource a.skip,
  body.am-community-resource a.skip-link { color:HighlightText; background:Highlight; }
}