/* SPDX-License-Identifier: AGPL-3.0-or-later
 * Copyright (C) 2025-2026 Kaspar Bredahl Rasmussen
 * This file is part of Canvas Designer. See LICENSE.md for terms.
 *
 * upload/site-pages.css — the guide pages (guide.html, html-course.html) in
 * the designer's look, redesign B "Paper and ink": the same fonts and tokens
 * as designer-ui.css, the top bar, hero and footer. Each page keeps its own
 * rules for what only it has.
 */

/* ---- Fonts: self-hosted, the designer's files (upload/fonts) --------------- */
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('fonts/fraunces-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('fonts/fraunces-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Fraunces';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/fraunces-italic-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Fraunces';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/fraunces-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('fonts/jetbrains-mono-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Tokens: the same values as designer-ui.css ----------------------------
 * Contrast (WCAG 2.1): ink on paper 16.0:1; ink-soft 7.2:1 on paper, 6.6:1 on
 * paper-deep, 7.7:1 on white; red 6.1:1 on paper, white on red 6.6:1;
 * red-deep 8.1:1 on paper-deep. rule and rule-soft are decorative hairlines. */
:root {
    --ui-paper: #FAF7F2;
    --ui-paper-deep: #F2EEE6;
    --ui-white: #FFFFFF;
    --ui-ink: #1E1B18;
    --ui-ink-soft: #5A524B;
    --ui-red: #B51F2E;
    --ui-red-deep: #8A1822;
    --ui-rule: #D9D2C5;
    --ui-rule-soft: #E4DDD0;
    --ui-field: #8C8174;

    --ui-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --ui-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --ui-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --ui-radius: 6px;
    --ui-shadow-pop: 0 6px 18px rgba(60, 40, 20, 0.12);
}

body {
    font-family: var(--ui-sans);
    color: var(--ui-ink);
    background: var(--ui-paper);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
/* Inter is loaded from 400 to 600: bold is its 600 */
strong, b { font-weight: 600; }

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--ui-ink);
    outline-offset: 2px;
}

/* ---- Top bar: like the designer's ------------------------------------------ */
.site-header {
    background: var(--ui-paper);
    border-bottom: 1px solid var(--ui-rule);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 64px;
}
.site-header__logo {
    font: 600 1.45em/1.1 var(--ui-serif);
    letter-spacing: -0.01em;
    color: var(--ui-ink);
    text-decoration: none;
    white-space: nowrap;
}
.site-header__nav { display: flex; align-items: center; gap: 2px; }
.site-header__nav a {
    color: var(--ui-ink);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--ui-radius);
    font: 500 14px/1.2 var(--ui-sans);
    white-space: nowrap;
}
.site-header__nav a:hover { background: var(--ui-paper-deep); }
.site-header__nav a.btn-open-designer {
    background: var(--ui-red);
    color: var(--ui-white);
    padding: 10px 16px;
    margin-left: 8px;
}
.site-header__nav a.btn-open-designer:hover { background: var(--ui-red-deep); }

/* NB / EN, the active one underlined in red */
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 14px;
    font: 500 12px/1 var(--ui-mono);
    color: var(--ui-ink-soft);
}
.lang-toggle button {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 6px 2px 4px;
    font: inherit;
    letter-spacing: 0.06em;
    color: var(--ui-ink-soft);
    cursor: pointer;
}
.lang-toggle button:hover { color: var(--ui-ink); }
.lang-toggle button.active { color: var(--ui-ink); border-bottom-color: var(--ui-red); }

@media (max-width: 720px) {
    /* The bar wraps on a phone, so it scrolls away instead of covering the page */
    .site-header { position: static; }
    .site-header .container { flex-wrap: wrap; gap: 4px 12px; padding-top: 10px; padding-bottom: 10px; min-height: 0; }
    .site-header__logo { font-size: 1.25em; }
    .site-header__nav { flex-wrap: wrap; margin-left: -12px; }
    .site-header__nav a { padding: 8px 10px; }
}

/* ---- Hero -------------------------------------------------------------------- */
.hero {
    background: var(--ui-paper);
    border-bottom: 1px solid var(--ui-rule);
    padding: 64px 0 56px;
    text-align: center;
}
.hero__overline {
    font: 500 12px/1.4 var(--ui-mono);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ui-red);
    margin-bottom: 14px;
}
.hero__title {
    font: 600 3em/1.1 var(--ui-serif);
    letter-spacing: -0.015em;
    color: var(--ui-ink);
    margin-bottom: 16px;
}
.hero__sub {
    font-size: 1.15em;
    color: var(--ui-ink-soft);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}
@media (max-width: 600px) {
    .hero { padding: 40px 0 36px; }
    .hero__title { font-size: 2.1em; }
}

/* ---- Footer ------------------------------------------------------------------ */
.site-footer {
    background: var(--ui-paper-deep);
    border-top: 1px solid var(--ui-rule);
    color: var(--ui-ink-soft);
    padding: 32px 0;
    text-align: center;
    font-size: 0.88em;
}
.site-footer p { margin-bottom: 6px; }
.site-footer p:last-child { margin-bottom: 0; }
.site-footer strong { color: var(--ui-ink); }
.site-footer a { color: var(--ui-red-deep); text-underline-offset: 2px; }

/* ---- Code ------------------------------------------------------------------- */
/* As typed: no JetBrains Mono ligatures, so </ and => stay two signs */
code, kbd, pre, samp, textarea { font-variant-ligatures: none; }
code.inline {
    background: var(--ui-paper-deep);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--ui-mono);
    font-size: 0.85em;
    color: var(--ui-ink);
}
