/* ==========================================================================
   public-shell.css — the base layer + chrome for public_base.html.
   ==========================================================================
   Pages that extend public_base.html do NOT extend base.html, so they get no
   :root tokens, no reset and no body rule from the app shell. This file
   supplies them.

   The token values and the reset/body/zoom rules are verbatim copies of
   base.html:38-55 and :69-108. They are duplicated deliberately: the app shell
   is 131KB of logged-in UI and public pages must not load it just to inherit
   twenty custom properties. Dark-only — the app has no light theme.

   If a token value changes in base.html, change it here too. There is no
   third copy: the article/index prose stylesheets consume these vars and
   define none of their own (wrapper/test_public_article.py enforces that).
   ========================================================================== */

:root {
    --bg-primary: #0B0E14;
    --bg-secondary: #0E131B;
    --bg-card: #141A23;
    --border-primary: #2B3645;
    --border-hover: #3A4A5E;
    --text-primary: #E8ECF2;
    --text-secondary: #9BA8BC;
    --text-tertiary: #6B7688;
    --accent-primary: #3fae7f;
    --button-bg: #3fae7f;
    --button-text: #04140d;
    --info: #3b82f6;
    /* Public pages render no sidebar, but the shared prose/index stylesheets
       reference the token in their logged-in layout rules. Keep it defined so
       the cascade resolves to zero rather than to an invalid value. */
    --sidebar-width: 0px;
}

html { scrollbar-width: thin; scrollbar-color: var(--border-primary) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Calibri', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: calc(100vh / var(--app-zoom, 1));
    line-height: 1.6;
    letter-spacing: -0.011em;
}

/* The platform's 80% density zoom, replicated so public pages render at
   exactly the size they did when they went through base.html. Article prose is
   sized 1.55rem, which is ~19.8px at this zoom; dropping the zoom would render
   every article ~25% larger overnight. */
:root { --app-zoom: 1; }
@media (min-width: 769px) and (min-height: 501px) {
    body { --app-zoom: 0.8; zoom: var(--app-zoom); }
}

/* ---- Masthead ---------------------------------------------------------- */

.pub-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 40px;
    border-bottom: 1px solid var(--border-primary);
    background: var(--bg-primary);
}

.pub-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.pub-brand img { height: 26px; width: auto; display: block; }

.pub-nav-links { display: flex; align-items: center; gap: 24px; }

.pub-nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.pub-nav-links a:hover { color: var(--text-primary); }

.pub-nav-cta {
    padding: 8px 16px;
    border-radius: 6px;
    background: var(--button-bg);
    color: var(--button-text) !important;
    font-weight: 600;
    transition: transform 0.2s;
}

.pub-nav-cta:hover { transform: translateY(-1px); }

/* ---- Newsletter invitation --------------------------------------------- */
/* A LINK to /join, not an inline form: signup runs through the double-opt-in
   consent flow that lives there, and these pages carry no JavaScript. */

/* The reading surface is #14181f (set on .article-main / .articles-main). The
   subscribe block sits outside that element because the reading column is a
   shared partial, so it carries the same ground itself — otherwise there is a
   visible seam under the content. */
.pub-subscribe-band { background: #14181f; }

.pub-subscribe {
    margin-top: 56px;
    padding: 28px 32px;
    border: 1px solid var(--border-primary);
    border-left: 3px solid var(--accent-primary);
    border-radius: 8px;
    background: var(--bg-secondary);
}

.pub-subscribe-title {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.pub-subscribe p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 18px;
    max-width: 62ch;
}

.pub-subscribe a {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    background: var(--button-bg);
    color: var(--button-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ---- Footer ------------------------------------------------------------ */

.pub-footer {
    border-top: 1px solid var(--border-primary);
    padding: 28px 40px 40px;
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

.pub-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 12px;
}

/* Plain anchors, not the app's JS legal modal: these must work for a crawler
   and with JavaScript disabled. */
.pub-footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

.pub-footer-links a:hover { color: var(--text-primary); text-decoration: underline; }

/* ---- Cookie notice ----------------------------------------------------- */

.cookie-banner {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 9999;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
}

.cookie-banner.hidden { display: none; }
.cookie-banner p { margin: 0; line-height: 1.5; }
.cookie-banner a { color: var(--info); text-decoration: none; }
.cookie-banner a:hover { text-decoration: underline; }

.cookie-banner button {
    background: var(--button-bg);
    color: var(--button-text);
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .pub-nav { padding: 14px 20px; flex-wrap: wrap; gap: 12px; }
    .pub-nav-links { gap: 16px; }
    .pub-footer { padding: 24px 20px 34px; }
}

/* ---- Legal pages ------------------------------------------------------- */
/* impressum / privacy-policy / terms / cookie-policy / disclaimer render
   through public_base.html so they are clean, crawlable pages with no app
   shell (a reachable Impressum is required under §5 TMG/DDG, and these were
   leaking the settings modal + COGS copy to Google). Rules copied verbatim
   from base.html:501-595 so the in-app modal and the standalone page match;
   only the top padding is added, since these no longer sit under base.html's
   .header spacer. The redundant "QuanterLab" .header block is dropped from the
   templates so the legal <h1> is the page's only h1. */
.legal-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

.legal-page h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: left;
    color: var(--text-primary);
}

.legal-page .legal-meta {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
    margin-bottom: 32px;
}

.legal-page h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.legal-page h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.legal-page p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.7;
    margin-bottom: 12px;
}

.legal-page ul, .legal-page ol {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.7;
    margin-bottom: 12px;
    padding-left: 24px;
}

.legal-page li { margin-bottom: 4px; }

.legal-page strong { color: var(--text-primary); font-weight: 500; }

.legal-page a { color: var(--info); text-decoration: none; }
.legal-page a:hover { text-decoration: underline; }

.legal-page table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    font-size: 0.8125rem;
}

.legal-page table th,
.legal-page table td {
    border: 1px solid var(--border-primary);
    padding: 8px 12px;
    text-align: left;
    color: var(--text-secondary);
}

.legal-page table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 500;
}
