/* AMZ-11H: styles for EDU1 educational guides only (linked from those pages; no other page loads this file). Reuses the reviewed
   AMZ-11D/11E preview rules for source-note references, labelled stacked tables, the ordered signal-flow figure and native FAQ
   disclosures, on the shared SpecCairn tokens from src/styles/global.css. Same-origin stylesheet: no inline styles (CSP style-src 'self'). */

/* source-note references and the numbered note list */
sup.refs { font-size: 0.72em; line-height: 0; white-space: nowrap; margin-left: 0.1em; }
a.ref { display: inline-block; min-width: 1.45em; padding: 0.15em 0.3em; margin: 0 0.05em; border-radius: 4px; text-align: center; text-decoration: none; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); }
a.ref:hover { text-decoration: underline; }
.ref-notes { padding-left: 1.6rem; font-size: 0.93rem; }
.ref-notes li { margin-bottom: var(--space-3); scroll-margin-top: 6rem; overflow-wrap: anywhere; }
.ref-notes li:target { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.ref-notes .note-detail { display: block; font-size: 0.88rem; color: var(--ink-muted); }
.backref { white-space: nowrap; font-size: 0.85rem; }

/* tables: scroll region on wide screens, labelled stacked rows on narrow screens (ARIA roles keep the table semantics) */
.stack-wrap caption { font-size: 0.95rem; }
.stack-table th[scope="row"] { width: auto; min-width: 9rem; }
@media (max-width: 40rem) {
  .stack-wrap { overflow: visible; border: 0; background: transparent; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table th, .stack-table td { display: block; width: 100%; }
  .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .stack-table tr { border: 1px solid var(--line); background: var(--surface); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-3); border-radius: var(--radius); }
  .stack-table th, .stack-table td { border: 0; padding: var(--space-1) 0; min-width: 0; }
  .stack-table th[scope="row"] { font-size: 1rem; padding-bottom: var(--space-2); }
  .stack-table td::before { content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); }
}

/* original signal-flow figure: an ordered list of devices (readable as text); arrows are decorative */
.flow { margin: var(--space-5) 0; }
.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 48rem) { .flow-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-7); } }
.flow-node { position: relative; border: 2px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); margin: 0; }
.flow-node + .flow-node::before { content: "\2193" / ""; position: absolute; top: calc(-1 * var(--space-6) + 0.1rem); left: 50%; transform: translateX(-50%); font-size: 1.4rem; line-height: 1; color: var(--teal); font-weight: 800; }
@media (min-width: 48rem) { .flow-node + .flow-node::before { content: "\2192" / ""; top: 50%; left: calc(-1 * var(--space-7) + 0.25rem); transform: translateY(-50%); } }
.flow-device { font-weight: 800; font-size: 1.05rem; }
.flow-port { align-self: flex-start; font-family: var(--mono); font-size: 0.85rem; font-weight: 700; border-radius: 6px; padding: 0.1rem 0.45rem; border: 1px solid; }
.flow-port--out { color: var(--accent); border-color: var(--accent); }
.flow-port--in { color: var(--teal); border-color: var(--teal); }
.flow-setting { font-size: 0.85rem; background: var(--state-unknown-bg); color: var(--state-unknown); border-radius: 6px; padding: 0.1rem 0.45rem; align-self: flex-start; font-weight: 600; }
.flow-role { font-size: 0.85rem; color: var(--ink-muted); }
.flow figcaption { margin-top: var(--space-3); font-size: 0.9rem; color: var(--ink-muted); }

/* native FAQ disclosures */
.faq-list { display: grid; gap: var(--space-3); }
.faq { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.faq[open] { border-color: var(--teal); }
.faq summary { cursor: pointer; list-style: none; padding: var(--space-4) var(--space-5); font-weight: 750; display: flex; justify-content: space-between; gap: var(--space-3); border-radius: var(--radius-lg); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+" / ""; color: var(--teal); font-size: 1.4rem; line-height: 1; font-weight: 500; flex: none; }
.faq[open] summary::after { content: "\2212" / ""; }
.faq-a { padding: 0 var(--space-5) var(--space-3); }

@media (forced-colors: active) {
  .faq, .flow-node, .stack-table tr { border: 1px solid CanvasText; }
  a.ref { border: 1px solid LinkText; }
}
