/*
 * Camperata, shared identity (DESIGN.md, "Carta stradale", which grows out of "Segnaletica orizzontale").
 * Loaded by both frontend and backend before their own site.css (the maps: atlante.css).
 * The three road marks (solid / dashed / zebra) are reserved for the state of a record
 * (sagra/evento, sosta, ordinanza), always next to the text from Segno::riga().
 * The map colours (--mare, --statale, --panoramica) only ever say "where", never a state.
 * Logo and icons: common/views/marchio/_marchio.php and icona.svg (DESIGN.md, "Logo").
 */

/* ------------------------------------------------------------------ fonts */

/* U+00B7 (middle dot) is left out on purpose: Overpass draws it off-centre, so "Admin · fonte"
   read as "Admin ·fonte". The fallback sans-serif draws it centred. */

@font-face {
    font-family: "Overpass";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/overpass-latin-400-normal.woff2") format("woff2");
    unicode-range: U+0000-00B6, U+00B8-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;
}

/* Italic only for geographic names on the maps ("Mar Tirreno", "Nebrodi"), as in road atlases. */
@font-face {
    font-family: "Overpass";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/overpass-latin-400-italic.woff2") format("woff2");
    unicode-range: U+0000-00B6, U+00B8-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: "Overpass";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/overpass-latin-700-normal.woff2") format("woff2");
    unicode-range: U+0000-00B6, U+00B8-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: "Overpass";
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url("fonts/overpass-latin-800-normal.woff2") format("woff2");
    unicode-range: U+0000-00B6, U+00B8-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 */

:root {
    /* Palette: the only colours allowed (DESIGN.md). Logo palette (November 2026), dominant colour
       deep petrol since December 2026 (palette "B"): deep petrol, sunset orange, sea teal; the road signs (--sagra, --sosta) and the state marks do not change. */
    --fondo: #FFFFFF;
    --testo: #000000;
    --strada: #1D4A53;      /* deep petrol: header, carriageways, roads, convoy, coastline, fixed bars (9.7:1 on white); primary buttons hover/active */
    --collegamento: #0E7C86; /* sea teal: links and the focus ring (4.9:1 on white; never on --mare or --strada) */
    --petrolio: #27606B;    /* petrol green: primary buttons at rest, outline and details of the campers (camper.svg, logo); 7.1:1 on white, ~1.4:1 on --strada (there the white body carries the shape) */
    --sagra: #5C3A21;
    --sosta: #0B4EA2;
    --zebra: #FFC20E;
    --tratteggio: #6A6A6A;

    /* The map ("Carta stradale"): colours of WHERE, never of a state. */
    --mare: #D4E7E9;        /* light tint of the teal (18%): text on it is black (16.4:1); --tratteggio and --collegamento are below AA here */
    --statale: #E2742B;     /* sunset orange, lines of roads and routes only (3.1:1 on white): never text, never a state, never an error */
    --panoramica: #1D4A53;  /* the route of a story (white road edged in deep petrol), underline of links inside stories */

    /* Road markings: hard-stop patterns, not decorative gradients. */
    --segno-continuo: linear-gradient(var(--testo), var(--testo));
    --segno-tratteggio: repeating-linear-gradient(90deg, var(--tratteggio) 0 8px, transparent 8px 14px);
    --segno-zebra: repeating-linear-gradient(-45deg, var(--testo) 0 12px, var(--zebra) 12px 24px);  /* stripes >= 12px, readable in sunlight */
    --mezzeria: repeating-linear-gradient(180deg, var(--fondo) 0 10px, transparent 10px 20px);

    /* Type: one family, Overpass. */
    --famiglia: "Overpass", "Helvetica Neue", Arial, sans-serif;

    /* Measures */
    --raggio: 4px;          /* road signs have softly rounded corners */
    --tocco: 48px;          /* minimum touch target */
    --margine: 1rem;        /* side gutter */
    --colonna: 46rem;       /* single column, also on desktop */
    --anello: 3px solid var(--collegamento);

    /* Spacing scale (frontend system, see DESIGN.md "Note"): no loose rem values in new rules. */
    --s1: .25rem;
    --s2: .5rem;
    --s3: .75rem;
    --s4: 1rem;
    --s5: 1.5rem;
    --s6: 2.25rem;

    /* Type scale, as `font` shorthands (set font-variant-numeric after them: `font` resets it). */
    --t-pagina: 800 1.75rem/2rem var(--famiglia);       /* page title 28/32 */
    --t-scheda: 700 1.625rem/1.875rem var(--famiglia);  /* sagra / sosta / story title 26/30 */
    --t-sezione: 700 1.375rem/1.75rem var(--famiglia);  /* section heading 22/28 */
    --t-dato: 700 1.25rem/1.5rem var(--famiglia);       /* km, dates, amounts 20/24, tabular */
    --t-testo: 400 1.0625rem/1.625rem var(--famiglia);  /* body 17/26 */
    --t-meta: 400 .9375rem/1.375rem var(--famiglia);    /* verification, source 15/22 */

    /* Touch: vertical padding that lifts a 22px-high inline link to the 48px target. */
    --tocco-pad: .8125rem;

    /* Camper-area square beside a stop name in lists, and the gap after it. */
    --p-lato: 2rem;
    --p-gap: .625rem;

    /* The white centre line seen across a horizontal stretch of road (header, big buttons). */
    --mezzeria-orizzontale: repeating-linear-gradient(90deg, var(--fondo) 0 24px, transparent 24px 40px);

    /*
     * Linea "D", la strada costiera come il logo (DESIGN.md, Layout): apre le sezioni del sito
     * pubblico al posto del filetto nero. Monti, tratto dritto da 6 px, onda con la mezzeria bianca
     * tratteggiata (proporzioni del logo: tratto 14, mezzeria 3, trattini 8/8, ridotte a 6 / 1,5 / 4).
     * Dentro un data URI le variabili non arrivano: i colori sono scritti, e sono --strada (#1D4A53)
     * e --fondo (#FFF). Se cambia --strada, cambia anche qui. Solo decorazione: mai uno stato.
     */
    --linea-monti: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 22'%3E%3Cpath d='M3 19L16 3l8 11 7-6c6 4 9 4 21 4' fill='none' stroke='%231D4A53' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --linea-onda: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 68 22'%3E%3Cpath d='M0 12H16q8-8 16 0t16 0t16 0' fill='none' stroke='%231D4A53' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M9 12H16q8-8 16 0t16 0t16 0' fill='none' stroke='%23fff' stroke-width='1.5' stroke-dasharray='4 4'/%3E%3C/svg%3E");
    --linea-monti-l: 52px;  /* larghezza dei monti; il tratto dritto parte 2 px prima della fine */
    --linea-onda-l: 68px;   /* larghezza dell'onda; i primi 16 px sono ancora dritti */
    --linea-h: 22px;        /* altezza della linea; il tratto dritto sta tra 9 e 15 px */

    color-scheme: light;
}
