/* Estilo de las páginas legales: el mismo sistema que la app («el ajuar de la casa cabilia»,
   DESIGN.md del repo Numidia). Lino de fondo, tinta para el texto y la acción, sarga para los
   enlaces, oro para los avisos y el Yaz (ⵣ) en coral como única joya. Superficies lisas, sin
   texturas, con el filo superior de plata y la sombra cálida de la app.

   Las fuentes se sirven desde este mismo dominio (subconjunto woff2 de Noto Sans, licencia
   SIL OFL en assets/fonts/OFL.txt): una política de privacidad que manda la IP del visitante
   a Google Fonts se contradiría a sí misma. Los colores salen de constants/themeTokens.json. */

@font-face { font-family: "Noto Sans"; font-weight: 400; font-display: swap; src: url("fonts/NotoSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans"; font-weight: 600; font-display: swap; src: url("fonts/NotoSans-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans"; font-weight: 700; font-display: swap; src: url("fonts/NotoSans-Bold.woff2") format("woff2"); }
/* Solo el glifo del Yaz (U+2D63). */
@font-face { font-family: "Numidia Yaz"; font-display: block; src: url("fonts/NotoSansTifinagh-Yaz.woff2") format("woff2"); unicode-range: U+2D63; }

:root {
  color-scheme: light;
  --ground: #F1F3EC;        /* linen-bg */
  --sheet: #F4F5EF;         /* linen-modal */
  --surface: #E8EAE2;       /* linen-surface */
  --border: rgba(26, 36, 32, 0.14);
  --highlight: rgba(255, 255, 255, 0.85);
  --ink: #1A2420;           /* tinta de Djurdjura */
  --on-ink: #F4F5EF;
  --text-mid: #3B4640;
  --text-muted: #55625B;
  --sarga: #195C45;
  --sarga-soft: rgba(25, 92, 69, 0.12);
  --gold: #F59E0B;
  --gold-text: #8A5A12;
  --gold-soft: rgba(245, 158, 11, 0.12);
  --coral: #F43F5E;         /* coral del Yaz */
  --shadow: 0 1px 2px rgba(104, 58, 20, 0.10), 0 18px 40px -24px rgba(104, 58, 20, 0.45);
  --shadow-sm: 0 1px 2px rgba(104, 58, 20, 0.10), 0 8px 18px -14px rgba(104, 58, 20, 0.45);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ground: #161E1B;      /* verde bosque, no negro */
    --sheet: #1D2824;
    --surface: #28332F;
    --border: rgba(236, 239, 234, 0.10);
    --highlight: rgba(255, 255, 255, 0.18);
    --ink: #ECEFEA;
    --on-ink: #1D2824;
    --text-mid: #C9D1CC;
    --text-muted: #A9B5AF;
    --sarga: #7CCDB0;
    --sarga-soft: rgba(124, 205, 176, 0.16);
    --gold: #FBBF24;
    --gold-text: #FBBF24;
    --gold-soft: rgba(251, 191, 36, 0.10);
    --coral: #FB7185;
    --shadow: 0 1px 2px rgba(22, 9, 0, 0.6), 0 18px 40px -20px rgba(22, 9, 0, 0.9);
    --shadow-sm: 0 1px 2px rgba(22, 9, 0, 0.6), 0 8px 18px -12px rgba(22, 9, 0, 0.9);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 32px 20px 56px;
  background: var(--ground);
  color: var(--ink);
  font-family: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* La hoja: el documento sobre el lino, con el filo de plata y la sombra cálida. */
.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 44px 36px;
  background: var(--sheet);
  border: 1.5px solid var(--border);
  border-top-color: var(--highlight);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

/* Selector de idioma: control segmentado, como los chips de la app. */
.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  width: fit-content;
  margin-left: auto;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
}
.lang-switch a { padding: 5px 12px; border-radius: 999px; color: var(--text-muted); text-decoration: none; font-weight: 600; line-height: 1.4; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a.active { background: var(--ink); color: var(--on-ink); }

/* Cabecera: el icono de la app (claro u oscuro, como el sistema), el título y el Yaz en coral.
   email-logo.png se queda solo para las plantillas de correo, que lo enlazan por URL. */
header { position: relative; padding: 28px 0 26px; margin-bottom: 30px; border-bottom: 1px solid var(--border); }
header::before {
  content: "";
  display: block;
  width: 60px;
  height: 60px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: url("logo-light.webp") center / cover no-repeat;
  border: 1.5px solid var(--highlight);
  box-shadow: var(--shadow-sm);
}
header::after {
  content: "ⵣ";
  position: absolute;
  top: 30px;
  right: 0;
  font-family: "Numidia Yaz", "Noto Sans Tifinagh", sans-serif;
  font-size: 30px;
  line-height: 1;
  color: var(--coral);
}
@media (prefers-color-scheme: dark) {
  header::before { background-image: url("logo-dark.webp"); }
}

h1 { margin: 0 0 12px; font-size: 2.1rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.updated {
  display: inline-block;
  margin: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sarga-soft);
  color: var(--sarga);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

h2 { position: relative; margin: 42px 0 12px; padding-left: 20px; font-size: 1.32rem; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
/* Rombo de sarga: el marcador de sección. */
h2::before { content: ""; position: absolute; left: 2px; top: 0.5em; width: 8px; height: 8px; background: var(--sarga); border-radius: 2px; transform: rotate(45deg); }
h3 { margin: 28px 0 8px; font-size: 1.05rem; font-weight: 600; color: var(--ink); }
p, li { max-width: 68ch; }
p { margin: 0 0 14px; color: var(--text-mid); }
ul, ol { margin: 0 0 18px; padding-left: 22px; color: var(--text-mid); }
li { margin-bottom: 7px; padding-left: 2px; }
li::marker { color: var(--sarga); }
strong { font-weight: 600; color: var(--ink); }
a { color: var(--sarga); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--sarga); outline-offset: 3px; border-radius: 6px; }

/* Tablas en una tarjeta de lino tejido. */
.scroll { overflow-x: auto; margin: 4px 0 24px; background: var(--surface); border: 1.5px solid var(--border); border-top-color: var(--highlight); border-radius: 16px; box-shadow: var(--shadow-sm); }
table { width: 100%; margin: 0; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); color: var(--text-mid); }
tr:last-child td { border-bottom: 0; }
th { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
td:first-child { color: var(--ink); font-weight: 600; }

/* Aviso: el oro de la app, con su variante de texto legible. */
.todo { margin: 0 0 20px; padding: 14px 18px; background: var(--gold-soft); border: 1px solid var(--border); border-left: 4px solid var(--gold); border-radius: 12px; color: var(--gold-text); font-size: 0.93rem; }

/* Navegación entre páginas: botones secundarios de la app (cápsula de lino). */
nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--border); }
nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top-color: var(--highlight);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}
nav a:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* Portada: tarjetas hacia cada página. */
.intro { font-size: 1.05rem; margin-bottom: 26px; }
.hub { display: grid; gap: 12px; margin: 0 0 8px; }
.hub a {
  display: grid;
  grid-template-columns: 44px 1fr 20px;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-top-color: var(--highlight);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.hub a:hover { transform: translateY(-1px); border-color: var(--sarga); }
.hub .icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--sarga-soft); color: var(--sarga); }
.hub .icon svg { width: 22px; height: 22px; }
.hub .title { display: block; font-weight: 600; font-size: 1.02rem; line-height: 1.35; }
.hub .desc { display: block; margin-top: 2px; color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; }
.hub .chevron { color: var(--text-muted); font-size: 1.1rem; }

footer { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.82rem; }
/* La portada ya cierra con sus tarjetas: sin raya doble. */
.hub + footer { border-top: 0; padding-top: 0; }

@media (max-width: 560px) {
  body { padding: 12px 10px 40px; font-size: 15.5px; }
  .wrap { padding: 16px 20px 28px; border-radius: 16px; }
  .lang-switch { margin-left: 0; }
  header { padding-top: 22px; }
  header::after { top: 24px; font-size: 26px; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.18rem; margin-top: 34px; }
  .hub a { grid-template-columns: 40px 1fr 16px; gap: 12px; padding: 16px; }
  .hub .icon { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .hub a { transition: none; }
  .hub a:hover { transform: none; }
}

/* Árabe: la app invierte a mano filas, flechas y alineación; aquí lo mismo. */
[dir="rtl"] body { font-family: "Noto Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, "Noto Sans", sans-serif; text-align: right; }
[dir="rtl"] .lang-switch { margin-left: 0; margin-right: auto; }
[dir="rtl"] header::after { right: auto; left: 0; }
[dir="rtl"] h2 { padding-left: 0; padding-right: 20px; }
[dir="rtl"] h2::before { left: auto; right: 2px; }
[dir="rtl"] ul, [dir="rtl"] ol { padding-left: 0; padding-right: 22px; }
[dir="rtl"] li { padding-left: 0; padding-right: 2px; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }
[dir="rtl"] .todo { border-left: 1px solid var(--border); border-right: 4px solid var(--gold); }
[dir="rtl"] .hub .chevron { transform: scaleX(-1); }
