/* ===== CONSTITUCIÓN PÚBLICA - ESTILOS MEJORADOS ===== */

:root {
  /* Paleta de colores CaseGo */
  --bg: #e6e6e6; /* MOSS */
  --card: #ffffff;
  --ink: #1a1c23; /* EERIE BLACK */
  --muted: #3a465c; /* CHARCOAL */
  --primary: #d44007; /* SIPNOSIA */
  --primary-ink: #ffffff;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --border: #e6e6e6; /* MOSS */
  --highlight: #f7d8cb; /* Tono claro de SIPNOSIA */
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  /* Espaciado */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  
  /* Bordes */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* Reset y base */
* {
  box-sizing: border-box;
}

body {
  font-family: "helvetica-neue-lt-pro", "Helvetica Neue", Helvetica, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
}

/* Header responsive mejorado */
header {
  background: var(--card);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
  gap: var(--space-md);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand::before {
  content: "⚖️";
  font-size: 1.5rem;
}

.search-container {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
  min-width: 300px;
}

/* Container principal responsive */
.container {
  display: flex;
  gap: 0;
  align-items: flex-start;
  padding: var(--space-lg);
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 80px);
}

/* Navegación responsive mejorada */
nav {
  width: 350px;
  min-width: 250px;
  max-width: 600px;
  background: var(--card);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-height: calc(100vh - 140px);
  overflow: auto;
  box-shadow: var(--shadow);
  position: sticky;
  top: 100px;
  flex-shrink: 0;
  transition: width 0.2s ease;
}

/* Resizer - Divisor arrastrable */
.resizer {
  width: 8px;
  min-width: 8px;
  background: #d1d5db;
  cursor: col-resize;
  flex-shrink: 0;
  position: relative;
  margin: 0;
  border-radius: 0;
  transition: background 0.2s ease, width 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  z-index: 10;
  align-self: stretch;
  min-height: 400px;
}

.resizer:hover {
  background: var(--primary);
  width: 10px;
}

.resizer:active {
  background: var(--primary);
  width: 10px;
}

.resizer::before {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  top: 0;
  bottom: 0;
  cursor: col-resize;
  z-index: 1;
}

main {
  flex: 1;
  min-width: 300px;
  background: var(--card);
  padding: var(--space-xl);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  min-height: 400px;
  box-shadow: var(--shadow);
  transition: width 0.2s ease;
}

/* Elementos de navegación mejorados */
.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--border);
}

.nav-title {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
}

.nav-close {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-close:hover {
  background: var(--highlight);
  color: var(--primary);
}

/* Acordeón completamente reescrito */
.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-sm);
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.accordion-item:hover {
  box-shadow: var(--shadow-lg);
}

.accordion-header {
  background: #f8fafc;
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
  border-bottom: 1px solid transparent;
}

.accordion-header:hover {
  background: var(--highlight);
}

.accordion-header.active {
  background: var(--highlight);
  border-bottom-color: var(--primary);
}

.accordion-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  flex: 1;
}

.accordion-description {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: var(--space-xs);
  line-height: 1.4;
}

.accordion-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--muted);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accordion-toggle:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--primary);
}

.accordion-toggle.rotated {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.accordion-content.open {
  padding: var(--space-md) var(--space-lg);
  max-height: 2000px;
}

/* Niveles de acordeón */
.accordion-level-1 .accordion-header {
  background: #f9f3f1;
  font-size: 1.1rem;
  font-weight: 700;
}

.accordion-level-2 .accordion-header {
  background: #f5e9e6;
  font-size: 1rem;
  font-weight: 600;
}

.accordion-level-3 .accordion-header {
  background: #e5e4e5;
  font-size: 0.95rem;
  font-weight: 500;
}

/* Artículos con mejor espaciado */
.article {
  margin-bottom: var(--space-xl);
  padding: var(--space-xl);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.article:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.article h3 {
  margin: 0 0 var(--space-lg) 0;
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.article-title {
  flex: 1;
  min-width: 200px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.article-description {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: var(--space-sm);
  line-height: 1.5;
  padding: var(--space-md);
  background: #f8fafc;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--primary);
}

.badge {
  background: var(--primary);
  color: #fff;
  padding: var(--space-xs) var(--space-sm);
  border-radius: 999px;
  font-size: 0.75rem;
  flex-shrink: 0;
  font-weight: 600;
  min-width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Navegación de artículos mejorada */
.nav-articles {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.nav-articles a {
  display: block;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background: var(--card);
}

.nav-articles a:hover {
  background: var(--highlight);
  border-color: var(--primary);
  transform: translateX(5px);
  box-shadow: var(--shadow);
}

.nav-articles a:last-child {
  margin-bottom: 0;
}

/* Botones y formularios mejorados */
.btn {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  text-decoration: none;
  min-height: 36px;
}

.btn:hover {
  background: var(--highlight);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: #b83806; /* Tono más oscuro de SIPNOSIA */
  border-color: #b83806;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px -2px rgba(212, 64, 7, 0.3);
}

.btn-primary:active {
  background: #9c2f05; /* Tono aún más oscuro para click */
  border-color: #9c2f05;
  transform: translateY(0);
}

form.toolbar {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
}

input[type=text], select {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid #cbd5e0;
  border-radius: var(--radius-md);
  min-width: 200px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

input[type=text]:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Barra de resultados mejorada */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* Botón móvil mejorado */
.mobile-nav-toggle {
  display: none;
  background: var(--primary);
  color: white;
  border: none;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.mobile-nav-toggle:hover {
  background: #b83806; /* Tono más oscuro de SIPNOSIA */
  transform: scale(1.05);
}

/* Overlay para móvil */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  backdrop-filter: blur(2px);
}

.mobile-overlay.show {
  display: block;
}

/* Utilidades */
.small {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Mensajes y estados */
#messages {
  margin-bottom: var(--space-lg);
}

/* Animaciones mejoradas */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

/* Responsive design completamente reescrito */
@media (max-width: 1024px) {
  .container {
    gap: var(--space-md);
    padding: var(--space-md);
  }
  
  nav {
    width: 300px;
  }
  
  main {
    padding: var(--space-lg);
  }
}

@media (max-width: 900px) {
  .container {
    flex-direction: column;
    padding: var(--space-sm);
    gap: var(--space-sm);
  }
  
  .resizer {
    display: none;
  }
  
  nav {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
    max-height: none;
    order: 2;
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 101;
    background: var(--card);
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-radius: 0;
    box-shadow: none;
  }
  
  nav.show {
    display: block;
    transform: translateX(0);
  }
  
  main {
    order: 1;
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }
  
  .mobile-nav-toggle {
    display: flex;
  }
  
  .mobile-overlay {
    display: none;
  }
  
  .mobile-overlay.show {
    display: block;
  }
  
  header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
    padding: var(--space-md);
  }
  
  .search-container {
    justify-content: stretch;
  }
  
  form.toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }
  
  input[type=text], select {
    width: 100%;
    min-width: auto;
  }
  
  .btn {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-size: 1rem;
  }
  
  .results-bar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }
  
  .article h3 {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  
  .article-title {
    min-width: auto;
  }
  
  .article {
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
  }
  
  .accordion-header {
    padding: var(--space-sm) var(--space-md);
  }
  
  .accordion-content.open {
    padding: var(--space-sm) var(--space-md);
  }
  
  .nav-close {
    display: flex;
  }
  
  .nav-header {
    position: sticky;
    top: 0;
    background: var(--card);
    padding: var(--space-md);
    margin: calc(-1 * var(--space-lg)) calc(-1 * var(--space-lg)) var(--space-lg) calc(-1 * var(--space-lg));
    border-bottom: 2px solid var(--border);
    z-index: 10;
  }
  
  .nav-title {
    font-size: 1.2rem;
    color: var(--primary);
  }
  
  .nav-close {
    font-size: 2rem;
    color: var(--primary);
    padding: var(--space-sm);
  }
}

@media (max-width: 600px) {
  .container {
    padding: var(--space-xs);
  }
  
  main {
    padding: var(--space-sm);
  }
  
  nav {
    padding: var(--space-md);
  }
  
  header {
    padding: var(--space-sm);
  }
  
  .brand {
    font-size: 1rem;
  }
  
  .accordion-header {
    padding: var(--space-sm);
  }
  
  .accordion-content.open {
    padding: var(--space-sm);
  }
  
  .article {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }
  
  .article h3 {
    font-size: 1rem;
  }
  
  .badge {
    font-size: 0.8rem;
    padding: var(--space-xs) var(--space-sm);
  }
  
  .btn {
    padding: var(--space-sm);
    font-size: 0.95rem;
  }
  
  input[type=text], select {
    padding: var(--space-sm);
    font-size: 0.95rem;
  }
  
  .search-container {
    min-width: auto;
  }
}

/* Para pantallas muy pequeñas */
@media (max-width: 400px) {
  .container {
    padding: var(--space-xs);
  }
  
  main {
    padding: var(--space-xs);
  }
  
  nav {
    padding: var(--space-sm);
  }
  
  header {
    padding: var(--space-xs);
  }
  
  .brand {
    font-size: 0.9rem;
  }
  
  .nav-title {
    font-size: 1.1rem;
  }
  
  .accordion-header {
    padding: var(--space-xs);
  }
  
  .accordion-content.open {
    padding: var(--space-xs);
  }
  
  .article {
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
  }
  
  .btn {
    padding: var(--space-xs);
    font-size: 0.9rem;
  }
  
  input[type=text], select {
    padding: var(--space-xs);
    font-size: 0.9rem;
  }
  
  .nav-articles a {
    padding: var(--space-sm);
  }
}

/* Mejoras de accesibilidad */
.btn:focus,
input:focus,
select:focus,
.accordion-toggle:focus,
.accordion-header:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Estados de carga */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--primary);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Estilos para contenido HTML del editor */
.article {
  font-family: "Helvetica Neue", Helvetica, sans-serif !important;
}

.article p {
  margin: 0 0 1rem 0;
  line-height: 1.7;
  font-family: "Helvetica Neue", Helvetica, sans-serif;
}

.article p:last-child {
  margin-bottom: 0;
}

.article strong, .article b {
  font-weight: 600;
  color: var(--ink);
}

.article em, .article i {
  font-style: italic;
}

.article u {
  text-decoration: underline;
}

.article ul, .article ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.article li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.article a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.article a:hover {
  border-bottom-color: var(--primary);
}

.article blockquote {
  margin: 1rem 0;
  padding: 1rem;
  background: #f8fafc;
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
}

.article h1, .article h2, .article h3, .article h4, .article h5, .article h6 {
  margin: 1.5rem 0 1rem 0;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.article h1 { font-size: 1.5rem; }
.article h2 { font-size: 1.3rem; }
.article h3 { font-size: 1.2rem; }
.article h4 { font-size: 1.1rem; }
.article h5 { font-size: 1rem; }
.article h6 { font-size: 0.9rem; }

.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.article th, .article td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.article th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--ink);
}

.article tr:last-child td {
  border-bottom: none;
}

.article tr:hover {
  background: #f8fafc;
}

/* Alineaciones de texto */
.article .text-left { text-align: left; }
.article .text-center { text-align: center; }
.article .text-right { text-align: right; }
.article .text-justify { text-align: justify; }

/* ===== REEMPLAZO DE COMIC SANS MS POR EDU AU VIC WA NT HAND ===== */
/* Solo reemplazar Comic Sans MS por Edu AU VIC WA NT Hand - el resto usa Helvetica por defecto */
.article *[style*="comic sans ms"],
.article *[style*="Comic Sans MS"],
.article *[style*="comic-sans-ms"],
.article *[style*="Comic-Sans-MS"],
.article *[style*="comicsansms"],
.article *[style*="ComicSansMS"] {
  font-family: "Edu AU VIC WA NT Hand", cursive !important;
}

/* ===== MODO HORIZONTAL (LANDSCAPE) EN MÓVILES ===== */
@media (max-width: 900px) and (orientation: landscape) {
  /* Header compacto en modo horizontal */
  header {
    padding: var(--space-xs) var(--space-md);
    min-height: 50px;
    transition: transform 0.3s ease;
  }
  
  header img {
    height: auto;
    width: 100px;
  }
  
  .brand {
    font-size: 0.95rem;
  }
  
  .mobile-nav-toggle {
    min-width: 36px;
    min-height: 36px;
    font-size: 1rem;
    padding: var(--space-xs);
  }
  
  /* Container optimizado */
  .container {
    padding: var(--space-sm);
    gap: var(--space-sm);
    min-height: calc(100vh - 60px);
  }
  
  /* Main content más compacto */
  main {
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }
  
  /* Navegación optimizada */
  nav {
    padding: var(--space-md);
  }
  
  .nav-header {
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
  }
  
  .nav-title {
    font-size: 1.1rem;
  }
  
  .nav-close {
    font-size: 1.5rem;
    padding: var(--space-xs);
  }
  
  /* Acordeones más compactos */
  .accordion-item {
    margin-bottom: var(--space-xs);
  }
  
  .accordion-header {
    padding: var(--space-sm) var(--space-md);
  }
  
  .accordion-title {
    font-size: 0.9rem;
  }
  
  .accordion-description {
    font-size: 0.75rem;
  }
  
  .accordion-toggle {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }
  
  .accordion-content.open {
    padding: var(--space-sm) var(--space-md);
  }
  
  /* Artículos compactos */
  .article {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }
  
  .article h3 {
    font-size: 1.1rem;
    margin-bottom: var(--space-md);
  }
  
  .article-title {
    font-size: 1.1rem;
  }
  
  .article-description {
    font-size: 0.85rem;
    padding: var(--space-sm);
  }
  
  /* Badges más pequeños */
  .badge {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
  
  /* Botones y formularios compactos */
  .btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.85rem;
    min-height: 32px;
  }
  
  input[type=text], select {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.85rem;
  }
  
  form.toolbar {
    gap: var(--space-xs);
  }
  
  /* Barra de resultados compacta */
  .results-bar {
    padding: var(--space-sm);
    font-size: 0.85rem;
  }
  
  /* Search container optimizado */
  .search-container {
    gap: var(--space-xs);
    min-width: 250px;
  }
  
  /* Navegación de artículos */
  .nav-articles a {
    padding: var(--space-sm);
    font-size: 0.85rem;
  }
  
  /* Small text aún más pequeño */
  .small {
    font-size: 0.8rem;
  }
}

/* ===== MODO HORIZONTAL ESPECÍFICO PARA MÓVILES PEQUEÑOS ===== */
@media (max-height: 450px) and (orientation: landscape) {
  /* Header ultra compacto */
  header {
    padding: 4px var(--space-sm);
    min-height: 40px;
  }
  
  header img {
    width: 80px;
  }
  
  .brand {
    font-size: 0.85rem;
  }
  
  .mobile-nav-toggle {
    min-width: 32px;
    min-height: 32px;
    font-size: 0.9rem;
  }
  
  /* Container super compacto */
  .container {
    padding: var(--space-xs);
    min-height: calc(100vh - 45px);
  }
  
  /* Main ultra compacto */
  main {
    padding: var(--space-sm);
  }
  
  /* Navegación muy compacta */
  nav {
    padding: var(--space-sm);
  }
  
  .nav-header {
    padding: var(--space-xs) var(--space-sm);
    margin-bottom: var(--space-sm);
  }
  
  .nav-title {
    font-size: 1rem;
  }
  
  .nav-close {
    font-size: 1.3rem;
  }
  
  /* Acordeones ultra compactos */
  .accordion-item {
    margin-bottom: 4px;
  }
  
  .accordion-header {
    padding: var(--space-xs) var(--space-sm);
  }
  
  .accordion-title {
    font-size: 0.85rem;
  }
  
  .accordion-description {
    font-size: 0.7rem;
    margin-top: 2px;
  }
  
  .accordion-toggle {
    width: 24px;
    height: 24px;
    font-size: 0.9rem;
  }
  
  .accordion-content.open {
    padding: var(--space-xs) var(--space-sm);
  }
  
  /* Artículos muy compactos */
  .article {
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
  }
  
  .article h3 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
  }
  
  .article-title {
    font-size: 1rem;
  }
  
  .article-description {
    font-size: 0.75rem;
    padding: var(--space-xs);
  }
  
  .article p {
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
    font-size: 0.9rem;
  }
  
  /* Badges ultra pequeños */
  .badge {
    font-size: 0.65rem;
    padding: 2px 6px;
  }
  
  /* Botones muy compactos */
  .btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    min-height: 28px;
  }
  
  input[type=text], select {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
  
  /* Search container muy compacto */
  .search-container {
    min-width: 200px;
  }
  
  /* Navegación de artículos compacta */
  .nav-articles a {
    padding: var(--space-xs);
    font-size: 0.75rem;
  }
  
  /* Small text ultra pequeño */
  .small {
    font-size: 0.75rem;
  }
  
  /* Barra de resultados muy compacta */
  .results-bar {
    padding: var(--space-xs);
    font-size: 0.75rem;
  }
}

/* ===== AUTO-HIDE HEADER EN MODO HORIZONTAL ===== */
@media (max-width: 900px) and (orientation: landscape) {
  /* Clase para cuando el header está oculto */
  body.header-hidden header {
    transform: translateY(-100%);
  }
  
  /* Indicador visual cuando el header está oculto */
  body.header-hidden::before {
    content: "⬆️ Desliza arriba para ver el menú";
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(212, 64, 7, 0.95);
    color: white;
    padding: 4px 12px;
    font-size: 0.7rem;
    border-radius: 0 0 8px 8px;
    z-index: 1000;
    animation: fadeInDown 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
  }
  
  @keyframes fadeInDown {
    from {
      opacity: 0;
      transform: translateX(-50%) translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
  }
  
  /* Ocultar el indicador gradualmente */
  body.header-hidden.hide-indicator::before {
    animation: fadeOutUp 0.5s ease forwards;
  }
  
  @keyframes fadeOutUp {
    from {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
    to {
      opacity: 0;
      transform: translateX(-50%) translateY(-10px);
    }
  }
}

/* Print styles */
@media print {
  header,
  nav,
  .btn,
  .mobile-nav-toggle,
  .mobile-overlay {
    display: none;
  }
  
  .container {
    flex-direction: column;
    padding: 0;
  }
  
  main {
    box-shadow: none;
    border: none;
    padding: 0;
  }
  
  .article {
    box-shadow: none;
    border: 1px solid #000;
    break-inside: avoid;
  }
  
  body {
    background: white;
    font-size: 12pt;
  }
}

