/* ============================================================
   ROTARY CLUB DE LASCANO — Sistema visual compartido
   Colores y tipografía según Rotary International Brand Center
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

:root {
  /* --- Colores líder Rotary --- */
  --azure:      #0050a2;  /* color principal, el más usado */
  --azure-700:  #003f80;
  --azure-900:  #002a57;
  --royal:      #17458f;  /* la palabra "Rotary" */
  --sky:        #019fcb;
  --gold:       #f7a81b;  /* acento / mark of excellence */
  --gold-deep:  #e0921a;

  /* --- Secundarios (uso puntual) --- */
  --cranberry:  #d41367;
  --turquoise:  #009999;
  --violet:     #872175;
  --orange:     #ff7600;

  /* --- Neutros (blancos/negros sutilmente fríos) --- */
  --paper:      #f6f8fb;
  --paper-2:    #eef2f7;
  --white:      #ffffff;
  --ink:        #14233b;
  --ink-soft:   #3a4a63;
  --muted:      #6b7c93;
  --line:       #dde4ee;
  --line-soft:  #e9eef5;

  /* --- Sombras --- */
  --sh-sm: 0 1px 2px rgba(20,35,59,.06), 0 2px 6px rgba(20,35,59,.05);
  --sh-md: 0 6px 18px rgba(20,35,59,.08), 0 2px 6px rgba(20,35,59,.05);
  --sh-lg: 0 18px 50px rgba(20,35,59,.14), 0 6px 16px rgba(20,35,59,.07);
  --sh-blue: 0 14px 40px rgba(0,80,162,.22);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 30px;

  --maxw: 1200px;
  --nav-h: 76px;

  --font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--azure); text-decoration: none; }

/* --- Tipografía --- */
h1, h2, h3, h4 { margin: 0; line-height: 1.08; color: var(--ink); font-weight: 800; }

.eyebrow {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--azure);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 3px; border-radius: 3px;
  background: var(--gold);
}
.eyebrow.on-dark { color: var(--gold); }
.eyebrow.on-dark::before { background: var(--gold); }

.display {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: .98;
  font-size: clamp(2.6rem, 6vw, 5rem);
}
.section-title {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.005em;
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.02;
}
.lead { font-size: clamp(1.05rem, 1.5vw, 1.3rem); color: var(--ink-soft); line-height: 1.6; }

/* --- Layout --- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section.tight { padding: clamp(48px, 6vw, 80px) 0; }
.center { text-align: center; }
.center .eyebrow { justify-content: center; }

.bg-paper { background: var(--paper); }
.bg-paper2 { background: var(--paper-2); }
.bg-white { background: var(--white); }
.bg-azure { background: var(--azure); color: #eaf2fb; }
.bg-deep {
  background: radial-gradient(120% 130% at 80% 0%, var(--azure) 0%, var(--azure-900) 70%);
  color: #dce8f6;
}
.bg-deep h1, .bg-deep h2, .bg-deep h3, .bg-azure h1, .bg-azure h2, .bg-azure h3 { color: #fff; }

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font);
  font-weight: 700; font-size: 15px;
  padding: 14px 26px; border-radius: 999px;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .14s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  text-decoration: none; line-height: 1; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: var(--gold); color: var(--ink); box-shadow: 0 8px 22px rgba(247,168,27,.35); }
.btn-gold:hover { background: #ffba36; }
.btn-azure { background: var(--azure); color: #fff; box-shadow: var(--sh-blue); }
.btn-azure:hover { background: var(--azure-700); }
.btn-ghost { background: transparent; color: var(--azure); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--azure); background: #fff; }
.btn-ghost.on-dark { color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost.on-dark:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn-white { background: #fff; color: var(--azure); }
.btn-white:hover { background: #eaf2fb; }
.btn-lg { padding: 17px 32px; font-size: 16px; }

/* --- Pills / chips --- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
  padding: 7px 14px; border-radius: 999px;
  background: #eaf2fb; color: var(--azure);
}
.pill.gold { background: #fdf0d6; color: var(--gold-deep); }

/* --- Cards --- */
.card {
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
  transition: transform .18s ease, box-shadow .25s ease, border-color .2s ease;
}
.card.hover:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: var(--line); }

/* --- Placeholder de imagen (rayas + leyenda mono) --- */
.imgph {
  position: relative; overflow: hidden;
  background-color: #e9eef5;
  background-image: repeating-linear-gradient(135deg, #e2e9f2 0 12px, #eef3f9 12px 24px);
  display: grid; place-items: center;
  color: #8294ad; border-radius: var(--r-md);
}
.imgph span {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(255,255,255,.78); padding: 6px 12px; border-radius: 999px;
  box-shadow: var(--sh-sm);
}
.imgph.azure {
  background-color: #d7e6f7;
  background-image: repeating-linear-gradient(135deg, #cfe0f4 0 12px, #dcebfa 12px 24px);
}

/* --- Rueda decorativa (no es el emblema; sólo textura de marca) --- */
.spoke-bg { position: relative; overflow: hidden; }

/* --- Nav --- */
.nav {
  position: sticky; top: 0; z-index: 200;
  height: var(--nav-h);
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-in { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; height: 100%;
  display: flex; align-items: center; gap: 24px; }
.nav-logo { height: 48px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  font-size: 14.5px; font-weight: 600; color: var(--ink-soft);
  padding: 9px 13px; border-radius: 9px; transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--paper-2); color: var(--azure); }
.nav-cta { margin-left: 6px; }
.nav-toggle { display: none; }

/* dropdown */
.nav-drop { position: relative; }
.nav-drop > a::after { content: "▾"; font-size: 11px; margin-left: 5px; opacity: .6; }
.nav-menu {
  position: absolute; top: calc(100% + 10px); left: 0;
  background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-md);
  box-shadow: var(--sh-lg); padding: 8px; min-width: 230px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all .16s ease;
}
.nav-drop:hover .nav-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu a { display: block; padding: 10px 12px; border-radius: 9px; font-size: 14.5px;
  color: var(--ink-soft); font-weight: 600; }
.nav-menu a:hover { background: var(--paper-2); color: var(--azure); }
.nav-menu small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); margin-top: 1px; }

/* --- Botón toggle de tema claro/oscuro --- */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .2s, border-color .2s, color .2s, transform .2s;
  flex: none;
  padding: 0;
  margin-left: 4px;
}
.theme-toggle:hover {
  background: var(--paper-2);
  border-color: var(--azure);
  color: var(--azure);
  transform: rotate(18deg);
}
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle {
  border-color: rgba(255,255,255,.22);
  color: var(--gold);
}
html[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255,255,255,.08);
  border-color: var(--gold);
  transform: rotate(-18deg);
}

/* --- Footer --- */
.foot { background: var(--azure-900); color: #b9cce4; padding: 64px 0 28px; }
.foot a { color: #cfe0f4; }
.foot a:hover { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.foot h4 { color: #fff; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 16px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14.5px; }
.foot-logo-chip { background: #fff; border-radius: 12px; padding: 12px 16px; display: inline-block; }
.foot-logo-chip img { height: 44px; width: auto; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 44px; padding-top: 22px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 13px; color: #8fa9ca; }

/* --- Tabla de datos (admin/portal) --- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); }
.tbl tr:hover td { background: var(--paper); }

/* --- Badges de estado --- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 4px 11px; border-radius: 999px; }
.badge.ok { background: #dcf3e8; color: #0a7c52; }
.badge.warn { background: #fdeecb; color: #9a6a07; }
.badge.out { background: #fbdfe4; color: #b0123e; }
.badge.info { background: #d9ecfb; color: var(--azure); }
.dot { width: 8px; height: 8px; border-radius: 50%; }

/* --- Reveal on scroll --- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* --- Responsive --- */
@media (max-width: 920px) {
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .nav-links { position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column; align-items: stretch;
    background: #fff; padding: 14px; gap: 2px; border-bottom: 1px solid var(--line);
    box-shadow: var(--sh-lg); transform: translateY(-120%); transition: transform .25s ease; }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 13px; font-size: 16px; }
  .nav-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
    border: none; padding: 0 0 0 12px; }
  .nav-toggle { display: inline-flex; margin-left: auto; background: var(--azure); color: #fff;
    border: none; border-radius: 10px; width: 44px; height: 44px; align-items: center; justify-content: center;
    cursor: pointer; font-size: 20px; }
}
@media (max-width: 560px) {
  .foot-grid { grid-template-columns: 1fr; }
  body { font-size: 16px; }
}

/* ============================================================
   TEMA OSCURO — Fondo azul Rotary (toggle vía Tweaks)
   Flipea sobre las variables + ajustes de superficies sólidas
   ============================================================ */
html[data-theme="dark"] {
  --paper:    #071c30;   /* navy profundo Rotary */
  --paper-2:  #0c2540;
  --white:    #0f2a47;   /* superficie de tarjetas */
  --ink:      #eaf2fb;
  --ink-soft: #c2d4ea;
  --muted:    #8ba6c6;
  --line:     #23456a;
  --line-soft:#193552;
}
html[data-theme="dark"] body { background: var(--paper); }

/* superficies que estaban hardcodeadas en blanco */
html[data-theme="dark"] .card,
html[data-theme="dark"] .nav-menu,
html[data-theme="dark"] .banco-card,
html[data-theme="dark"] .agenda-item,
html[data-theme="dark"] .form-card { background: var(--white); border-color: var(--line-soft); }

html[data-theme="dark"] .nav {
  background: rgba(7,24,42,.86); border-bottom-color: var(--line-soft);
}
html[data-theme="dark"] .nav-logo { background: #fff; border-radius: 8px; padding: 3px 10px; }

/* acentos de texto: el azul puro queda apagado sobre navy → usamos sky */
html[data-theme="dark"] .eyebrow { color: var(--sky); }
html[data-theme="dark"] .casa-card .go,
html[data-theme="dark"] .hv3-left h1 em { color: var(--sky); }

/* chips y botones fantasma */
html[data-theme="dark"] .pill { background: rgba(255,255,255,.09); color: #d2e3f6; }
html[data-theme="dark"] .ci-ic { background: rgba(255,255,255,.09); color: var(--gold); }
html[data-theme="dark"] .btn-ghost { color: #eaf2fb; border-color: rgba(255,255,255,.26); }
html[data-theme="dark"] .btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.07); }

/* inputs */
html[data-theme="dark"] .field input:focus,
html[data-theme="dark"] .field textarea:focus,
html[data-theme="dark"] .frm input:focus,
html[data-theme="dark"] .frm textarea:focus,
html[data-theme="dark"] .frm select:focus { background: var(--paper-2); }

/* placeholders de imagen rayados → versión oscura */
html[data-theme="dark"] .imgph {
  background-color: #11314d;
  background-image: repeating-linear-gradient(135deg, #0f2c46 0 12px, #15375a 12px 24px);
  color: #87a1bf;
}
html[data-theme="dark"] .imgph span { background: rgba(255,255,255,.1); color: #aac1dd; box-shadow: none; }

/* login del admin en oscuro */
html[data-theme="dark"] .login-card { background: var(--white); }

/* ============================================================
   ACCESIBILIDAD — WCAG 2.1 AA · Decreto 333/016 Uruguay
   ============================================================ */

/* ── Enlace de salto al contenido (WCAG 2.4.1) ──────────────────────────── */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 16px;
  background: var(--azure);
  color: #fff;
  padding: 12px 26px;
  border-radius: 0 0 14px 14px;
  font-weight: 700;
  font-size: 15px;
  z-index: 9999;
  text-decoration: none;
  box-shadow: var(--sh-lg);
  white-space: nowrap;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ── Indicadores de foco visibles (WCAG 2.4.7 / 2.4.11) ────────────────── */
:focus-visible {
  outline: 3px solid var(--gold) !important;
  outline-offset: 3px !important;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

/* ── Reducción de movimiento (WCAG 2.3.3) ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ── Tamaños de texto accesibles (WCAG 1.4.4) ───────────────────────────── */
html[data-a11y-font="-1"] body { font-size: 14px; }
/* font="0" = 17px por defecto */
html[data-a11y-font="1"]  body { font-size: 20px; }
html[data-a11y-font="2"]  body { font-size: 24px; }

/* ── Alto contraste (WCAG 1.4.3 / 1.4.6) ───────────────────────────────── */
html[data-a11y-contrast] {
  --azure:     #003db3;
  --gold:      #c47f00;
  --paper:     #ffffff;
  --paper-2:   #efefef;
  --white:     #ffffff;
  --ink:       #000000;
  --ink-soft:  #111111;
  --muted:     #333333;
  --line:      #666666;
  --line-soft: #aaaaaa;
}
html[data-a11y-contrast] .bg-deep,
html[data-a11y-contrast] .donate { background: #001f6b !important; }
html[data-a11y-contrast] .btn-azure { border: 2px solid #ffffff; }
html[data-a11y-contrast] .btn-gold  { border: 2px solid #000000; }
html[data-a11y-contrast] .card,
html[data-a11y-contrast] .form-card { border-color: #666 !important; }

/* ── Escala de grises (WCAG 1.4.1 alternativa cromática) ────────────────── */
html[data-a11y-gray] { filter: grayscale(100%); }

/* ── Subrayar todos los enlaces (WCAG 1.4.1) ────────────────────────────── */
html[data-a11y-links] a { text-decoration: underline !important; text-underline-offset: 3px; }
html[data-a11y-links] .btn { text-decoration: underline !important; text-decoration-thickness: 1.5px !important; }

/* ── Fuente legible — Lexend (lectura fácil / dislexia) ─────────────────── */
html[data-a11y-dyslexia] { --font: 'Lexend', 'Open Sans', system-ui, sans-serif; }
html[data-a11y-dyslexia] *:not(svg):not(path):not(circle):not(line) {
  font-family: var(--font) !important;
  letter-spacing: .03em;
  word-spacing: .08em;
  line-height: 1.82;
}

