/* Cuenca Web design tokens.
   ---------------------------------------------------------------------------
   These values are not invented. They are derived from two external, citable
   sources about Cuenca itself, so that no future session has to guess:

   [1] "Reglamento para el uso del color y materiales en las edificaciones del
       Centro Histórico", GAD Municipal de Cuenca.
       https://www.cuenca.gob.ec/node/8822
       The regulation excludes pure primary and secondary colours from facades
       and permits: a base at medium intensity, plus anything derivable from
       that base with up to 50% white and/or up to 25% black. Original stone,
       brick and ceramic must keep their natural characteristics and may not be
       painted. Decorative elements may use maximum intensity contrast.

   [2] "Estudio y propuestas de color para la arquitectura del Centro Histórico
       de Cuenca", SENESCYT/SciELO Ecuador, 2016. A prospection study of 59
       buildings. Measured distribution of historic facade colour:
         amarillo 53.6%  ·  celeste 17%  ·  verde 14.6%
         rosado / marrón / lila / anaranjado ~4.9% each
         white present in 59% of buildings as base or preparation layer
       Pigments were local earths from Baños, Llacao, Quingeo, Cumbe, Molleturo,
       Oña and Saraguro — seven of them parishes this site maps.

   THE DERIVATION RULE. Every colour below is a BASE at medium intensity, or a
   tint of that base with <=50% white, or a shade with <=25% black. If you need
   a colour that is not here, derive it from a base with that rule and add it
   here with its measured contrast ratio. Do not invent one, and do not sample
   one from a screenshot.

   Ratios are measured against --lime unless noted. There is no dark theme.
   --------------------------------------------------------------------------- */

:root{
  /* ---- Bases (medium intensity, per the regulation) ---------------- */
  --base-ochre:   #b8862f;  /* amarillo — 53.6% of facades studied */
  --base-celeste: #4a7d9c;  /* celeste  — 17%, and the cathedral's glazed domes */
  --base-verde:   #5c7a52;  /* verde    — 14.6% */
  --base-teja:    #a8452c;  /* roof tile — unpainted material, keeps its own colour */

  /* ---- Ground: the lime preparation layer, 59% of buildings -------- */
  --lime:        #eff0ea;   /* page ground — chalky, faintly cool. Not cream. */
  --lime-raised: #f8f8f4;   /* cards, inputs, map frames */
  --lime-sunken: #e2e4db;   /* wells, inactive segments, empty states */

  /* ---- Ink: unpainted stone, the material the regulation protects -- */
  --ink:         #1f2a2e;   /* 12.82:1  body and headings */
  --ink-2:       #5e6669;   /*  5.12:1  secondary text, ledes, notes */
  --ink-3:       #646b6e;   /*  4.73:1  captions — 14px and above only */
  --ink-inverse: #eff0ea;   /* 12.82:1 on --stone-panel */
  --stone-panel: #1f2a2e;   /* dark feature surface */

  /* ---- Celeste: the accent ---------------------------------------- */
  --celeste:      #385e75;  /*  6.05:1  links, eyebrows, focus ring on light */
  --celeste-mid:  #4a7d9c;  /*  base — map marks, chart fills */
  --celeste-pale: #a4bece;  /*  7.58:1 on --stone-panel — focus ring on dark */

  /* ---- Ochre: the field ------------------------------------------- */
  --ochre:      #8a6423;    /*  4.66:1  labels and small caps, 14px+ only */
  --ochre-mid:  #b8862f;    /*  base */
  --ochre-pale: #dcc297;    /*  zócalo band, field tint, selected row */

  /* ---- Verde: the quiet register ---------------------------------- */
  --verde:      #516b48;    /*  5.17:1  secondary action, map vegetation */
  --verde-pale: #aebca8;

  /* ---- Teja: reserved --------------------------------------------- */
  --teja:       #943d27;    /*  6.20:1  errors, conflicts, "unverified" flags.
                                Not a decorative accent. Use it when something
                                is actually wrong or actually unconfirmed. */

  /* ---- Rule -------------------------------------------------------- */
  --rule:        #b1b5a5;   /*  1.83:1  hairline — 1px */
  --rule-strong: #1f2a2e;   /* 12.82:1  structural — 2px */

  /* ---- Zócalo ------------------------------------------------------ */
  /* Historic facades carry a painted baseboard 0.80–1.20 m high that grounds
     the wall. Panels, map frames and the page foot carry its equivalent. */
  --zocalo-band: #dcc297;
  --zocalo-h:    6px;

  /* ---- Type -------------------------------------------------------- */
  /* Alegreya and Alegreya Sans, Huerta Tipográfica (Juan Pablo del Peral).
     A Spanish-first superfamily drawn for literary text — not an Ecuadorian
     face, because no libre Ecuadorian text family exists; Ecuadorian type
     design is almost entirely display work. Vendored, never CDN-loaded. */
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --sans:  "Alegreya Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --t-display: clamp(40px, 5vw, 68px);
  --t-title:   clamp(30px, 3.2vw, 42px);
  --t-head:    26px;
  --t-sub:     20px;
  --t-body:    17px;   /* Alegreya runs small; 17px matches 16px system-ui */
  --t-dense:   14px;   /* floor for all UI text */
  --t-label:   12px;   /* uppercase, tracked, >=600 weight only */
  --t-micro:   11px;   /* map attribution and legal credits ONLY */

  --lh-display: 1.04;
  --lh-title:   1.1;
  --lh-head:    1.2;
  --lh-body:    1.6;
  --lh-dense:   1.45;

  --track-display: -.015em;  /* Alegreya needs less negative tracking than Georgia */
  --track-label:    .08em;

  /* ---- Space — 4px grid, no values between ------------------------ */
  --s-1:  4px;  --s-2:  8px;  --s-3: 12px;  --s-4: 16px;  --s-5: 24px;
  --s-6: 32px;  --s-7: 48px;  --s-8: 64px;  --s-9: 96px;

  /* ---- Layout ----------------------------------------------------- */
  --page-max: 1280px;
  --gutter:   clamp(20px, 4vw, 64px);
  --col-gap:  24px;
  --measure:  64ch;   /* ~72 characters at --t-body */
  --header-h: 72px;

  /* ---- Shape ------------------------------------------------------ */
  --radius:     0;     /* structural surfaces are square */
  --radius-ctl: 3px;   /* buttons, inputs, badges only */
  --hit:       44px;

  /* ---- Motion ----------------------------------------------------- */
  --ease: cubic-bezier(.2,.6,.3,1);
  --dur:  .16s;

  /* ---- Elevation --------------------------------------------------- */
  /* Exactly one shadow. Only <dialog> and popovers may use it. */
  --shadow-overlay: 0 16px 48px rgba(31,42,46,.28);
}

/* Structural transparency and dialog scrim are not facade colours. */
:root { --clear:transparent; --scrim:rgba(31,42,46,.55); }
/* Scoped to the separate landscape page requested from the user's mockup.
   Existing pages retain their square surfaces and original token values.
   Rail width is derived from the 12-column grid, not tuned to a label. */
.cajas-landscape-page {
 --radius:16px;
 --radius-ctl:12px;
 --landscape-col:calc((min(100vw,var(--page-max)) - var(--gutter) * 2 - var(--col-gap) * 11) / 12);
 --landscape-rail:clamp(calc(var(--s-9) * 3),calc(var(--landscape-col) * 4 + var(--col-gap) * 3),calc(var(--s-9) * 4.5));
 --landscape-ground:var(--stone-panel);
 --landscape-rule:rgba(177,181,165,.55);
 --landscape-dark:rgba(31,42,46,.84);
 --landscape-selected:rgba(81,107,72,.09);
 --landscape-selected-rule:rgba(81,107,72,.25);
}
/* Compact map controls use the canonical 3px radius, including the landscape's
   Silverheels-style callouts. Their colors are existing site tokens. */
.cajas-landscape-page .landscape-callout { --radius-ctl:3px; }
@font-face { font-family:"Alegreya"; src:url("/assets/fonts/alegreya/Alegreya-Regular.woff2") format("woff2"); font-weight:400 900; font-style:normal; font-display:swap; }
@font-face { font-family:"Alegreya"; src:url("/assets/fonts/alegreya/Alegreya-Italic.woff2") format("woff2"); font-weight:400 900; font-style:italic; font-display:swap; }
@font-face { font-family:"Alegreya Sans"; src:url("/assets/fonts/alegreya/AlegreyaSans-Regular.woff2") format("woff2"); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:"Alegreya Sans"; src:url("/assets/fonts/alegreya/AlegreyaSans-Medium.woff2") format("woff2"); font-weight:500 600; font-style:normal; font-display:swap; }
@font-face { font-family:"Alegreya Sans"; src:url("/assets/fonts/alegreya/AlegreyaSans-Bold.woff2") format("woff2"); font-weight:700 900; font-style:normal; font-display:swap; }
/* Transitional names used by existing app templates, all drawn from the system. */
:root { --cu-paper:var(--lime); --cu-ink:var(--ink); --cu-clay:var(--celeste); --cu-line:var(--rule); --cu-muted:var(--ink-2); --cu-header:var(--header-h); }

/* Existing component variable aliases; no separate palette is defined by a tool. */
:root {
 --green:var(--celeste);
 --muted:var(--ink-2);
 --line:var(--rule);
 --paper:var(--lime-raised);
 --soft:var(--lime-sunken);
 --rust:var(--celeste);
 --orange:var(--celeste);
 --forest:var(--stone-panel);
 --forest-light:var(--verde);
 --moss:var(--verde-pale);
 --paper-deep:var(--lime-sunken);
 --white:var(--lime-raised);
 --clay:var(--teja);
 --clay-light:var(--ochre-pale);
 --sun:var(--ochre-mid);
 --bg:var(--lime);
 --surface:var(--lime-sunken);
 --card:var(--lime-raised);
 --border:var(--rule);
 --sage:var(--verde);
 --sage-deep:var(--celeste);
 --sage-pale:var(--verde-pale);
 --ochre-deep:var(--ochre);
 --rust-pale:var(--ochre-pale);
 --green-go:var(--verde);
 --red-no:var(--teja);
 --faint:var(--ink-3);
 --display:var(--serif);
 --body:var(--sans);
 --mono:var(--sans);
 --accent:var(--celeste);
 --map-ink:var(--ink);
 --map-muted:var(--ink-2);
 --map-paper:var(--lime-raised);
 --map-line:var(--rule);
 --map-accent:var(--celeste);
 --map-green:var(--celeste);
}
/* Protected municipal 17% band treatment. Do not retune the band or its ink. */
:root { --bus-band-paper:#fffdf7; --bus-band-ink:#183c33; }
/* Protected cartographic colours moved verbatim from screen CSS. These are
   map data/symbology, exempt from facade colour derivation under AGENTS.md. */
:root {
 --carto-1:#617a68;
 --carto-2:white;
 --carto-3:#fbfcf4e6;
 --carto-4:#dce5d4;
 --carto-5:#364b40;
 --carto-6:#fff;
 --carto-7:#263f39;
 --carto-8:#fafbf8;
 --carto-9:#d9e9c5;
 --carto-10:#6e8874;
 --carto-11:#b9c3b5;
 --carto-12:#ccd9c3;
 --carto-13:#f9fbf2;
 --carto-14:#bdcdb9;
 --carto-15:#d6dfc8;
 --carto-16:#99b998;
 --carto-17:#153e36;
 --carto-18:#356951;
 --carto-19:#fff9e9;
 --carto-20:#bd775d;
 --carto-21:#884526;
 --carto-22:#a2492d;
 --carto-23:#edf0e4;
 --carto-24:#bbd2a9;
 --carto-25:#d3d0bb;
 --carto-26:#c5c6b1;
 --carto-27:#a9ced6;
 --carto-28:#6eacbc;
 --carto-29:#819884;
 --carto-30:#244f3e;
 --carto-31:#f3f4e9;
 --carto-32:#274a38;
 --carto-33:#f1f3e7;
 --carto-34:#3e776b;
 --carto-35:#3d7889;
 --carto-36:#719665;
 --carto-37:#f7f8ed;
 --carto-38:#8caf8b;
 --carto-39:#426b4b;
 --carto-40:#173d2a;
 --carto-41:#c6dcc0;
 --carto-42:#b5cca4;
 --carto-43:#f9f7ef;
 --carto-44:#56645c;
 --carto-45:#fff1c7;
 --carto-46:#f7f3e8;
 --carto-47:#a95032;
}

:root { --page-edge:max(var(--gutter),calc((100vw - var(--page-max))/2 + var(--gutter))); --page-bleed:calc(50% - 50vw); --rail:calc((min(100vw,var(--page-max)) - var(--gutter) * 2 - var(--col-gap) * 3) / 4); }

/* Original map canvas grounds. Protected cartographic surfaces, not UI fields. */
:root { --map-province-ground:#ebe4d2; --map-parish-ground:#eef0e6; }
