/* The site's colour settings for the cards and the two versions, light and dark (docs/FOGO_BUILD_PLAN.md).
   «Fogo» (C-1, E7 / E12 amended 2026-11-16): the cards' six bright colours, in lists_v2.COVER_HEX's order, with the
   green-black text on them (4.8-9.9:1, docs/FINAL_DESIGN_COLOURS.md 4b); the doors Ler tomato, Caminhar orange,
   Estudar saffron. Every card, door, cover and drawing reads these settings; a new colour is written here, never as a
   fixed value. The dark version (E17) below, under data-tema or the device's setting. FG7 (2026-11-17): the switch
   FOGO and the earlier earth palette removed. */
:root {
  --pc-card-0: #FF2E7E;   /* the six cover colours: hot pink */
  --pc-card-1: #FF5C5C;   /* coral */
  --pc-card-2: #FF3B30;   /* tomato, Ler */
  --pc-card-3: #FFB81C;   /* saffron, Estudar */
  --pc-card-4: #FF7A00;   /* orange, Caminhar */
  --pc-card-5: #FFA41B;   /* marigold */
  --pc-deep-ler: #C4231A;   /* the doors' deep shades, the drawings' ground */
  --pc-deep-cam: #C25700;
  --pc-deep-est: #D98E00;
  --pc-on-card: #0F1F18;    /* the text a coloured card gives its contents: green-black */
  --pc-ink-deep: #0F1F18;   /* the green-black that reads on the bright cards */
  --pc-paper: #FDFAF6;      /* the paper: a cream ground, also inside a card (its pills, boxes, buttons) */
  --pc-white: #FFFFFF;      /* a white ground (the stop's notes, «Para si aqui», choices): white in light, the surface in dark */
  --pc-frame: #1A3A2E;      /* the dark frames that stay dark in both versions (teasers, the story, the map tile) */
  --pc-cream: #FDFAF6;      /* the cream that stays cream in both versions (text on those frames) */
  --pc-ink-fixed: #0F1F18;  /* the ink on the walk colours (E8): green-black, 5.5:1 on the amber */
  --pc-leaf: #FFFDF8;       /* the passage's paper (E10) */
  --pc-leaf-ink: #2A2A26;   /* the passage's text (E10) */
  --pc-walk-text: #2E7D4F;  /* the walk green as a text colour (E8) */
  --pc-page-ink: #1A3A2E;   /* the page's own ink and cream, to give back below a coloured heading (dark: swapped) */
  --pc-page-cream: #FDFAF6;
}

/* The drawings written in the templates (inline SVG) keep their markup: their colours in the earlier palette read the
   settings through these rules (a presentation attribute yields to any CSS rule). */
svg [fill="#A8642A" i] { fill: var(--pc-card-1); }
svg [fill="#6B2D3A" i] { fill: var(--pc-card-2); }
svg [fill="#2F4A63" i] { fill: var(--pc-card-3); }
svg [fill="#5C6B2F" i] { fill: var(--pc-card-4); }
svg [fill="#8A4B2E" i] { fill: var(--pc-card-5); }
svg [fill="#3E1820" i] { fill: var(--pc-deep-ler); }
svg [fill="#333D18" i] { fill: var(--pc-deep-cam); }
svg [fill="#1B2D3E" i] { fill: var(--pc-deep-est); }
svg [stroke="#A8642A" i] { stroke: var(--pc-card-1); }
svg [stroke="#6B2D3A" i] { stroke: var(--pc-card-2); }
svg [stroke="#2F4A63" i] { stroke: var(--pc-card-3); }
svg [stroke="#5C6B2F" i] { stroke: var(--pc-card-4); }
svg [stroke="#8A4B2E" i] { stroke: var(--pc-card-5); }

/* FG2: the dark version (C-4, C-5): the reader's choice «escuro» (the cookie tema, data-tema on <html>), or, with no
   choice made, a device set to dark mode. The ink and the paper swap; the cards keep «Fogo» with their green-black
   text; the frames (--pc-frame) and the fixed cream (--pc-cream) stay. */
@media screen {   /* print always uses the light version (FG4) */
  :root[data-tema="escuro"] {
    color-scheme: dark;
    --portucal-cream: #121110;          /* the page's ground (warm black) */
    --pc-paper: #121110;
    --pc-white: #1E1C1A;
    --portucal-beige: #1E1C1A;          /* surfaces */
    --portucal-green: #F2ECE2;          /* the ink: warm white; the green buttons turn warm white with black text */
    --portucal-ink: #F2ECE2;
    --portucal-ink-2: rgba(242, 236, 226, 0.74);
    --portucal-ink-3: rgba(242, 236, 226, 0.56);
    --portucal-ink-4: rgba(242, 236, 226, 0.18);
    --portucal-ink-5: rgba(242, 236, 226, 0.08);
    --portucal-green-light: #8CCFAA;    /* links (9:1 on the ground) */
    --portucal-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.3);
    --portucal-shadow-2: 0 4px 12px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.3);
    --portucal-shadow-3: 0 12px 32px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.35);
    --hf-eyebrow-light: #E8A55A;        /* E14 on the dark ground: amber light */
    --pc-leaf: #1A1816;                 /* the passage's dark paper (E10) */
    --pc-leaf-ink: #ECE5D9;
    --pc-walk-text: #6FCF97;            /* the walk green as text on the dark ground (9:1) */
    --pc-page-ink: #F2ECE2;
    --pc-page-cream: #121110;
  }
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-tema]) {
    color-scheme: dark;
    --portucal-cream: #121110;          /* the page's ground (warm black) */
    --pc-paper: #121110;
    --pc-white: #1E1C1A;
    --portucal-beige: #1E1C1A;          /* surfaces */
    --portucal-green: #F2ECE2;          /* the ink: warm white; the green buttons turn warm white with black text */
    --portucal-ink: #F2ECE2;
    --portucal-ink-2: rgba(242, 236, 226, 0.74);
    --portucal-ink-3: rgba(242, 236, 226, 0.56);
    --portucal-ink-4: rgba(242, 236, 226, 0.18);
    --portucal-ink-5: rgba(242, 236, 226, 0.08);
    --portucal-green-light: #8CCFAA;    /* links (9:1 on the ground) */
    --portucal-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.3);
    --portucal-shadow-2: 0 4px 12px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.3);
    --portucal-shadow-3: 0 12px 32px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.35);
    --hf-eyebrow-light: #E8A55A;        /* E14 on the dark ground: amber light */
    --pc-leaf: #1A1816;                 /* the passage's dark paper (E10) */
    --pc-leaf-ink: #ECE5D9;
    --pc-walk-text: #6FCF97;            /* the walk green as text on the dark ground (9:1) */
    --pc-page-ink: #F2ECE2;
    --pc-page-cream: #121110;
  }
}
:root[data-tema="claro"] { color-scheme: light; }

/* A study group (details.pt-grp) carries its tile's colour class, which only its heading paints: the questions below sit
   on the page and take back the page's ink and cream (the card and walk locals stop at the heading) */
.pt-grp-body { --portucal-green: var(--pc-page-ink); --portucal-cream: var(--pc-page-cream); }

/* FG3: «Aspeto» in the account menu (templates/shared/tema/_aspeto.html): three choices, one under the other, each a
   44 px target; the chosen one ticked (the tick is drawn, no icon font) */
.pc-aspeto { display: grid; gap: 2px; margin: 4px 0; padding: 6px 0; border-top: 1px solid var(--portucal-ink-4); border-bottom: 1px solid var(--portucal-ink-4); }
.pc-aspeto-h { padding: 4px 16px 2px; font: 600 11px/1.2 var(--portucal-font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--portucal-ink-2); }
.pc-aspeto button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 16px; border: 0; background: none;
  font: 500 15px/1.2 var(--portucal-font-sans); color: var(--portucal-green); text-align: left; cursor: pointer; }
.pc-aspeto button::before { content: ''; flex: none; width: 14px; height: 8px; margin-top: -4px; border: solid transparent; border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.pc-aspeto button[aria-pressed="true"] { font-weight: 600; }
.pc-aspeto button[aria-pressed="true"]::before { border-color: var(--portucal-amber); }
.pc-aspeto button:hover, .pc-aspeto button:focus-visible { background: var(--portucal-ink-5); }
.pc-aspeto button:focus-visible { outline: 2px solid var(--portucal-amber); outline-offset: -2px; }
.vb-menu .pc-aspeto { margin: 12px 0 0; border-bottom: 0; }
.vb-menu .pc-aspeto button, .vb-menu .pc-aspeto-h { padding-left: 0; padding-right: 0; }
/* in the computer's account dropdown the choices take the dropdown's own look (mono capitals, like their neighbours)
   but keep their tick beside them and their 44 px */
.portucal-nav .nav-dropdown .pc-aspeto button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; }
.portucal-nav .nav-dropdown .pc-aspeto-h { padding: 4px 14px 2px; }

/* FG4 (K-2): the monument notes' own paper (E9) in the dark version: the same hues, darkened; the dark appendix stays.
   Screen only: printed, a note keeps its light paper. */
@media screen {
  :root[data-tema="escuro"] .sheet { --frame: #121110; --sheet-bg: #1F1C17; --ink: #E8E1D3; --display: #EAD9AE; --accent: #D4AE62; --stone: #ABA497; --rule: #3A352C; --fresco: #E08A74; }
  :root[data-tema="escuro"] .sheet .crest .lid { fill: #4A4333; }
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-tema]) .sheet { --frame: #121110; --sheet-bg: #1F1C17; --ink: #E8E1D3; --display: #EAD9AE; --accent: #D4AE62; --stone: #ABA497; --rule: #3A352C; --fresco: #E08A74; }
  :root:not([data-tema]) .sheet .crest .lid { fill: #4A4333; }
}

/* The maps stay as today in the dark version (the owner, 2026-11-16: «all the maps back to white in dark mode»): the
   light CARTO map, and inside a map (its controls, popups, legends) the light version's settings. */
@media screen {
  :root[data-tema="escuro"] .leaflet-container { color: #1A3A2E; --portucal-cream: #FDFAF6; --pc-paper: #FDFAF6; --portucal-beige: #F2EDE4; --portucal-green: #1A3A2E; --portucal-ink: #1A3A2E;
    --portucal-ink-2: rgba(26, 58, 46, 0.72); --portucal-ink-3: rgba(26, 58, 46, 0.50); --portucal-ink-4: rgba(26, 58, 46, 0.18);
    --portucal-ink-5: rgba(26, 58, 46, 0.08); --portucal-green-light: #2E6B50; --portucal-bg: #FDFAF6; --portucal-bg-elevated: #F2EDE4; --portucal-fg: #1A3A2E;
    --portucal-fg-2: rgba(26, 58, 46, 0.72); --portucal-fg-3: rgba(26, 58, 46, 0.50); --portucal-border: rgba(26, 58, 46, 0.18);
    --portucal-border-strong: #1A3A2E; --portucal-link: #2E6B50; --pc-page-ink: #1A3A2E; --pc-page-cream: #FDFAF6; --pc-white: #FFFFFF; color-scheme: light; }
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-tema]) .leaflet-container { color: #1A3A2E; --portucal-cream: #FDFAF6; --pc-paper: #FDFAF6; --portucal-beige: #F2EDE4; --portucal-green: #1A3A2E; --portucal-ink: #1A3A2E;
    --portucal-ink-2: rgba(26, 58, 46, 0.72); --portucal-ink-3: rgba(26, 58, 46, 0.50); --portucal-ink-4: rgba(26, 58, 46, 0.18);
    --portucal-ink-5: rgba(26, 58, 46, 0.08); --portucal-green-light: #2E6B50; --portucal-bg: #FDFAF6; --portucal-bg-elevated: #F2EDE4; --portucal-fg: #1A3A2E;
    --portucal-fg-2: rgba(26, 58, 46, 0.72); --portucal-fg-3: rgba(26, 58, 46, 0.50); --portucal-border: rgba(26, 58, 46, 0.18);
    --portucal-border-strong: #1A3A2E; --portucal-link: #2E6B50; --pc-page-ink: #1A3A2E; --pc-page-cream: #FDFAF6; --pc-white: #FFFFFF; color-scheme: light; }
}
/* the map page's head floats over the map below 1,024 px (its title, search and filters): light, like the map; from
   1,024 px it is a side panel and follows the version */
@media screen and (max-width: 1023px) {
  :root[data-tema="escuro"] .mv3-head { color: #1A3A2E; --portucal-cream: #FDFAF6; --pc-paper: #FDFAF6; --portucal-beige: #F2EDE4; --portucal-green: #1A3A2E; --portucal-ink: #1A3A2E;
    --portucal-ink-2: rgba(26, 58, 46, 0.72); --portucal-ink-3: rgba(26, 58, 46, 0.50); --portucal-ink-4: rgba(26, 58, 46, 0.18);
    --portucal-ink-5: rgba(26, 58, 46, 0.08); --portucal-green-light: #2E6B50; --portucal-bg: #FDFAF6; --portucal-bg-elevated: #F2EDE4; --portucal-fg: #1A3A2E;
    --portucal-fg-2: rgba(26, 58, 46, 0.72); --portucal-fg-3: rgba(26, 58, 46, 0.50); --portucal-border: rgba(26, 58, 46, 0.18);
    --portucal-border-strong: #1A3A2E; --portucal-link: #2E6B50; --pc-page-ink: #1A3A2E; --pc-page-cream: #FDFAF6; --pc-white: #FFFFFF; color-scheme: light; }
}
@media screen and (max-width: 1023px) and (prefers-color-scheme: dark) {
  :root:not([data-tema]) .mv3-head { color: #1A3A2E; --portucal-cream: #FDFAF6; --pc-paper: #FDFAF6; --portucal-beige: #F2EDE4; --portucal-green: #1A3A2E; --portucal-ink: #1A3A2E;
    --portucal-ink-2: rgba(26, 58, 46, 0.72); --portucal-ink-3: rgba(26, 58, 46, 0.50); --portucal-ink-4: rgba(26, 58, 46, 0.18);
    --portucal-ink-5: rgba(26, 58, 46, 0.08); --portucal-green-light: #2E6B50; --portucal-bg: #FDFAF6; --portucal-bg-elevated: #F2EDE4; --portucal-fg: #1A3A2E;
    --portucal-fg-2: rgba(26, 58, 46, 0.72); --portucal-fg-3: rgba(26, 58, 46, 0.50); --portucal-border: rgba(26, 58, 46, 0.18);
    --portucal-border-strong: #1A3A2E; --portucal-link: #2E6B50; --pc-page-ink: #1A3A2E; --pc-page-cream: #FDFAF6; --pc-white: #FFFFFF; color-scheme: light; }
}
