/* Year 9 Science, Unit 1: "Acids in this unit" reference page.
 *
 * Screen: a calm reading page in the house tokens, the 1.6 links in the
 * "table" strand colour (gold) and the 1.7 links in the "change" strand colour
 * (tangerine), the same pairing the unit page uses for those sections.
 * Print: one A4 lab card, true black on white, no background colours, dark
 * table rules, the QR code, no site chrome. */

.acids {
    --acids-ink: var(--ink);
    --acids-gold: color-mix(in srgb, var(--gold) 45%, var(--ink));
    --acids-change: color-mix(in srgb, var(--tangerine) 60%, var(--ink));
    max-width: 52rem;
    margin: 0 auto;
    padding: 1.5rem 16px 3rem;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--acids-ink);
}

.acids-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
}
.acids-kicker {
    margin: 0 0 0.25rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.acids h1 { margin: 0; font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.15; font-weight: 800; }

.acids-qr { margin: 0; flex: 0 0 auto; width: 7.5rem; text-align: center; }
.acids-qr-svg { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.acids-qr figcaption { margin-top: 0.25rem; font-size: 0.75rem; line-height: 1.3; color: var(--muted); }

.acids-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.9375rem;
}
.acids-back { color: var(--teal-deep); font-weight: 600; text-decoration: none; }
.acids-back:hover { text-decoration: underline; }
.acids-lang { display: inline-flex; gap: 0.25rem; margin-left: auto; }
.acids-lang a {
    padding: 0.125rem 0.625rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--acids-ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8125rem;
}
.acids-lang a[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.acids-print {
    padding: 0.4rem 0.9rem;
    border: 0;
    border-radius: 8px;
    background: var(--teal-deep);
    color: var(--paper);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
}
.acids-print:hover { background: var(--ink); }
.acids :focus-visible { outline: 3px solid var(--teal-deep); outline-offset: 2px; border-radius: 4px; }

.acids-body h2 {
    margin: 2rem 0 0.5rem;
    font-size: 1.375rem;
    font-weight: 800;
    line-height: 1.25;
}
.acids-body p { margin: 0 0 1rem; }
.acids-body ul { margin: 0 0 1rem; padding-left: 1.4rem; }
.acids-body li { margin-bottom: 0.35rem; }
.acids-body strong { font-weight: 700; }

.acids-table-wrap { margin: 0 0 1.25rem; overflow-x: auto; }
.acids-table { width: 100%; border-collapse: collapse; font-size: 0.9688rem; line-height: 1.45; background: var(--paper); }
.acids-table th, .acids-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
.acids-table thead th { background: var(--mint); color: var(--teal-deep); font-weight: 700; }
.acids-table tbody th { font-weight: 600; background: var(--cream); }

.acids-where { list-style: none; padding-left: 0; }
.acids-link {
    --acids-strand: var(--teal);
    display: block;
    padding: 0.5rem 0.75rem;
    border-left: 5px solid var(--acids-strand);
    border-radius: 0 8px 8px 0;
    background: color-mix(in srgb, var(--acids-strand) 12%, var(--paper));
    color: var(--acids-ink);
    text-decoration: none;
}
.acids-link:hover { background: color-mix(in srgb, var(--acids-strand) 22%, var(--paper)); text-decoration: underline; }
.acids-link--table { --acids-strand: var(--gold); }
.acids-link--change { --acids-strand: var(--tangerine); }

@media (max-width: 575.98px) {
    .acids { font-size: 1rem; padding-top: 1rem; }
    .acids-qr { width: 5.5rem; }
}

/* ------------------------------------------------------------ lab card */
@page { size: A4; margin: 10mm; }

/* ------------------------------------------------ the formulae pieces
   Screen only (d-print-none). One colour per element everywhere on the page. */

.acids-extra {
    --el-H: color-mix(in srgb, var(--cyan) 38%, var(--paper));
    --el-O: color-mix(in srgb, var(--tangerine) 30%, var(--paper));
    --el-Cl: color-mix(in srgb, var(--gold) 45%, var(--paper));
    --el-S: color-mix(in srgb, var(--teal) 28%, var(--paper));
    --el-C: color-mix(in srgb, var(--muted) 28%, var(--paper));
    --el-metal: color-mix(in srgb, var(--ink) 14%, var(--paper));
    margin: 1.5rem 0;
    padding: 1.1rem 1.15rem 1.2rem;
    border: 2px solid var(--ink);
    border-radius: 16px;
    background: var(--paper);
}
.acids-extra h3 { margin: 0 0 0.35rem; font-size: 1.2rem; font-weight: 800; line-height: 1.2; }
.acids-extra > p { margin: 0 0 0.8rem; max-width: 62ch; }
.acids-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.acids-rx { display: grid; gap: 0.5rem; margin: 0 0 0.75rem; padding: 0.85rem 1rem; border: 1.5px solid var(--line); border-radius: 12px; }
.acids-rx[hidden] { display: none; }
.acids-kind { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal-deep); }
.acids-word { margin: 0; font-weight: 600; }
.acids-more summary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}
.acids-more summary::-webkit-details-marker { display: none; }
.acids-more[open] summary { background: var(--ink); color: var(--paper); }
.acids-more .acids-sym { margin-top: 0.75rem; }

/* Positioned, so the screen-reader text inside stays inside a scrolling table. */
.acids-sym {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0;
    font-size: clamp(1.25rem, 3.4vw, 1.7rem);
    font-weight: 800;
    line-height: 1.25;
}
.acids-sym--cell { display: inline-flex; font-size: 1.15rem; }
.acids-op { font-weight: 600; color: var(--muted); }
.acids-sp { display: inline-flex; align-items: baseline; white-space: nowrap; }
.acids-k { margin-right: 4px; }
.acids-st { margin-left: 2px; font-size: 0.5em; font-weight: 600; color: var(--muted); }
.acids-el { padding: 0 3px; border-radius: 6px; transition: opacity 0.5s; }
.acids-el sub { font-size: 0.6em; }
.acids-el--H { background: var(--el-H); }
.acids-el--O { background: var(--el-O); }
.acids-el--Cl { background: var(--el-Cl); }
.acids-el--S { background: var(--el-S); }
.acids-el--C { background: var(--el-C); }
.acids-el--metal { background: var(--el-metal); }
.is-following .acids-sym .acids-el:not(.acids-el--H), .is-following .acids-sym .acids-k, .is-following .acids-sym .acids-op { opacity: 0.25; }
@media (prefers-reduced-motion: reduce) { .acids-el { transition: none; } }

.acids-note { margin: 0.6rem 0 0; padding: 0.6rem 0.9rem; border-left: 4px solid var(--tangerine); border-radius: 0 10px 10px 0; background: var(--mint); font-weight: 600; }
.acids-follow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--muted); font-size: 0.92rem; }
.acids-follow[hidden], .acids-pick[hidden] { display: none; }
.acids-chip {
    min-height: 44px;
    padding: 0 16px;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--paper);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
}
.acids-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.acids-chip:focus-visible, .acids-more summary:focus-visible { outline: 3px solid var(--tangerine); outline-offset: 2px; }
.acids-pick { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-bottom: 0.9rem; }
.acids-pick fieldset { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.acids-pick legend { float: left; margin: 0 6px 0 0; padding: 0; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.acids-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0.4rem 0 0; padding: 0; list-style: none; font-size: 0.86rem; color: var(--muted); }
.acids-key li { display: inline-flex; align-items: center; gap: 6px; }
.acids-key .acids-el { display: inline-block; width: 16px; height: 16px; padding: 0; border: 1px solid var(--ink); border-radius: 4px; }
.acids-atomrow { display: flex; flex-wrap: wrap; gap: 4px; }
.acids-atom { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1.5px solid var(--ink); border-radius: 50%; font-size: 0.66rem; font-weight: 700; }
.acids-why td, .acids-why th, .acids-atoms td, .acids-atoms th { vertical-align: middle; }

/* The page sits in the unit's shell, beside the unit's side menu. */
.sci-labunit { --sci-head-h: 0px; }
.sci-labmain { padding-bottom: 40px; }

@media print {
    .sci-unit { margin: 0 !important; background: white !important; font-size: inherit; line-height: inherit; }
    .sci-shell { display: block !important; }
    .sci-main { padding: 0 !important; }
    #beta-banner, .jmaths-nav, .mobile-nav, body > footer, .messages,
    #cookie-notice, .cookie-notice, .d-print-none { display: none !important; }
    html, body, .page-wrapper { background: white !important; padding: 0 !important; margin: 0 !important; }

    .acids {
        max-width: none;
        margin: 0;
        padding: 0;
        font-size: 11pt;
        line-height: 1.3;
        color: black;
        background: white;
    }
    .acids * { color: black !important; background: transparent !important; box-shadow: none !important; }

    .acids-head { margin-bottom: 3mm; padding-bottom: 2mm; border-bottom: 1.5pt solid black; align-items: center; }
    .acids h1 { font-size: 20pt; }
    .acids-kicker { font-size: 8pt; margin-bottom: 1mm; }
    .acids-qr { width: 32mm; }
    .acids-qr-svg { border: 0; border-radius: 0; }
    .acids-qr figcaption { font-size: 8pt; margin-top: 0; }

    .acids-body { column-count: 2; column-gap: 8mm; }
    .acids-body h2 { margin: 3mm 0 1mm; font-size: 13pt; break-after: avoid; }
    .acids-body p { margin: 0 0 1.5mm; orphans: 2; widows: 2; }
    .acids-body ul { margin: 0 0 1.5mm; padding-left: 4.5mm; }
    .acids-body li { margin-bottom: 0.5mm; break-inside: avoid; }
    .acids-body strong { font-weight: 800; }

    .acids-table-wrap { margin: 0 0 2mm; overflow: visible; break-inside: avoid; }
    .acids-table { font-size: 10pt; line-height: 1.25; }
    .acids-table th, .acids-table td { padding: 1mm 1.5mm; border: 0.75pt solid black; }
    .acids-table thead th { font-weight: 800; border-bottom-width: 1.5pt; }
    .acids-table tbody th { font-weight: 700; }

    .acids a[href]::after { content: none !important; }
    .acids-link { padding: 0; border: 0; border-radius: 0; text-decoration: none; }
    .acids-where { padding-left: 4.5mm; list-style: disc; }
}
