/* ==========================================================================
   Manch — the published pages: the Standard, Transparency, Front Row.

   Loaded only by those three. Everything is scoped under .pubpage and every
   class carries the `pub` prefix, because app.css and shell.css own the short
   generic names and reach every page — `.rule` there is already an uppercase
   divider, which is exactly the kind of silent collision this avoids.
   ========================================================================== */

.pubpage {
    max-width: 760px;
    margin-inline: auto;
    padding-bottom: clamp(2rem, 5vw, 4rem);
}
.pubpage--narrow { max-width: 520px; }

.pubpage .nums { font-variant-numeric: tabular-nums; }

/* --- head ----------------------------------------------------------------- */

.pubpage__head { margin-bottom: clamp(1.75rem, 4vw, 2.5rem); }

.pubpage__title {
    margin: 0.75rem 0 0;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.pubpage__title--big { font-size: clamp(2rem, 6vw, 2.75rem); }

.pubpage__lede {
    margin: 0.875rem 0 0;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink-3);
    text-wrap: pretty;
}

.pubpage__empty { margin: 0; font-size: 0.875rem; color: var(--ink-4); }

.pubpage__fine {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--ink-4);
}

/* --- a shared panel -------------------------------------------------------- */

.pubpage__panel {
    padding: clamp(1rem, 2vw, 1.375rem);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
}
.pubpage__panel .kicker { display: block; margin-bottom: 0.875rem; }

/* --- the six rules --------------------------------------------------------- */

.pubpage__rules {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.375rem;
}

.pubrule {
    padding: clamp(1rem, 2vw, 1.375rem);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
}

.pubrule__n {
    margin: 0 0 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--accent);
}

.pubrule__head {
    margin: 0 0 0.375rem;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.pubrule__body { margin: 0; font-size: 0.875rem; line-height: 1.6; color: var(--ink-3); }

/* --- the strike ladder ------------------------------------------------------
   A definition list, because that is what it is: a claim, and what it costs. */

.publadder { margin: 0; }

.publadder dt {
    padding-top: 0.625rem;
    font-size: 0.875rem;
    font-weight: 600;
}
.publadder dd {
    margin: 0.1875rem 0 0;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--ink-3);
}
.publadder dd:last-child { border-bottom: 0; padding-bottom: 0; }

/* --- the transparency figures ----------------------------------------------- */

.pubfigs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(0.625rem, 1.4vw, 1rem);
    margin-bottom: 1.375rem;
}

.pubfig {
    padding: clamp(0.875rem, 1.8vw, 1.25rem);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
}

.pubfig__n {
    margin: 0;
    font-size: clamp(1.375rem, 2.6vw, 1.875rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.pubfig__k {
    margin: 0.3125rem 0 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-4);
}

/* --- the decisions list ------------------------------------------------------ */

.pubdecs { list-style: none; margin: 0; padding: 0; }

.pubdec {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.875rem;
}
.pubdec:last-child { border-bottom: 0; }

.pubdec__what { color: var(--ink-2); }
.pubdec__why { color: var(--ink-4); }
.pubdec__when { flex: none; font-size: 0.75rem; color: var(--ink-4); }

/* --- front row --------------------------------------------------------------- */

.pubperks { list-style: none; margin: 0; padding: 0; }

.pubperk {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.875rem;
}
.pubperk:last-child { border-bottom: 0; }
.pubperk__tick { color: #5fbf87; }

.pubplan {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    padding: clamp(0.875rem, 1.8vw, 1.125rem);
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card);
}
.pubplan--best { border-color: var(--accent); background: var(--accent-soft); }

.pubplan__name { margin: 0; font-size: 0.9375rem; font-weight: 700; }
.pubplan__note {
    margin: 0.1875rem 0 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}
.pubplan__price {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.pubpage__cta {
    width: 100%;
    margin-top: 1.125rem;
    padding: 0.875rem;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #140702;
    cursor: pointer;
}
.pubpage__cta:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- a supplied document: Terms, Privacy, Content Policy, About ------------

   Long documents that are read, not browsed, so the measure stays narrow and
   the vertical rhythm does the work of separating clauses. The contents rail
   sits beside the text where there is room and above it where there is not. */

.pubpage--doc { max-width: 1000px; }

.pubdoc__when {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
    color: var(--ink-4);
}

.pubpage--doc .pubpage__head {
    padding-bottom: clamp(1.25rem, 3vw, 1.75rem);
    border-bottom: 1px solid var(--line);
}

/* the contents rail */

.pubdoc__toc {
    position: sticky;
    top: calc(var(--header-h, 60px) + 1.25rem);
    float: right;
    width: 232px;
    max-height: calc(100vh - var(--header-h, 60px) - 4rem);
    margin: clamp(1.5rem, 4vw, 2.25rem) 0 1.5rem 2.5rem;
    padding: 1rem 0.25rem 1rem 1.125rem;
    border-left: 1px solid var(--line);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.pubdoc__toc .kicker { display: block; margin-bottom: 0.75rem; }

.pubdoc__tocl {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4375rem;
}
.pubdoc__tocl a {
    display: block;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--ink-4);
    text-decoration: none;
    text-transform: lowercase;
    font-variant: small-caps;
    letter-spacing: 0.01em;
}
.pubdoc__tocl a:hover { color: var(--ink-1); }

/* the document itself */

.pubdoc {
    max-width: 62ch;
    padding-top: clamp(1.5rem, 4vw, 2.25rem);
}

.pubdoc__h {
    margin: clamp(2rem, 5vw, 2.75rem) 0 0.875rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    scroll-margin-top: calc(var(--header-h, 60px) + 1.5rem);
}
.pubdoc__h:first-child { margin-top: 0; }

.pubdoc__sh {
    margin: 1.625rem 0 0.5rem;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink-1);
}

.pubdoc__p {
    margin: 0 0 0.875rem;
    font-size: 0.9375rem;
    line-height: 1.75;
    color: var(--ink-3);
    text-wrap: pretty;
}

.pubdoc__ul {
    margin: 0 0 1.125rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4375rem;
}
.pubdoc__ul li {
    position: relative;
    padding-left: 1.125rem;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--ink-3);
}
.pubdoc__ul li::before {
    content: '';
    position: absolute;
    top: 0.7em;
    left: 0.1875rem;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

/* Appendix A of the Terms, kept as the table it is in the document. */

.pubdoc__tw {
    margin: 0.5rem 0 1.375rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow-x: auto;
}
.pubdoc__t {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.pubdoc__t th,
.pubdoc__t td {
    padding: 0.625rem 0.875rem;
    text-align: left;
    vertical-align: top;
    line-height: 1.55;
    border-bottom: 1px solid var(--line);
}
.pubdoc__t tr:last-child td { border-bottom: 0; }
.pubdoc__t th {
    background: var(--card);
    font-weight: 700;
    color: var(--ink-1);
}
.pubdoc__t td { color: var(--ink-3); }

/* --- no room for the rail --------------------------------------------------- */

@media (max-width: 960px) {
    /* No room for a rail beside the text, so the contents sit above it. */
    .pubdoc__toc {
        position: static;
        float: none;
        width: auto;
        max-height: none;
        margin: 1.5rem 0 0;
        padding: 1rem 1.125rem;
        border: 1px solid var(--line);
        border-radius: 10px;

        /*
         * Both of these must go with the max-height, or the page stops
         * scrolling on a phone.
         *
         * The rail above is its own scroll container: `contain` keeps a flick
         * inside it from running the page on once it hits the end. Here the
         * box is full height and taller than the screen, so nearly every
         * touch starts inside it — and `contain` on a box that cannot itself
         * scroll swallows the drag rather than passing it to the page. The
         * document looks frozen.
         */
        overflow-y: visible;
        overscroll-behavior: auto;
    }
    .pubdoc { max-width: none; }
}

/* --- narrower ---------------------------------------------------------------- */

@media (max-width: 640px) {
    .pubfigs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pubdec { flex-direction: column; gap: 0.25rem; }
    .pubdec__when { align-self: flex-start; }
}

/* --- the editorial setting -----------------------------------------------------
   About is prose, not a contract, so it drops the legal setting: section titles
   become real headings in the display face instead of small uppercase clause
   labels, the measure opens up, and the opening line becomes a standfirst.
   Terms, Privacy and Content Policy keep the clause setting, which is what
   makes a numbered document scannable. */

/* These pages open on their title, with no kicker above it, so the title
   needs room of its own between the top bar and itself. */
.pubpage--doc .pubpage__head { padding-top: clamp(2rem, 5vw, 4rem); }

.pubpage--editorial .pubpage__head { border-bottom: 0; padding-bottom: 0; }

.pubpage--editorial .pubpage__title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    line-height: 1.02;
}

.pubdoc__lede {
    margin: 1.25rem 0 0;
    max-width: 30ch;
    font-family: 'Bricolage Grotesque', var(--display, system-ui), sans-serif;
    font-size: clamp(1.25rem, 2.4vw, 1.75rem);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--accent);
    text-wrap: balance;
}

/* One column, wide and large. The paragraphs here are two or three lines
   each, so a generous measure reads fine and the page does not look cramped
   in the middle of a big screen. */
.pubpage--editorial { max-width: 1100px; }

.pubpage--editorial .pubdoc {
    max-width: none;
    padding-top: clamp(2.5rem, 6vw, 4rem);
    border-top: 1px solid var(--line);
    margin-top: clamp(2.25rem, 5vw, 3.25rem);
}

/* A section title, not a clause label. */
.pubpage--editorial .pubdoc__h {
    margin: clamp(2.75rem, 6vw, 4rem) 0 1rem;
    font-family: 'Bricolage Grotesque', var(--display, system-ui), sans-serif;
    font-size: clamp(1.375rem, 2.6vw, 1.875rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    text-transform: none;
    color: var(--text);
}

/* The heading's own rule, so a section announces itself without a divider
   between every paragraph. */
.pubpage--editorial .pubdoc__h::before {
    content: '';
    display: block;
    width: 38px;
    height: 2px;
    margin-bottom: 1.125rem;
    background: var(--accent);
}
.pubpage--editorial .pubdoc__h:first-child { margin-top: 0; }

.pubpage--editorial .pubdoc__p {
    margin: 0 0 1.25rem;
    font-size: 1.1875rem;
    line-height: 1.8;
    color: var(--text-2);
}

.pubpage--editorial .pubdoc__ul li { font-size: 1.1875rem; line-height: 1.8; }

@media (max-width: 640px) {
    .pubpage--editorial .pubdoc__h::before { width: 30px; margin-bottom: 0.875rem; }
}

/* The document bolds a one-line statement under a heading and again to close
   the page. In the editorial setting those carry weight, so they are set
   above the body rather than below it as a legal sub-clause would be. */
.pubpage--editorial .pubdoc__sh {
    margin: 0 0 1.25rem;
    font-family: 'Bricolage Grotesque', var(--display, system-ui), sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--accent);
}
