/* ==========================================================================
   Genuine Richaracheros Moto Club — hoja única del archivo.

   Identidad: papel de expediente y grafito. Crema hueso + grafito casi negro,
   con un burdeos de sello para lo que califica y un latón para los rótulos.
   Fraunces (display, con su contraste alto) + Inter (texto y UI), las dos
   autoalojadas.

   Orden del archivo:
     1. Variables y reset      6. Fichas: notas, ejes, datos
     2. Tipografía y prosa     7. Mapas y descargas
     3. Cabecera y pie         8. Listados y filtros
     4. Bloques de sección     9. Formulario
     5. Tarjetas              10. Responsive
   ========================================================================== */

/* == 1. Variables y reset ================================================= */
:root {
  --ink:      #14171A;   /* grafito casi negro: texto y superficies oscuras */
  --ink-2:    #1E2227;
  --ink-3:    #2C333B;
  --paper:    #F7F5F0;   /* hueso: fondo general */
  --paper-2:  #EFEBE3;   /* fondo alterno */
  --paper-3:  #E6E1D7;
  --rule:     #D9D2C6;   /* filetes */
  --rule-2:   #C7BEAE;

  --slate:    #585F68;   /* texto secundario · 6,3:1 sobre papel */
  --slate-lt: #A8A196;   /* texto terciario, solo para rótulos grandes */

  /* Burdeos de sello. Es el color de lo que califica: notas, códigos, CTA. */
  --ox:       #7A2E33;   /* 7,3:1 sobre papel */
  --ox-d:     #5F2328;
  --ox-lt:    #D79A93;   /* 6,1:1 sobre grafito */

  /* Latón. Solo rótulos y filetes; nunca texto largo. */
  --brass:    #8A6E2C;   /* 4,9:1 sobre papel: vale para rótulos en versal */
  --brass-lt: #C8A75C;
  --brass-dk: #6B5420;

  --green:    #2F5D50;   /* «digno»: una sola señal, discreta */

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans:  'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wrap: 1180px;
  --wrap-n: 740px;
  --r: 3px;                       /* radio mínimo: esto es papel, no una app */
  --sh: 0 1px 2px rgba(20,23,26,.05), 0 8px 28px rgba(20,23,26,.06);
  --sh-2: 0 2px 6px rgba(20,23,26,.08), 0 18px 50px rgba(20,23,26,.10);
  --ease: cubic-bezier(.23, 1, .32, 1);
  --focus: var(--ox);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 12px 18px;
}
.skip:focus { left: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 26px; }
.wrap-n { width: 100%; max-width: var(--wrap-n); margin: 0 auto; padding: 0 26px; }


/* == 2. Tipografía y prosa ================================================ */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.14;
                 letter-spacing: -.01em; }

.h-xl { font-size: clamp(2.35rem, 5.2vw, 4rem); font-weight: 600; }
.h-l  { font-size: clamp(1.85rem, 3.4vw, 2.7rem); }
.h-m  { font-size: clamp(1.4rem, 2.2vw, 1.85rem); }
.h-s  { font-size: 1.2rem; }

.eyebrow {
  font-family: var(--sans); font-size: .705rem; font-weight: 600;
  letter-spacing: .19em; text-transform: uppercase; color: var(--brass);
  display: block; margin-bottom: 1.1rem;
}
.eyebrow-lt { color: var(--brass-lt); }

.lead {
  font-size: clamp(1.08rem, 1.5vw, 1.28rem); line-height: 1.56;
  color: var(--slate); max-width: 62ch;
}
.lead-lt { color: #B9B3A8; }

.meta {
  font-size: .795rem; color: var(--slate); letter-spacing: .02em;
}
.meta-sep::before { content: '·'; margin: 0 .5em; color: var(--rule-2); }

/* Los códigos de las series documentales. Tabulares y espaciados: son
   identificadores, se leen carácter a carácter y se copian. */
.code {
  font-family: var(--sans); font-size: .74rem; font-weight: 600;
  letter-spacing: .1em; font-variant-numeric: tabular-nums;
  color: var(--ox); text-transform: uppercase; white-space: nowrap;
}
.code-lt { color: var(--ox-lt); }
.code-box {
  display: inline-block; border: 1px solid var(--rule-2);
  padding: 3px 9px 2px; border-radius: var(--r); background: var(--paper);
}

.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.rule-brass { border: 0; border-top: 2px solid var(--brass-lt); width: 46px;
              margin: 0 0 1.6rem; }

/* Prosa: todo lo que sale del markdown de la base de datos. */
.prose { font-size: 1.075rem; line-height: 1.72; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 {
  font-size: clamp(1.42rem, 2.3vw, 1.8rem); margin-top: 2.6em;
  padding-top: 1.1em; border-top: 1px solid var(--rule);
}
.prose h3 { font-size: 1.22rem; margin-top: 2em; }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose p { max-width: 68ch; }
.prose a { color: var(--ox); text-decoration: none;
           box-shadow: inset 0 -1px 0 rgba(122,46,51,.32); }
.prose a:hover { box-shadow: inset 0 -2px 0 var(--ox); }
.prose strong { font-weight: 650; }
.prose em { font-style: italic; }
.prose ul, .prose ol { padding-left: 1.35em; max-width: 66ch; }
.prose li + li { margin-top: .4em; }
.prose ul li::marker { color: var(--brass); }
.prose ol li::marker { color: var(--brass); font-weight: 600; }
.prose blockquote {
  border-left: 2px solid var(--brass-lt); padding: .2em 0 .2em 1.3em;
  font-family: var(--serif); font-size: 1.12em; font-style: italic;
  color: var(--slate);
}
.prose code {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: .86em; background: var(--paper-2); padding: .12em .4em;
  border-radius: 2px;
}
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4em 0; }

/* Tablas: siempre dentro de .tw, que es quien desborda. */
.tw { overflow-x: auto; margin: 1.6em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.prose th, .prose td {
  text-align: left; padding: .62em .9em; border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.prose th {
  font-family: var(--sans); font-size: .715rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; color: var(--brass);
  border-bottom: 1px solid var(--rule-2); white-space: nowrap;
}
.prose tbody tr:last-child td { border-bottom: 0; }


/* == 3. Cabecera y pie ==================================================== */
.hd {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247,245,240,.94);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.hd-in { display: flex; align-items: center; gap: 22px; min-height: 74px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none;
         margin-right: auto; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-1 {
  font-family: var(--serif); font-size: 1.03rem; font-weight: 600;
  letter-spacing: .005em;
}
.brand-2 {
  font-size: .625rem; font-weight: 600; letter-spacing: .17em;
  text-transform: uppercase; color: var(--brass);
}

.emblem { flex: none; }
.em-ring-out { fill: none; stroke: currentColor; stroke-width: 2.6; opacity: .95; }
.em-ring-in  { fill: none; stroke: currentColor; stroke-width: .9; opacity: .45; }
.em-road     { fill: none; stroke: currentColor; stroke-width: 7;
               stroke-linecap: round; opacity: .16; }
.em-road-dash{ fill: none; stroke: currentColor; stroke-width: 1.5;
               stroke-linecap: round; stroke-dasharray: 5 5; opacity: .8; }
.em-dot      { fill: currentColor; }
.em-slash    { fill: none; stroke: currentColor; stroke-width: 1.2; opacity: .3; }
.brand-em { width: 34px; height: 34px; color: var(--ox); }
.ft-em    { width: 44px; height: 44px; color: var(--brass-lt); margin-bottom: 18px; }
.big-em   { width: 84px; height: 84px; color: var(--brass-lt); }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; font-size: .845rem; font-weight: 500;
  padding: 8px 11px; border-radius: var(--r); color: var(--ink);
  white-space: nowrap; transition: background .18s var(--ease), color .18s;
}
.nav a:hover { background: var(--paper-2); }
.nav a.on { color: var(--ox); font-weight: 600; }
.nav a.on::after {
  content: ''; display: block; height: 2px; background: var(--ox);
  margin: 5px 11px -8px; border-radius: 2px;
}
.nav-cta {
  margin-left: 8px; background: var(--ink); color: var(--paper) !important;
  padding: 9px 17px !important; font-weight: 600 !important;
}
.nav-cta:hover { background: var(--ox) !important; }
.nav-cta.on::after { display: none; }

.navtoggle, .burger { display: none; }

.ft { background: var(--ink); color: #C9C3B8; margin-top: 96px;
      padding: 72px 0 0; }
.ft-in { display: grid; grid-template-columns: 1.15fr 2fr; gap: 56px; }
.ft-name { font-family: var(--serif); font-size: 1.2rem; color: var(--paper);
           margin-bottom: .55rem; }
.ft-claim { font-size: .93rem; line-height: 1.6; max-width: 40ch; }
.ft-open { font-size: .86rem; margin-top: 1.1rem; color: #9D968B; max-width: 40ch; }
.ft-open strong { color: var(--brass-lt); font-weight: 600; }
.ft-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }
.ft-h {
  font-size: .69rem; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--brass-lt); margin-bottom: .9rem;
}
.ft-h2 { margin-top: 1.7rem; }
.ft-cols a {
  display: block; text-decoration: none; font-size: .9rem; padding: 3.5px 0;
  color: #C9C3B8; transition: color .16s;
}
.ft-cols a:hover { color: var(--paper); }
.ft-note {
  margin-top: 62px; padding-top: 24px; padding-bottom: 34px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .8rem; color: #8B857B; display: flex; gap: 30px;
  justify-content: space-between; align-items: baseline; flex-wrap: wrap;
}
.ft-note p { max-width: 74ch; }
.ft-note strong { color: #B3ACA1; }
.ft-copy { white-space: nowrap; }


/* == 4. Bloques de sección ================================================ */
.sec { padding: 84px 0; }
.sec-tight { padding: 54px 0; }
.sec-dark { background: var(--ink); color: #CFC9BE; }
.sec-dark h1, .sec-dark h2, .sec-dark h3 { color: var(--paper); }
.sec-alt { background: var(--paper-2); }
.sec + .sec-alt, .sec-alt + .sec { }

.sec-h { display: flex; align-items: flex-end; justify-content: space-between;
         gap: 30px; margin-bottom: 40px; flex-wrap: wrap; }
.sec-h .lead { margin-top: .8rem; }

.more {
  font-size: .84rem; font-weight: 600; text-decoration: none; color: var(--ox);
  white-space: nowrap; border-bottom: 1px solid rgba(122,46,51,.3);
  padding-bottom: 2px;
}
.more:hover { border-bottom-color: var(--ox); }
.sec-dark .more { color: var(--ox-lt); border-bottom-color: rgba(215,154,147,.35); }

/* Portada */
.hero { position: relative; background: var(--ink); color: var(--paper);
        overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .42; }
.hero-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,23,26,.72) 0%,
              rgba(20,23,26,.55) 45%, rgba(20,23,26,.93) 100%);
}
.hero-in { position: relative; padding: 122px 0 104px; }
.hero h1 { max-width: 15ch; color: var(--paper); }
.hero .lead { color: #CFC9BE; margin-top: 1.6rem; max-width: 56ch; }
.hero-cta { display: flex; gap: 14px; margin-top: 2.6rem; flex-wrap: wrap; }

.btn {
  display: inline-block; text-decoration: none; font-size: .88rem;
  font-weight: 600; letter-spacing: .01em; padding: 13px 26px;
  border-radius: var(--r); background: var(--ox); color: #fff;
  border: 1px solid var(--ox); transition: background .18s var(--ease);
}
.btn:hover { background: var(--ox-d); border-color: var(--ox-d); }
.btn-ghost { background: transparent; color: inherit;
             border: 1px solid currentColor; opacity: .85; }
.btn-ghost:hover { background: rgba(255,255,255,.08); opacity: 1; }
.btn-ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ox); border-color: var(--ox); }

/* Cifras del archivo */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(255,255,255,.14); position: relative;
}
.stat { padding: 30px 22px 32px; border-right: 1px solid rgba(255,255,255,.1); }
.stat:last-child { border-right: 0; }
.stat-n {
  font-family: var(--serif); font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 600; line-height: 1; color: var(--paper);
  font-variant-numeric: tabular-nums;
}
.stat-l {
  font-size: .705rem; font-weight: 600; letter-spacing: .15em;
  text-transform: uppercase; color: var(--brass-lt); margin-top: .7rem;
}


/* == 5. Tarjetas ========================================================== */
.grid { display: grid; gap: 28px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--r); overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease),
              border-color .3s var(--ease);
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--sh-2);
               border-color: var(--rule-2); }
.sec-alt .card { background: var(--paper); }
.sec-dark .card { background: var(--ink-2); border-color: rgba(255,255,255,.12);
                  color: #CFC9BE; }
.sec-dark a.card:hover { border-color: rgba(255,255,255,.24); }

.card-media { position: relative; aspect-ratio: 3 / 2; background: var(--paper-3); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .score-tag { position: absolute; right: 0; bottom: 0; }

.card-body { padding: 22px 24px 26px; display: flex; flex-direction: column;
             flex: 1; }
.card-k {
  font-size: .68rem; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--brass); margin-bottom: .7rem;
  display: flex; gap: 10px; align-items: center;
}
.sec-dark .card-k { color: var(--brass-lt); }
.card-t { font-family: var(--serif); font-size: 1.22rem; font-weight: 600;
          line-height: 1.25; }
.card-x { font-size: .915rem; color: var(--slate); margin-top: .7rem;
          line-height: 1.55; }
.sec-dark .card-x { color: #A8A196; }
.card-f {
  margin-top: auto; padding-top: 18px; font-size: .775rem; color: var(--slate);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.card-f-rule { margin-top: auto; padding-top: 18px; }
.card-f-rule .card-f { border-top: 1px solid var(--rule); padding-top: 14px;
                       margin-top: 0; }

/* Placa sin foto: el archivo no inventa imágenes que no tiene. */
.plate {
  aspect-ratio: 3 / 2; display: grid; place-items: center;
  background:
    repeating-linear-gradient(135deg, transparent 0 11px,
      rgba(20,23,26,.028) 11px 12px), var(--paper-2);
  border-bottom: 1px solid var(--rule);
  color: var(--rule-2);
}
.plate .emblem { width: 54px; height: 54px; }
.plate-sm { aspect-ratio: 16 / 9; }


/* == 6. Fichas: notas, ejes, datos ======================================== */
/* La nota. Es la pieza de marca del sitio: número grande en serif, sobre
   burdeos, con el sufijo /10 pequeño. */
.score-tag {
  display: inline-flex; align-items: baseline; gap: 2px;
  background: var(--ox); color: #fff; padding: 9px 14px 8px;
  font-family: var(--serif); font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.score-tag .n { font-size: 1.32rem; }
.score-tag .d { font-size: .72rem; opacity: .72; font-family: var(--sans);
                font-weight: 500; }
.score-tag.low { background: var(--slate); }

.score-big {
  display: flex; align-items: baseline; gap: 6px;
  font-family: var(--serif); font-weight: 600; color: var(--ox);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.score-big .n { font-size: clamp(3.2rem, 7vw, 4.6rem); }
.score-big .d { font-size: 1rem; color: var(--slate); font-family: var(--sans);
                font-weight: 500; }
.score-big.low { color: var(--slate); }

/* Los cuatro ejes */
.axes { display: grid; gap: 13px; }
.axis { display: grid; grid-template-columns: 5.6rem 1fr 2.4rem;
        align-items: center; gap: 14px; }
.axis-l { font-size: .755rem; font-weight: 600; letter-spacing: .1em;
          text-transform: uppercase; color: var(--slate); }
.axis-bar { height: 5px; background: var(--paper-3); border-radius: 3px;
            overflow: hidden; }
.axis-bar span { display: block; height: 100%; background: var(--ox);
                 border-radius: 3px; }
.axis-bar.low span { background: var(--slate-lt); }
.axis-n { font-size: .875rem; font-weight: 600; text-align: right;
          font-variant-numeric: tabular-nums; }
.sec-dark .axis-bar { background: rgba(255,255,255,.14); }
.sec-dark .axis-bar span { background: var(--ox-lt); }
.sec-dark .axis-l { color: #A8A196; }

/* Sello de «tramo digno» */
.digno {
  display: inline-flex; align-items: center; gap: 7px; font-size: .69rem;
  font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--green); border: 1px solid rgba(47,93,80,.3);
  padding: 5px 11px 4px; border-radius: 100px;
}
.digno::before { content: ''; width: 5px; height: 5px; border-radius: 50%;
                 background: var(--green); }
.digno.no { color: var(--slate); border-color: var(--rule-2); }
.digno.no::before { background: var(--slate-lt); }

/* Píldoras de clase */
.pill {
  display: inline-block; font-size: .675rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; padding: 5px 10px 4px;
  border: 1px solid var(--rule-2); border-radius: 100px; color: var(--slate);
  text-decoration: none; white-space: nowrap;
}
a.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pill-ox { color: var(--ox); border-color: rgba(122,46,51,.35); }
.pill-status-prevista { color: var(--brass-dk); border-color: rgba(138,110,44,.4); }
.pill-status-cancelada { color: var(--ox); border-color: rgba(122,46,51,.35);
                         text-decoration: line-through; }

/* Cuadro de datos de una ficha */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  border-top: 1px solid var(--rule); margin: 0;
}
.fact { padding: 17px 20px 19px; border-bottom: 1px solid var(--rule);
        border-right: 1px solid var(--rule); }
.fact:last-child { border-right: 0; }
.fact dt {
  font-size: .655rem; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--brass); margin-bottom: .45rem;
}
.fact dd { font-size: 1.02rem; font-weight: 500;
           font-variant-numeric: tabular-nums; }
.fact dd small { display: block; font-size: .78rem; color: var(--slate);
                 font-weight: 400; margin-top: .15rem; }

/* Avisos dentro de una ficha */
.note, .warn {
  border-left: 3px solid var(--rule-2); background: var(--paper-2);
  padding: 20px 24px; border-radius: 0 var(--r) var(--r) 0; font-size: .95rem;
}
.warn { border-left-color: var(--ox); background: rgba(122,46,51,.055); }
.note h3, .warn h3 {
  font-family: var(--sans); font-size: .705rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; margin-bottom: .6rem;
  color: var(--brass);
}
.warn h3 { color: var(--ox); }
.note p + p, .warn p + p { margin-top: .7em; }
.note ul, .warn ul { padding-left: 1.2em; margin-top: .5em; }
.note li + li, .warn li + li { margin-top: .35em; }

/* Calificaciones individuales */
.ratings { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.rating {
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  padding: 15px 0; border-bottom: 1px solid var(--rule); align-items: center;
}
.rating-who { font-weight: 600; font-size: .95rem; }
.rating-who small { display: block; font-weight: 400; font-size: .755rem;
                    color: var(--slate); letter-spacing: .02em; }
.rating-axes { font-size: .8rem; color: var(--slate);
               font-variant-numeric: tabular-nums; }
.rating-n { font-family: var(--serif); font-size: 1.28rem; font-weight: 600;
            font-variant-numeric: tabular-nums; }


/* == 7. Mapas y descargas ================================================= */
.mapbox { border: 1px solid var(--rule); border-radius: var(--r);
          overflow: hidden; background: var(--paper-2); }
.map { height: 420px; width: 100%; background: var(--paper-3); }
.map-foot {
  display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  align-items: center; padding: 14px 18px; border-top: 1px solid var(--rule);
  font-size: .79rem; color: var(--slate); background: var(--paper);
}
.leaflet-container { font: inherit; }

.dl {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  font-size: .85rem; font-weight: 600; color: var(--ox);
  border: 1px solid rgba(122,46,51,.3); padding: 9px 16px;
  border-radius: var(--r); transition: background .18s;
}
.dl:hover { background: rgba(122,46,51,.06); }
.dl svg { width: 15px; height: 15px; }


/* == 8. Listados, cabeceras de página y filtros =========================== */
.ph { padding: 62px 0 40px; border-bottom: 1px solid var(--rule); }
.ph-dark { background: var(--ink); color: #CFC9BE; border-bottom: 0;
           padding: 74px 0 56px; }
.ph-dark h1 { color: var(--paper); }
.ph h1 { max-width: 20ch; }
.ph .lead { margin-top: 1.15rem; }

.crumb { font-size: .755rem; letter-spacing: .13em; text-transform: uppercase;
         color: var(--slate); margin-bottom: 1.5rem; font-weight: 600; }
.crumb a { text-decoration: none; color: var(--brass); }
.crumb a:hover { color: var(--ox); }
.crumb span { color: var(--rule-2); margin: 0 .55em; }
.ph-dark .crumb { color: #8B857B; }
.ph-dark .crumb a { color: var(--brass-lt); }

.toolbar {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: center;
  padding: 20px 0; border-bottom: 1px solid var(--rule);
  position: sticky; top: 74px; background: var(--paper); z-index: 20;
}
.toolbar-l { font-size: .69rem; font-weight: 600; letter-spacing: .16em;
             text-transform: uppercase; color: var(--slate); margin-right: 6px; }

/* Lista-tabla del archivo documental y de actividades */
.rows { border-top: 1px solid var(--rule); }
.row {
  display: grid; grid-template-columns: 8.4rem 1fr auto; gap: 24px;
  padding: 21px 4px; border-bottom: 1px solid var(--rule);
  text-decoration: none; align-items: baseline;
  transition: background .2s var(--ease), padding-left .2s var(--ease);
}
a.row:hover { background: var(--paper-2); padding-left: 12px; }
.row-code { font-size: .74rem; font-weight: 600; letter-spacing: .09em;
            color: var(--ox); font-variant-numeric: tabular-nums;
            text-transform: uppercase; }
.row-t { font-family: var(--serif); font-size: 1.1rem; font-weight: 600;
         line-height: 1.3; }
.row-x { font-size: .875rem; color: var(--slate); margin-top: .35rem;
         max-width: 74ch; }
.row-r { text-align: right; font-size: .78rem; color: var(--slate);
         white-space: nowrap; }

/* Calendario de actividades */
.cal { border-top: 1px solid var(--rule); }
.cal-row {
  display: grid; grid-template-columns: 6.4rem 1fr auto; gap: 24px;
  padding: 20px 4px; border-bottom: 1px solid var(--rule);
  text-decoration: none; align-items: center;
  transition: background .2s var(--ease), padding-left .2s var(--ease);
}
a.cal-row:hover { background: var(--paper-2); padding-left: 12px; }
.cal-d { text-align: center; border-right: 1px solid var(--rule);
         padding-right: 20px; }
.cal-d .dd { font-family: var(--serif); font-size: 1.55rem; font-weight: 600;
             line-height: 1; }
.cal-d .mm { font-size: .655rem; font-weight: 600; letter-spacing: .16em;
             text-transform: uppercase; color: var(--brass); margin-top: .32rem; }
.cal-t { font-family: var(--serif); font-size: 1.09rem; font-weight: 600; }
.cal-x { font-size: .86rem; color: var(--slate); margin-top: .3rem;
         max-width: 72ch; }
.cal-meta { display: flex; gap: 8px; align-items: center; margin-top: .55rem;
            flex-wrap: wrap; }

/* Cuadro de cumplimiento del programa */
.programme { width: 100%; border-collapse: collapse; font-size: .92rem; }
.programme th, .programme td { padding: .68em .9em; text-align: left;
                               border-bottom: 1px solid var(--rule); }
.programme th { font-family: var(--sans); font-size: .69rem; font-weight: 600;
                letter-spacing: .14em; text-transform: uppercase;
                color: var(--brass); }
.programme td.n { text-align: right; font-variant-numeric: tabular-nums;
                  width: 5.5rem; }
.programme .ok { color: var(--green); font-weight: 600; }

/* Estatutos */
.stat-chap { margin-top: 66px; }
.stat-chap:first-child { margin-top: 0; }
.chap-h {
  display: flex; align-items: baseline; gap: 16px; padding-bottom: 14px;
  border-bottom: 2px solid var(--ink); margin-bottom: 34px;
}
.chap-n { font-size: .69rem; font-weight: 600; letter-spacing: .18em;
          text-transform: uppercase; color: var(--brass); white-space: nowrap; }
.chap-t { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.art { padding: 26px 0; border-bottom: 1px solid var(--rule);
       scroll-margin-top: 100px; }
.art-h { display: flex; gap: 14px; align-items: baseline; margin-bottom: .9rem; }
.art-n {
  font-size: .7rem; font-weight: 600; letter-spacing: .1em; color: var(--ox);
  text-decoration: none; white-space: nowrap; padding-top: .22rem;
  font-variant-numeric: tabular-nums;
}
.art-n:hover { text-decoration: underline; }
.art-t { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }

/* Índice lateral */
.with-aside { display: grid; grid-template-columns: 230px 1fr; gap: 58px;
              align-items: start; }
.aside { position: sticky; top: 104px; font-size: .865rem; }
.aside-h { font-size: .67rem; font-weight: 600; letter-spacing: .17em;
           text-transform: uppercase; color: var(--brass); margin-bottom: 1rem; }
.aside a { display: block; text-decoration: none; color: var(--slate);
           padding: 5px 0; line-height: 1.35; border-left: 2px solid transparent;
           padding-left: 12px; margin-left: -14px; transition: all .18s; }
.aside a:hover { color: var(--ink); border-left-color: var(--brass-lt); }
/* Los enlaces DENTRO de un párrafo del lateral son citas en línea (la nota que
   remite al artículo y al reglamento), no elementos de lista: si heredan el
   `display:block` de arriba, la frase se parte y deja huérfanos el «y» y el
   punto final. */
.aside p a { display: inline; padding: 0; margin: 0; border-left: 0;
             color: var(--ox); }
.aside p a:hover { border-left: 0; text-decoration: underline; }

/* Socios */
.member-card { display: grid; grid-template-columns: 84px 1fr; gap: 22px;
               align-items: start; }
.mono-badge {
  width: 84px; height: 84px; display: grid; place-items: center;
  border: 1px solid var(--rule-2); border-radius: 50%;
  font-family: var(--serif); font-size: 1.85rem; font-weight: 600;
  color: var(--ox); background: var(--paper);
}
.member-office { font-size: .69rem; font-weight: 600; letter-spacing: .16em;
                 text-transform: uppercase; color: var(--brass); }

/* Galería */
.gal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gal figure { margin: 0; }
.gal img { border-radius: var(--r); }
figcaption { font-size: .765rem; color: var(--slate); margin-top: .5rem;
             line-height: 1.4; }
.credit { font-size: .69rem; color: var(--slate-lt); letter-spacing: .04em; }

/* Nota al pie de las imágenes generadas */
.img-credit {
  font-size: .69rem; color: var(--slate-lt); letter-spacing: .05em;
  text-align: right; padding: 6px 2px 0;
}


/* == 9. Formulario ======================================================== */
.form { display: grid; gap: 20px; max-width: 640px; }
.f-row { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 7px; }
.field label { font-size: .715rem; font-weight: 600; letter-spacing: .13em;
               text-transform: uppercase; color: var(--slate); }
.field input, .field textarea {
  font: inherit; font-size: .96rem; padding: 12px 14px; border-radius: var(--r);
  border: 1px solid var(--rule-2); background: var(--paper);
  color: var(--ink); width: 100%;
}
.field input:focus, .field textarea:focus { border-color: var(--ox); }
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.field .hint { font-size: .775rem; color: var(--slate); font-weight: 400;
               text-transform: none; letter-spacing: 0; }
.hp { position: absolute; left: -9999px; }
.errors {
  border-left: 3px solid var(--ox); background: rgba(122,46,51,.06);
  padding: 16px 20px; font-size: .92rem; border-radius: 0 var(--r) var(--r) 0;
}
.errors ul { padding-left: 1.1em; margin-top: .4em; }
.form-note { font-size: .8rem; color: var(--slate); max-width: 62ch; }

/* Error 404/500 */
.err { padding: 120px 0 140px; text-align: center; }
.err .big-em { margin: 0 auto 30px; }
.err h1 { margin-bottom: 1rem; }
.err p { max-width: 46ch; margin: 0 auto 2rem; color: var(--slate); }


/* == 10. Responsive ======================================================= */
@media (max-width: 1020px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .with-aside { grid-template-columns: 1fr; gap: 34px; }
  .aside { position: static; display: none; }
  .ft-in { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 900px) {
  .hd-in { flex-wrap: wrap; min-height: 66px; }
  .burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 42px; height: 42px; cursor: pointer; padding: 10px;
    border: 1px solid var(--rule); border-radius: var(--r);
  }
  .burger span { display: block; height: 1.5px; background: var(--ink); }
  .nav {
    display: none; width: 100%; flex-direction: column; align-items: stretch;
    padding: 8px 0 18px; gap: 0;
  }
  .navtoggle:checked ~ .nav { display: flex; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid var(--rule);
           font-size: .95rem; }
  .nav a.on::after { display: none; }
  .nav-cta { margin: 14px 0 0; text-align: center; border-radius: var(--r); }
  .toolbar { top: 0; }
  .aside { display: none; }
}

@media (max-width: 780px) {
  body { font-size: 16px; }
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .sec { padding: 58px 0; }
  .hero-in { padding: 80px 0 68px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .stat:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.1); }
  .ft-cols { grid-template-columns: 1fr 1fr; }
  .row, .cal-row { grid-template-columns: 1fr; gap: 8px; }
  .row-r { text-align: left; }
  .cal-d { text-align: left; border-right: 0; padding-right: 0;
           display: flex; gap: 10px; align-items: baseline; }
  .cal-d .mm { margin-top: 0; }
  .f-row { grid-template-columns: 1fr; }
  .gal { grid-template-columns: repeat(2, 1fr); }
  .axis { grid-template-columns: 4.8rem 1fr 2.2rem; gap: 10px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .fact:nth-child(2n) { border-right: 0; }
  .map { height: 320px; }
  .ft-note { flex-direction: column; gap: 14px; }
}

@media print {
  .hd, .ft, .toolbar, .hero-cta, .mapbox { display: none; }
  body { background: #fff; font-size: 11pt; }
  .sec, .ph { padding: 12pt 0; }
  a { text-decoration: none; }
  .prose a::after { content: ' (' attr(href) ')'; font-size: .8em;
                    color: #555; }
}
