/* ==========================================================================
   ao-reader.css — the Around OECTA STORY PAGE (member portal), AO M2 2026-09-27.

   Design of record: Figma sLD7GZYZ4YRD05XklhX0Xn · "Member · Story page · 1366×768" (377:2) and
   "· 375×812" (380:2). A story is a PAGE in the module's content area, not a modal (Paul, 2026-09-20):
   a top bar (back · story N of M · print · share), the header, the story AS ITS AUTHOR BUILT IT in a
   sandboxed frame inside one white card, then — outside the frame — reactions + Save, the story's
   resources and previous / next. Tokens only (oecta-tokens.css is loaded by the portal); no hex, no
   inline styles; 44 px targets; no serifs.

   LEFT-ANCHORED (Paul, 2026-09-28: "the article view is with that center squeezed appearance"; the design system's
   no-centre-squeeze rule): the story column starts at the same edge as the feed and never sits in a centred box, and
   the article reads at its measure, left-aligned inside its card. The Figma frames were drawn without the sidebar,
   before that rule — their centring is not carried over.
   ========================================================================== */

.aom-sp {
  container-type: inline-size;     /* the two-column switch reads the PAGE's width, not the device's */
  max-inline-size: none;
  margin: 0;
  padding: 0 0 var(--oecta-space-3xl);
  box-sizing: border-box;
  font-family: var(--oecta-font-body);
  color: var(--oecta-on-surface);
}
.aom-sp .aom-num { font-family: var(--oecta-font-mono); }

/* ── layout: the story column (the reading measure + the card's inset), anchored left; the rail beside it when the
   page has room (Paul, 2026-09-28), underneath it when it does not ─────────────────────────────────────────────── */
.aom-sp-grid {
  display: grid;
  grid-template-columns: minmax(0, 824px);
  column-gap: var(--oecta-space-2xl);
  align-items: start;
}
.aom-sp-main { min-width: 0; }

/* ── top bar ─────────────────────────────────────────────────────────────── */
.aom-sp-bar {
  display: flex;
  align-items: center;
  gap: var(--oecta-space-sm);
  min-height: 52px;
}
.aom-sp-back {
  display: inline-flex;
  align-items: center;
  gap: var(--oecta-space-sm);
  min-height: 44px;
  margin-left: calc(-1 * var(--oecta-space-md));
  padding: var(--oecta-space-sm) var(--oecta-space-md);
  border: 0;
  border-radius: var(--oecta-radius-md);
  background: transparent;
  color: var(--oecta-primary-container);
  font: 600 14px/1 var(--oecta-font-body);
  cursor: pointer;
}
.aom-sp-back .material-icons-outlined { font-size: 18px; }
.aom-sp-back:hover { background: var(--oecta-surface-container); }
.aom-sp-sep { color: var(--oecta-outline-variant); font-size: 14px; }
.aom-sp-pos { color: var(--oecta-text-muted); font-size: 13px; line-height: 19.5px; }
.aom-sp-tools { margin-left: auto; display: flex; gap: var(--oecta-space-xs); position: relative; }
.aom-sp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--oecta-radius-md);
  background: transparent;
  color: var(--oecta-on-surface-variant);
  cursor: pointer;
}
.aom-sp-icon .material-icons-outlined { font-size: 18px; }
.aom-sp-icon:hover { background: var(--oecta-surface-container); }
.aom-sp-more { display: none; }
.aom-sp-menu {
  position: absolute;
  top: 48px;
  right: 0;
  z-index: 5;
  min-width: 160px;
  padding: var(--oecta-space-xs);
  border-radius: var(--oecta-radius-lg);
  background: var(--oecta-surface-lowest);
  box-shadow: var(--oecta-shadow-md);
}
.aom-sp-menu[hidden] { display: none; }
.aom-sp-menu button {
  display: flex;
  align-items: center;
  gap: var(--oecta-space-sm);
  width: 100%;
  min-height: 44px;
  padding: 0 var(--oecta-space-md);
  border: 0;
  border-radius: var(--oecta-radius-md);
  background: transparent;
  color: var(--oecta-on-surface);
  font: 500 14px/1 var(--oecta-font-body);
  text-align: left;
  cursor: pointer;
}
.aom-sp-menu button:hover { background: var(--oecta-surface-container); }

/* ── header ──────────────────────────────────────────────────────────────── */
.aom-sp-head {
  display: grid;
  gap: var(--oecta-space-md);
  max-width: 760px;
  padding-top: var(--oecta-space-lg);
}
.aom-sp-eyebrow {
  margin: 0;
  color: var(--oecta-text-muted);
  font: 600 12px/12px var(--oecta-font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.aom-sp-title {
  margin: 0;
  color: var(--oecta-on-surface);
  font: 800 40px/46px var(--oecta-font-display);
  letter-spacing: -0.01em;
  outline: none;
}
.aom-sp-standfirst {
  margin: 0;
  color: var(--oecta-on-surface-variant);
  font: 500 18px/1.45 var(--oecta-font-body);
}
.aom-sp-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--oecta-space-sm) var(--oecta-space-md);
  padding-top: var(--oecta-space-xs);
  color: var(--oecta-text-muted);
  font-size: 13px;
  line-height: 19.5px;
}
.aom-sp-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--oecta-surface-active);
  color: var(--oecta-text-muted);
  font: 600 11px/1 var(--oecta-font-display);
}
.aom-sp-author { color: var(--oecta-on-surface); font-weight: 600; }
.aom-sp-byline .aom-num { color: var(--oecta-on-surface-variant); }

/* statutory notice: official, above the story (kept from the reader it replaces) */
.aom-sp-statutory {
  display: flex;
  gap: var(--oecta-space-md);
  max-width: 760px;
  margin-top: var(--oecta-space-lg);
  padding: var(--oecta-space-md) var(--oecta-space-lg);
  border-radius: var(--oecta-radius-lg);
  background: var(--oecta-error-soft);
  color: var(--oecta-on-surface);
  font-size: 14px;
  line-height: 1.5;
}
.aom-sp-statutory .material-icons-outlined { color: var(--oecta-error); font-size: 20px; }
.aom-sp-statutory strong { display: block; color: var(--oecta-error); }

/* ── the story, as built ─────────────────────────────────────────────────── */
.aom-sp-card {
  margin-top: var(--oecta-space-xl);
  padding: var(--oecta-space-md) var(--oecta-space-sm);
  border-radius: var(--oecta-radius-xl);
  background: var(--oecta-surface-lowest);
  box-shadow: var(--oecta-shadow-sm);
}
.aom-sp-cover {
  display: block;
  width: 100%;
  max-width: 720px;
  margin: var(--oecta-space-md) 0 var(--oecta-space-md) 20px;   /* in line with the article's text edge */
  border-radius: var(--oecta-radius-lg);
}
.aom-sp-frame {
  display: block;
  width: 100%;
  min-height: 240px;
  border: 0;
  background: transparent;
}
.aom-sp-fallback { max-width: 720px; margin: 0; padding: var(--oecta-space-lg) 20px; }

/* ── after the story ─────────────────────────────────────────────────────── */
.aom-sp-rail {
  display: grid;
  gap: var(--oecta-space-2xl);
  padding-top: var(--oecta-space-2xl);
}
.aom-sp-rx {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--oecta-space-sm);
}
.aom-sp-rx-q { padding-right: var(--oecta-space-sm); color: var(--oecta-text-muted); font-size: 13px; }
.aom-sp .aom-sp-rx .aom-rx-btn,
.aom-sp .aom-sp-save {
  display: inline-flex;
  align-items: center;
  gap: var(--oecta-space-sm);
  min-height: 44px;
  padding: 0 var(--oecta-space-lg);
  border: 0;
  border-radius: var(--oecta-radius-pill);
  background: var(--oecta-surface-lowest);
  box-shadow: var(--oecta-shadow-xs);
  color: var(--oecta-on-surface-variant);
  font: 600 13px/1 var(--oecta-font-body);
  cursor: pointer;
}
.aom-sp .aom-sp-rx .aom-rx-btn .material-icons-outlined,
.aom-sp .aom-sp-save .material-icons-outlined { font-size: 18px; }
.aom-sp .aom-sp-rx .aom-rx-count {            /* a plain number (the design), not the feed card's chip */
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--oecta-text-muted);
  font: 500 13px/1 var(--oecta-font-mono);
}
.aom-sp .aom-sp-rx .aom-rx-tick { display: none; }
.aom-sp .aom-sp-rx .aom-rx-btn.aom-rx-active {
  background: var(--oecta-surface-container);
  box-shadow: none;
  color: var(--oecta-primary-container);
}
.aom-sp .aom-sp-rx .aom-rx-btn.aom-rx-active .aom-rx-count { background: transparent; color: var(--oecta-primary-container); }
.aom-sp .aom-sp-save { margin-left: auto; }
.aom-sp .aom-sp-save.aom-bookmarked { background: var(--oecta-surface-container); color: var(--oecta-primary-container); box-shadow: none; }

.aom-sp-section-title {
  margin: 0 0 var(--oecta-space-md);
  color: var(--oecta-text-muted);
  font: 600 12px/12px var(--oecta-font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.aom-sp-res {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--oecta-space-md);
}
.aom-sp-tile {
  display: flex;
  align-items: center;
  gap: var(--oecta-space-md);
  min-height: 64px;
  padding: var(--oecta-space-md) var(--oecta-space-lg);
  border-radius: var(--oecta-radius-lg);
  background: var(--oecta-surface-lowest);
  box-shadow: var(--oecta-shadow-xs);
  color: var(--oecta-on-surface);
  text-decoration: none;
  box-sizing: border-box;
}
.aom-sp-tile .material-icons-outlined { flex-shrink: 0; font-size: 22px; color: var(--oecta-on-surface-variant); }
.aom-sp-tile-text { display: grid; gap: 2px; min-width: 0; }
.aom-sp-tile-label { overflow: hidden; font-size: 14px; font-weight: 600; line-height: 18.2px; text-overflow: ellipsis; }
.aom-sp-tile-meta { overflow: hidden; color: var(--oecta-text-muted); font-size: 12px; line-height: 18px; white-space: nowrap; text-overflow: ellipsis; }
a.aom-sp-tile:hover { box-shadow: var(--oecta-shadow-sm); }

.aom-sp-seq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--oecta-space-md);
}
.aom-sp-seq-card {
  display: flex;
  align-items: center;
  gap: var(--oecta-space-md);
  min-height: 88px;
  padding: var(--oecta-space-lg) var(--oecta-space-xl);
  border: 0;
  border-radius: var(--oecta-radius-lg);
  background: var(--oecta-surface-lowest);
  box-shadow: var(--oecta-shadow-xs);
  color: var(--oecta-on-surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.aom-sp-seq-card:hover { box-shadow: var(--oecta-shadow-sm); }
.aom-sp-seq-card .material-icons-outlined { flex-shrink: 0; font-size: 22px; color: var(--oecta-on-surface-variant); }
.aom-sp-seq-card--next { grid-column: 2; justify-content: flex-end; text-align: right; }
.aom-sp-seq-text { display: grid; gap: 2px; min-width: 0; }
.aom-sp-seq-kicker { color: var(--oecta-text-muted); font-size: 12px; line-height: 18px; }
.aom-sp-seq-title { font: 700 15px/19.5px var(--oecta-font-display); }

.aom-sp :focus-visible {
  outline: 2px solid var(--oecta-primary-container);
  outline-offset: 2px;
}
/* The heading takes focus on arrival only so a screen reader starts at the story — it is not a control: no ring. */
.aom-sp .aom-sp-title:focus,
.aom-sp .aom-sp-title:focus-visible { outline: none; }

/* ── wide: the rail beside the story (after the base rules, so these win) ─────────────────────────────────── */
@container (min-width: 1060px) {
  .aom-sp-grid { grid-template-columns: minmax(0, 824px) minmax(280px, 340px); }
  .aom-sp-rail {
    padding-top: calc(52px + var(--oecta-space-lg));   /* level with the eyebrow, under the top bar */
    gap: var(--oecta-space-xl);
  }
  .aom-sp-rail .aom-sp-rx-q { flex-basis: 100%; }
  .aom-sp-rail .aom-sp-rx .aom-rx-btn { flex: 1 1 auto; justify-content: center; }
  .aom-sp-rail .aom-sp-save { flex-basis: 100%; justify-content: center; margin-left: 0; }
  .aom-sp-rail .aom-sp-res,
  .aom-sp-rail .aom-sp-seq { grid-template-columns: minmax(0, 1fr); }
  .aom-sp-rail .aom-sp-seq-card--next { grid-column: auto; justify-content: flex-start; text-align: left; flex-direction: row-reverse; }
}

/* ── phone (design 380:2) ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .aom-sp { max-inline-size: none; padding: 0 0 var(--oecta-space-2xl); }
  .aom-sp-back-label, .aom-sp-sep, .aom-sp-pos { display: none; }
  .aom-sp-icon:not(.aom-sp-more) { display: none; }
  .aom-sp-more { display: inline-flex; }
  .aom-sp-title { font-size: 30px; line-height: 34px; }
  .aom-sp-standfirst { font-size: 16px; }
  .aom-sp-card { margin-top: var(--oecta-space-lg); padding: var(--oecta-space-sm) 0; border-radius: var(--oecta-radius-lg); }
  .aom-sp-rail { gap: var(--oecta-space-xl); }
  .aom-sp-rx-q { flex-basis: 100%; }
  .aom-sp .aom-sp-rx .aom-rx-btn { flex: 1 1 auto; justify-content: center; }   /* three pills: two per line, the third wraps */
  .aom-sp .aom-sp-save { flex-basis: 100%; justify-content: center; margin-left: 0; }
  .aom-sp-res, .aom-sp-seq { grid-template-columns: minmax(0, 1fr); }
  .aom-sp-seq-card--next { grid-column: auto; justify-content: flex-start; text-align: left; flex-direction: row-reverse; }
}

