/* Sistema visual de InfoTrip: temas, tipografía, navegación y elementos comunes.
   Identidad "cartográfica": neutros carbón, un solo acento (agave), coral para lo seleccionado
   y coordenadas en fuente monoespaciada. Los colores se usan siempre mediante estas variables. */

:root {
  color-scheme: light;
  --fondo: #F4F5F6;
  --panel: #FFFFFF;
  --panel-2: #F4F5F6;
  --panel-3: #E9EBED;
  --linea: #E1E4E7;
  --linea-fuerte: #C5CBD0;
  --texto: #14171A;
  --texto-2: #4A535B;
  --texto-3: #646D75;
  --acento: #0A7564;
  --acento-fuerte: #075E50;
  --acento-suave: #E1F2EE;
  --sobre-acento: #FFFFFF;
  --marca: #D2440C;
  --marca-suave: #FCEDE6;
  --exito: #17643A;
  --exito-suave: #E5F4EB;
  --aviso: #8A5A00;
  --aviso-suave: #FBF1DC;
  --peligro: #B3261E;
  --peligro-suave: #FBE9E7;
  --sombra: 0 1px 2px rgba(20, 23, 26, .06), 0 8px 24px rgba(20, 23, 26, .10);
  --sombra-flotante: 0 2px 6px rgba(20, 23, 26, .10), 0 16px 40px rgba(20, 23, 26, .16);
  --radio-s: 8px;
  --radio: 12px;
  --radio-l: 16px;
  --nav-alto: 60px;
  --fuente: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fuente-mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --filtro-mapa: saturate(.5) contrast(.96) brightness(1.03);
  --filtro-foto: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --fondo: #0D0F11;
  --panel: #15181B;
  --panel-2: #1C2024;
  --panel-3: #262B30;
  --linea: #2A2F34;
  --linea-fuerte: #3D444B;
  --texto: #F2F4F5;
  --texto-2: #B7BEC5;
  --texto-3: #929AA2;
  --acento: #41D1B1;
  --acento-fuerte: #6BE0C6;
  --acento-suave: #10312B;
  --sobre-acento: #05201A;
  --marca: #FF8152;
  --marca-suave: #3A1E13;
  --exito: #5FD38F;
  --exito-suave: #12301F;
  --aviso: #EFC06A;
  --aviso-suave: #33270F;
  --peligro: #FF8A80;
  --peligro-suave: #3A1A18;
  --sombra: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .4);
  --sombra-flotante: 0 2px 6px rgba(0, 0, 0, .5), 0 16px 40px rgba(0, 0, 0, .55);
  --filtro-mapa: invert(1) hue-rotate(185deg) brightness(.92) contrast(.88) saturate(.55);
  --filtro-foto: brightness(.92);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
ul, ol { padding-left: 1.25rem; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.022em; font-weight: 600; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; letter-spacing: -.012em; }
a { color: var(--acento); text-underline-offset: 2px; }
a:hover { color: var(--acento-fuerte); }
small { font-size: .8125rem; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Controles */
button, .boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 40px;
  padding: .45rem .9rem;
  border: 1px solid var(--linea-fuerte);
  border-radius: var(--radio-s);
  background: var(--panel);
  color: var(--texto);
  font: inherit;
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
button:hover:not(:disabled), .boton:hover { background: var(--panel-3); color: var(--texto); }
button:disabled { opacity: .55; cursor: not-allowed; }
button[type="submit"], .boton-primario, .btn-primary {
  border-color: var(--acento);
  background: var(--acento);
  color: var(--sobre-acento);
}
button[type="submit"]:hover:not(:disabled), .boton-primario:hover, .btn-primary:hover {
  border-color: var(--acento-fuerte);
  background: var(--acento-fuerte);
  color: var(--sobre-acento);
}
input, select, textarea {
  width: 100%;
  min-height: 40px;
  padding: .5rem .7rem;
  border: 1px solid var(--linea-fuerte);
  border-radius: var(--radio-s);
  background: var(--panel);
  color: var(--texto);
  font: inherit;
  font-size: .9375rem;
}
input::placeholder, textarea::placeholder { color: var(--texto-3); }
input:focus, select:focus, textarea:focus { border-color: var(--acento); outline: 2px solid var(--acento-suave); outline-offset: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--acento); outline-offset: 0; }
input[type="checkbox"], input[type="radio"] { width: 1.05rem; height: 1.05rem; min-height: 0; padding: 0; accent-color: var(--acento); flex: none; }
label { font-size: .875rem; font-weight: 500; }
summary { cursor: pointer; font-size: .875rem; font-weight: 500; }

/* Navegación */
#navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-alto);
  background: var(--panel);
  border-bottom: 1px solid var(--linea);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
  padding: 0 1.25rem;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--texto);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -.03em;
  text-decoration: none;
}
.logo:hover { color: var(--texto); }
.logo svg { width: 20px; height: 20px; color: var(--marca); }
.nav-links { display: flex; align-items: center; gap: .15rem; flex: 1; padding: 0; list-style: none; }
.nav-links a {
  display: block;
  padding: .4rem .7rem;
  border-radius: var(--radio-s);
  color: var(--texto-2);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
}
.nav-links a:hover { background: var(--panel-3); color: var(--texto); }
.nav-actions { display: flex; align-items: center; gap: .5rem; }
#nav-guest { display: flex; align-items: center; gap: .5rem; }
.btn-ghost, .btn-primary, .btn-logout {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: .35rem .8rem;
  border-radius: var(--radio-s);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
}
.btn-ghost { color: var(--texto); }
.btn-ghost:hover { background: var(--panel-3); color: var(--texto); }
.btn-primary { border: 1px solid var(--acento); }
.nav-divider { display: none; }
.nav-user-wrap { display: none; align-items: center; gap: .6rem; }
.nav-user-wrap > a { color: var(--texto-2); font-size: .875rem; font-weight: 500; text-decoration: none; }
.nav-user-wrap > a:hover { color: var(--texto); }
.user-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--acento-suave);
  color: var(--acento-fuerte);
  font-size: .8125rem;
  font-weight: 600;
}
.user-name {
  max-width: 130px;
  overflow: hidden;
  color: var(--texto);
  font-size: .875rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-logout { background: transparent; border-color: transparent; color: var(--texto-2); min-height: 36px; }
.theme-toggle {
  flex: none;
  width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 0;
  border-color: var(--linea);
  color: var(--texto-2);
}
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icono-sol { display: none; }
[data-theme="dark"] .theme-toggle .icono-sol { display: block; }
[data-theme="dark"] .theme-toggle .icono-luna { display: none; }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
}
.hamburger:hover:not(:disabled) { background: var(--panel-3); }
.hamburger span { display: block; width: 18px; height: 2px; border-radius: 1px; background: var(--texto); transition: transform .15s, opacity .15s; }
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-alto);
  right: 0;
  left: 0;
  z-index: 999;
  flex-direction: column;
  gap: .1rem;
  max-height: calc(100dvh - var(--nav-alto));
  padding: .5rem 1rem 1rem;
  overflow-y: auto;
  background: var(--panel);
  border-bottom: 1px solid var(--linea);
  box-shadow: var(--sombra);
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .5rem .6rem;
  border-radius: var(--radio-s);
  color: var(--texto);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
}
.mobile-menu a:hover { background: var(--panel-3); }
.mobile-menu a.btn-primary { justify-content: center; color: var(--sobre-acento); }
.mobile-menu .sep { height: 1px; margin: .4rem 0; background: var(--linea); }
.mobile-user-info { display: none; align-items: center; gap: .6rem; padding: .5rem .6rem; }

/* Páginas de contenido */
.explore-shell { width: min(1120px, 100%); margin: 0 auto; padding: 1.75rem 1.25rem 1rem; }
.legal-page { max-width: 780px; }
.legal-page > h1 { margin-bottom: .75rem; }
.legal-page > h2 { margin: 1.5rem 0 .4rem; }
.legal-page > p, .legal-page > ul { margin-bottom: .75rem; color: var(--texto-2); }
.legal-page > ul li { margin-bottom: .3rem; }
.account-shell { max-width: 520px; }
.eyebrow {
  display: block;
  margin-bottom: .35rem;
  color: var(--texto-3);
  font-family: var(--fuente-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.back-link {
  display: inline-flex;
  margin-bottom: .75rem;
  color: var(--texto-2);
  font-size: .875rem;
  text-decoration: none;
}
.back-link:hover { color: var(--texto); }
.editorial-note {
  margin: .5rem 0;
  color: var(--texto-3);
  font-size: .8125rem;
}
.empty-catalog {
  padding: 2rem 1.25rem;
  border: 1px dashed var(--linea-fuerte);
  border-radius: var(--radio);
  color: var(--texto-2);
  text-align: center;
}
.empty-catalog h1, .empty-catalog h2 { margin-bottom: .4rem; color: var(--texto); }
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
  color: var(--texto-3);
  font-size: .875rem;
}
.pagination a { font-weight: 500; }
.compact-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-top: 2.5rem;
  padding: 1rem 0 1.5rem;
  border-top: 1px solid var(--linea);
  color: var(--texto-3);
  font-size: .8125rem;
}
.compact-footer a { color: var(--texto-2); }

@media (max-width: 860px) {
  .nav-links, .nav-actions { display: none; }
  .nav-inner { justify-content: space-between; gap: .5rem; padding: 0 .5rem 0 1rem; }
  .logo { margin-right: auto; }
  .hamburger { display: flex; }
  .theme-toggle { width: 44px; min-height: 44px; height: 44px; }
  button, .boton, input:not([type="checkbox"], [type="radio"]), select { min-height: 44px; }
  .explore-shell { padding: 1.25rem 1rem .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
