/* ============================================================
   El Apellido Lugones en Argentina — Sistema de Diseño
   ============================================================ */

/* --- Variables ------------------------------------------- */
:root {
  /* Paleta — Azul / Borgoña / Blanco roto / Marrón antiguo */
  --bg:           #D6D8D5;   /* blanco roto */
  --bg-alt:       #C8CBC6;
  --surface:      #FFFFFF;
  --surface-alt:  #E7E8E4;

  /* Marca: azul principal como estructura */
  --sienna:       #122B67;   /* azul principal */
  --sienna-dark:  #0E2150;   /* azul más oscuro (navbar/hero) */
  --gold:         #640D19;   /* rojo borgoña — acento/CTA */
  --gold-light:   #8A1422;   /* borgoña claro (hover) */
  --gold-pale:    #EAD7DA;   /* borgoña pálido (fondos) */
  --forest:       #5A4638;   /* marrón antiguo (neutro/variante) */
  --forest-light: #6E5848;
  --crimson:      #640D19;   /* borgoña */

  /* Bordes */
  --border:       #B8BBB6;
  --border-light: #CDCFCA;

  /* Texto */
  --text:         #1E222C;   /* azul-negro */
  --text-2:       #5A4638;   /* marrón antiguo */
  --text-3:       #857668;   /* marrón claro */
  --link:         #122B67;   /* azul principal */

  /* Tipografía */
  --serif: Georgia, 'Times New Roman', serif;
  --sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Geometría */
  --r:       8px;
  --r-lg:    14px;
  --shadow:  0 2px 10px rgba(107,62,38,.12);
  --shadow-lg: 0 6px 28px rgba(107,62,38,.18);
  --max-w:   1200px;
  --nav-h:   62px;
}

/* --- Reset ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* --- Tipografía ------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.25;
  color: var(--sienna-dark);
}

/* --- Layout ---------------------------------------------- */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section     { padding: 72px 0; }
.section-sm  { padding: 48px 0; }

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--gold);
  margin-bottom: 8px;
}
.section-title {
  font-size: 30px;
  margin-bottom: 10px;
}
.section-sub {
  font-size: 15.5px;
  color: var(--text-2);
  max-width: 620px;
  line-height: 1.65;
}

/* --- Navbar ---------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--sienna-dark);
  border-bottom: 2px solid var(--gold);
  display: flex;
  align-items: center;
  overflow: visible;
}
.navbar .wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.nav-mobile-only { display: none; }

.nav-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #F5E9CE;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.15);
}

.nav-links {
  display: flex;
  gap: 2px;
  margin-left: auto;
}
.nav-links a {
  color: #D4C4A0;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 6px;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-links a:hover {
  background: rgba(255,255,255,.1);
  color: #F5E9CE;
  text-decoration: none;
}
.nav-links a.active {
  background: rgba(181,134,13,.3);
  color: var(--gold-light);
}

/* Búsqueda */
.nav-search {
  position: relative;
  margin-left: 12px;
  flex-shrink: 0;
}
.nav-search input {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  color: #F5E9CE;
  font-size: 13px;
  padding: 6px 14px 6px 32px;
  width: 200px;
  outline: none;
  transition: background .15s, width .2s;
}
.nav-search input::placeholder { color: rgba(245,233,206,.45); }
.nav-search input:focus {
  background: rgba(255,255,255,.15);
  border-color: var(--gold);
  width: 230px;
}
.nav-search .s-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(245,233,206,.55);
  font-size: 12px;
  pointer-events: none;
}
.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  width: 320px;
  max-height: 380px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}
.search-dropdown.open { display: block; }
.s-result {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  font-size: 13.5px;
  transition: background .1s;
}
.s-result:hover { background: var(--surface-alt); text-decoration: none; }
.s-result:last-child { border-bottom: none; }
.s-result-title { font-weight: 600; color: var(--sienna); }
.s-result-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.s-empty   { padding: 16px 14px; font-size: 13px; color: var(--text-3); text-align: center; }
.s-loading { padding: 8px 14px;  font-size: 12px; color: var(--text-3); font-style: italic; }
.s-divider { padding: 4px 14px;  font-size: 10px; color: var(--text-3); text-transform: uppercase;
             letter-spacing: .06em; border-top: 1px solid var(--border); margin-top: 2px; }

/* Menú mobile */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #F5E9CE;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
  line-height: 1;
}

/* --- Hero ------------------------------------------------ */
.hero {
  background: linear-gradient(135deg, var(--sienna-dark) 0%, #122B67 55%, #091633 100%);
  padding: 80px 0 72px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 60%, rgba(181,134,13,.09) 0%, transparent 55%),
    radial-gradient(circle at 85% 15%, rgba(181,134,13,.06) 0%, transparent 50%);
  pointer-events: none;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-eye {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(30px, 4.5vw, 52px);
  color: #F5E9CE;
  line-height: 1.15;
  margin-bottom: 18px;
}
.hero-desc {
  font-size: 15.5px;
  color: rgba(245,233,206,.72);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 30px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  border: none;
  font-family: var(--sans);
}
.btn-primary { background: var(--gold); color: #fff; }
.btn-primary:hover { background: var(--gold-light); text-decoration: none; color: #fff; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-2);
}
.btn-outline:hover {
  background: var(--surface);
  border-color: var(--sienna);
  color: var(--sienna);
  text-decoration: none;
}
.btn-sm { padding: 7px 14px; font-size: 13px; }

.hero-escudo { text-align: center; }
.hero-escudo img {
  width: 160px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,.45));
  border-radius: var(--r);
  margin: 0 auto;
}
.hero-escudo figcaption {
  color: rgba(245,233,206,.4);
  font-size: 11px;
  margin-top: 8px;
  font-style: italic;
}

/* --- Stats bar ------------------------------------------- */
.stats-bar {
  background: var(--sienna);
  padding: 22px 0;
}
.stats-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
}
.stat-num {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-lbl {
  font-size: 11.5px;
  color: rgba(245,233,206,.65);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* --- Intro section --------------------------------------- */
.intro-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 48px;
  align-items: start;
}
.intro-body {
  font-size: 15.5px;
  color: var(--text-2);
  line-height: 1.75;
}
.intro-body p + p { margin-top: 14px; }
.intro-body a { color: var(--sienna); font-weight: 500; }
.intro-body a:hover { color: var(--gold); }

.sources-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.sources-box h3 {
  font-size: 15px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}
.source-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.4;
}
.source-item:last-child { border-bottom: none; }
.source-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* --- Nav cards ------------------------------------------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.nav-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform .18s, box-shadow .18s;
  display: flex;
  flex-direction: column;
}
.nav-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: var(--text);
}
.nav-card-bar { height: 4px; background: var(--gold); }
.nav-card-bar.green  { background: var(--forest); }
.nav-card-bar.crimson{ background: var(--crimson); }
.nav-card-bar.sienna { background: var(--sienna); }
.nav-card-body { padding: 20px; flex: 1; }
.nav-card-icon { font-size: 30px; margin-bottom: 10px; line-height: 1; }
.nav-card-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--sienna-dark);
  margin-bottom: 6px;
}
.nav-card-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.nav-card-foot {
  padding: 11px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-card-foot-txt { font-size: 11.5px; color: var(--text-3); }
.nav-card-arrow { color: var(--gold); font-size: 15px; }

/* --- Profesiones grid ------------------------------------ */
.prof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.prof-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform .18s, box-shadow .18s;
}
.prof-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.prof-card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  object-position: center top;
  background: #3A2210;
  display: block;
  padding: 10px;
}
.prof-icon {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.prof-card-foot {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.prof-card-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--sienna-dark);
}
.prof-card-count { font-size: 11px; color: var(--text-3); }

/* --- Comunidades grid ------------------------------------ */
.com-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.com-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform .18s, box-shadow .18s;
  text-align: center;
  padding: 28px 20px 22px;
}
.com-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.com-card img {
  width: 100px;
  height: auto;
  margin: 0 auto 14px;
}
.com-card-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--sienna-dark);
  margin-bottom: 6px;
}
.com-card-desc { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* --- Timeline -------------------------------------------- */
.timeline { position: relative; padding: 4px 0; }
.timeline::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold), var(--forest));
}
.tl-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 18px;
  margin-bottom: 28px;
  align-items: start;
}
.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--gold);
  margin-top: 5px;
  justify-self: center;
  position: relative;
  z-index: 1;
}
.tl-dot.green { background: var(--forest); box-shadow: 0 0 0 2px var(--forest); }
.tl-year {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 2px;
  font-family: var(--serif);
}
.tl-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--sienna-dark);
  margin-bottom: 3px;
}
.tl-text { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* --- Tablas de datos ------------------------------------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--surface);
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
}
.data-table th {
  background: var(--sienna);
  color: #F5E9CE;
  font-family: var(--serif);
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
}
.data-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: var(--surface-alt); }
.data-table tr:hover td { background: var(--bg-alt); }
.data-table td a { color: var(--sienna); font-weight: 500; }
.data-table td a:hover { color: var(--gold); }

/* --- Encabezado de páginas interiores ------------------- */
.page-hd {
  background: linear-gradient(135deg, var(--sienna-dark) 0%, #122B67 100%);
  padding: 52px 0 44px;
  position: relative;
}
.page-hd::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--forest));
}
.breadcrumb {
  font-size: 12px;
  color: rgba(245,233,206,.45);
  margin-bottom: 12px;
}
.breadcrumb a { color: rgba(245,233,206,.55); }
.breadcrumb a:hover { color: var(--gold-light); text-decoration: none; }
.breadcrumb span { margin: 0 6px; }
.page-hd h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 3.5vw, 40px);
  color: #F5E9CE;
  margin-bottom: 10px;
}
.page-hd-desc {
  font-size: 15px;
  color: rgba(245,233,206,.68);
  max-width: 580px;
  line-height: 1.65;
}

/* --- Card genérico --------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
}
.card h3 {
  font-size: 17px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.card p, .card li { font-size: 13.5px; color: var(--text-2); line-height: 1.55; }
.card li { padding: 4px 0; padding-left: 14px; position: relative; }
.card li::before { content: '→'; position: absolute; left: 0; color: var(--gold); font-size: 11px; top: 6px; }

/* --- Badges / tags --------------------------------------- */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--surface-alt);
  color: var(--sienna);
  border: 1px solid var(--border);
}
.tag.gold { background: var(--gold-pale); color: #6B4E00; border-color: #D4A520; }
.tag.green { background: #E8F5E0; color: var(--forest); border-color: #A8D890; }

/* --- Grid 2 columnas ------------------------------------ */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* --- Dividers ------------------------------------------- */
hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}
.alt-section { background: var(--surface-alt); }

/* --- Footer --------------------------------------------- */
.footer {
  background: var(--sienna-dark);
  color: rgba(245,233,206,.65);
  padding: 52px 0 24px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 10px;
}
.footer-desc { font-size: 13px; line-height: 1.7; }
.footer-col h4 {
  font-family: var(--serif);
  font-size: 13px;
  color: #F5E9CE;
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: rgba(245,233,206,.6);
  padding: 3px 0;
  transition: color .15s;
}
.footer-col a:hover { color: var(--gold-light); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(245,233,206,.08);
  padding-top: 20px;
  font-size: 11.5px;
  color: rgba(245,233,206,.35);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* --- Highlight box -------------------------------------- */
.highlight-box {
  background: var(--gold-pale);
  border: 1px solid #D4A520;
  border-radius: var(--r);
  padding: 16px 20px;
  font-size: 14px;
  color: #5A3A00;
  line-height: 1.6;
}
.highlight-box strong { color: #3A2400; }

/* --- Responsive ----------------------------------------- */
@media (max-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .prof-grid  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .stats-inner    { grid-template-columns: repeat(2, 1fr); }
  .intro-grid     { grid-template-columns: 1fr; }
  .grid-2         { grid-template-columns: 1fr; }
  .footer-inner   { grid-template-columns: 1fr 1fr; }
  .hero-inner     { grid-template-columns: 1fr; }
  .hero-escudo    { display: none; }
}

@media (max-width: 640px) {
  :root { --nav-h: 56px; }
  .wrap { padding: 0 16px; }
  .section { padding: 48px 0; }
  .cards-grid { grid-template-columns: 1fr; }
  .prof-grid  { grid-template-columns: 1fr; }
  .com-grid   { grid-template-columns: 1fr; }
  .grid-3     { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .nav-links  { display: none; }
  .nav-search { display: none; }
  .nav-drop   { display: none; }
  .nav-toggle { display: block; }
  .stat-num   { font-size: 24px; }
  .hero h1    { font-size: 32px; }
  .hero-desc  { font-size: 15px; }
  .hero-actions { flex-direction: column; gap: 10px; }
  .hero-actions .btn { text-align: center; justify-content: center; }
}

/* Mobile nav open */
.navbar.open .nav-links {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: var(--sienna-dark);
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.1);
  z-index: 99;
  gap: 2px;
}
.navbar.open .nav-mobile-only { display: block; }
.navbar.open .nav-links a {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 15px;
}

/* En mobile, el menú hamburger incluye también las páginas de Explorar */
.navbar.open .nav-links::after {
  content: '';
  display: block;
  border-top: 1px solid rgba(255,255,255,.1);
  margin: 8px 0;
}

/* --- Print ---------------------------------------------- */
@media print {
  .navbar, .hero-actions, .footer, .nav-search,
  .nav-toggle, .theme-toggle, .print-btn,
  .nav-drop, .btn { display: none !important; }
  body { background: white; color: black; font-size: 11pt; }
  .section, .section-sm { padding: 12px 0; }
  .page-hd { background: none !important; color: black !important; padding: 0 0 12px; border-bottom: 2pt solid #4A2A18; }
  .page-hd::after { display: none; }
  .page-hd h1, .page-hd-desc { color: black !important; }
  .breadcrumb, .hero, .stats-bar { display: none; }
  .nav-card, .card, .com-card, .prof-card { break-inside: avoid; border: 1pt solid #aaa !important; background: white !important; }
  .data-table { font-size: 9pt; }
  .data-table th { background: #555 !important; color: white !important; -webkit-print-color-adjust: exact; }
  h2, h3 { page-break-after: avoid; }
  @page { margin: 1.5cm; size: A4; }
}

/* ============================================================
   MODO OSCURO
   ============================================================ */
[data-theme="dark"] {
  --bg:          #0C1426;
  --bg-alt:      #0A1020;
  --surface:     #14213F;
  --surface-alt: #0F1A33;
  --border:      #28385C;
  --border-light:#1E2C4A;
  --text:        #E6E8EC;
  --text-2:      #AEB6C6;
  --text-3:      #7C879C;
  --link:        #8FA6E0;
  --gold:        #C9485A;   /* borgoña claro para dark */
  --gold-light:  #E0697A;
  --gold-pale:   #2A1016;
  --sienna:      #6E8BD6;   /* azul claro */
  --sienna-dark: #0A1428;
  --forest:      #8A7263;   /* marrón claro */
}
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4         { color: var(--gold-light); }
[data-theme="dark"] .prof-card-name  { color: var(--gold-light); }
[data-theme="dark"] .prof-card-count { color: var(--text-2); }
[data-theme="dark"] .prof-card img   { background: #0F1A33; }
[data-theme="dark"] .navbar    { background: #0A1428; }
[data-theme="dark"] .stats-bar { background: #0F1A33; }
[data-theme="dark"] .hero      { background: linear-gradient(135deg,#0A1428 0%,#0C1830 55%,#070E1C 100%); }
[data-theme="dark"] .footer    { background: #070E1C; }
[data-theme="dark"] .page-hd  { background: linear-gradient(135deg,#0A1428 0%,#122B67 100%); }
[data-theme="dark"] .alt-section { background: var(--surface-alt); }
[data-theme="dark"] .highlight-box { background: #2A1016; border-color: #7A2230; color: #E0697A; }
[data-theme="dark"] .sources-box  { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .data-table tr:hover td { background: #301E10; }
[data-theme="dark"] .nav-drop-menu { background: #201006; border-color: rgba(255,255,255,.1); }

/* ============================================================
   LANGUAGE SELECTOR
   ============================================================ */
.lang-selector { position: relative; flex-shrink: 0; }
.lang-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  color: #F5E9CE;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background .15s;
  line-height: 1;
}
.lang-btn:hover { background: rgba(255,255,255,.15); }
.lang-globe { font-size: 15px; }
.lang-caret { font-size: 9px; opacity: .7; }
.lang-menu.open + .lang-btn .lang-caret,
.lang-btn[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #2A180A;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  overflow: hidden;
  min-width: 148px;
  z-index: 200;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  display: none;
  flex-direction: column;
}
.lang-menu.open { display: flex; }
.lang-option {
  width: 100%;
  background: none;
  border: none;
  color: #F5E9CE;
  font-size: 14px;
  padding: 10px 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .12s;
}
.lang-option:hover { background: rgba(255,255,255,.1); }
.lang-option.active { color: var(--gold-light, #E0B830); font-weight: 700; }

/* ============================================================
   THEME TOGGLE
   ============================================================ */
.theme-toggle {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  color: #F5E9CE;
  font-size: 15px;
  cursor: pointer;
  padding: 5px 8px;
  transition: background .15s;
  flex-shrink: 0;
  line-height: 1;
}
.theme-toggle:hover { background: rgba(255,255,255,.15); }

.admin-btn {
  background: rgba(181,134,13,.18);
  border: 1px solid rgba(181,134,13,.4);
  border-radius: 6px;
  color: #F5E9CE;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 5px 10px;
  text-decoration: none;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.admin-btn:hover { background: rgba(181,134,13,.32); border-color: rgba(181,134,13,.7); text-decoration: none; color: #F5E9CE; }

/* ============================================================
   DROPDOWN "EXPLORAR"
   ============================================================ */
.nav-drop { position: relative; display: flex; align-items: center; }
.nav-drop-btn {
  background: none;
  border: none;
  color: #D4C4A0;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: var(--sans);
  white-space: nowrap;
}
.nav-drop-btn:hover { background: rgba(255,255,255,.1); color: #F5E9CE; }
.nav-drop-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #2A1A0E;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  min-width: 215px;
  padding: 5px;
  display: none;
  z-index: 200;
}
.nav-drop-menu.open { display: block; }
.nav-drop-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: #D4C4A0;
  font-size: 13.5px;
  border-radius: 5px;
  transition: background .1s, color .1s;
  text-decoration: none;
}
.nav-drop-menu a:hover { background: rgba(255,255,255,.08); color: #F5E9CE; }

/* ============================================================
   GALERÍA / LIGHTBOX
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.gallery-item {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  background: var(--surface);
}
.gallery-item:hover { transform: scale(1.03); box-shadow: var(--shadow-lg); }
.gallery-item img { width: 100%; height: 160px; object-fit: cover; display: block; }
.gallery-item-cap { padding: 8px 10px; font-size: 12px; color: var(--text-2); }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.lightbox-overlay.open { display: flex; }
.lightbox-img { max-width: 90vw; max-height: 80vh; object-fit: contain; border-radius: var(--r); }
.lightbox-cap { color: rgba(255,255,255,.7); font-size: 13px; margin-top: 12px; }
.lightbox-close {
  position: fixed;
  top: 20px; right: 24px;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}
.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }
.lightbox-nav:hover { background: rgba(255,255,255,.2); }

/* ============================================================
   ÁRBOL GENEALÓGICO
   ============================================================ */
.tree-wrap {
  width: 100%;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
}
.tree-tooltip {
  position: fixed;
  background: var(--sienna-dark);
  color: #F5E9CE;
  border: 1px solid var(--gold);
  border-radius: var(--r);
  padding: 10px 14px;
  font-size: 13px;
  pointer-events: none;
  z-index: 300;
  display: none;
  max-width: 240px;
  line-height: 1.5;
}
.tree-tooltip.visible { display: block; }

/* ============================================================
   MAPA
   ============================================================ */
.map-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
.map-svg-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  text-align: center;
}
.map-info-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  position: sticky;
  top: 80px;
}
.map-info-panel h3 { font-size: 16px; margin-bottom: 10px; }
.map-info-panel .info-placeholder { color: var(--text-3); font-size: 13.5px; }

@media (max-width: 860px) {
  .map-wrap { grid-template-columns: 1fr; }
  .map-info-panel { position: static; }
}

/* --- Botón volver arriba --------------------------------- */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sienna);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s, visibility .25s, transform .25s;
  z-index: 500;
}
#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#back-to-top:hover { background: var(--sienna-dark); }

/* Dato reservado (persona viva) — el admin lo ve translúcido; recordatorio de que
   ese dato no es público (Ley 25.326). */
.dato-reservado { opacity: .45; font-style: italic; }
.dato-reservado:hover { opacity: .7; }
