/* --- Base global --- */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
}

/* --- Contenedor principal centrado --- */
#page {
  max-width: 1020px;
  margin: 0 auto;
  padding: 20px;
}

#header h1 {
  margin-top: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid #333;
  padding-bottom: 10px;
}

/* --- Disposición en dos columnas (Flexbox) --- */
#layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* Columna de lectura principal */
#main {
  flex: 1;
  min-width: 0;
  max-width: 730px;
}

/* Columna lateral de navegación */
#navwrap {
  width: 220px;
  flex-shrink: 0;
}

#nav {
  padding: 12px;
  border: 1px solid #ccc;
  background-color: #fff;
  border-radius: 4px;
}

#nav p {
  margin-top: 0;
  margin-bottom: 6px;
}

#nav ul.subscriptions,
#nav ul.planet-feeds {
  list-style-type: none;
  margin: 0 0 16px 0;
  padding-left: 0;
}

#nav ul.subscriptions li,
#nav ul.planet-feeds li {
  margin-bottom: 4px;
  font-size: 0.88rem;
}

#nav ul.planet-feeds li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.small {
  font-size: 0.85rem;
  color: #555;
}

/* --- MODO CLARO (Títulos en VERDE #00A800, Fuentes en ROJO PURO) --- */

/* 1. Enlaces generales por defecto */
a, 
a:visited,
#nav a,
#nav a:visited {
  text-decoration: none;
  color: #FF0000 !important; /* ROJO PURO #FF0000 */
  font-weight: 400;
}

a:hover,
#nav a:hover {
  text-decoration: underline;
}

/* 2. Títulos de Noticias (Resumen 'Contents' y Cuerpo) */
.contents ol li > a,
.contents ol li > a:visited,
.item-title a,
.item-title a:visited {
  color: #00A800 !important; /* Verde fósforo ajustado a WCAG AA 4.5:1 */
  font-weight: 700;
}

.contents-title {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.item-title {
  font-size: 1.4rem;
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 4px;
}

/* 3. Fuentes / Repositorios / Subscripciones */
.feed-title a,
.feed-title a:visited,
.item-feed-title a,
.item-feed-title a:visited,
#nav ul.subscriptions a,
#nav ul.subscriptions a:visited {
  color: #FF0000 !important; /* ROJO PURO #FF0000 */
  font-weight: 400 !important;
}

/* Metadatos (Autor, Hora y Tiempo en texto plano idéntico) */
.item-meta,
.item-updated,
.item-author {
  font-size: 0.85rem;
  color: #666;
  font-weight: normal;
}

.item-meta {
  margin-bottom: 12px;
}

/* Separadores y fechas */
.new-date {
  border-top: 1px solid #ccc;
  padding: 6px 0;
  margin-top: 30px;
  font-size: 1.2rem;
}

hr.item-seperator {
  border: none;
  background-color: #eee;
  height: 1px;
  margin: 24px 0;
}

.item {
  margin-bottom: 32px;
}

.item-content img {
  max-width: 100%;
  height: auto;
}

/* Adaptabilidad Móvil */
@media (max-width: 768px) {
  #layout {
    flex-direction: column-reverse;
  }
  
  #navwrap {
    width: 100%;
  }
  
  #main {
    max-width: 100%;
  }
}

/* --- MODO OSCURO (Títulos en ROJO PURO, Fuentes en VERDE PURO) --- */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #121212 !important;
    color: #e0e0e0 !important;
  }

  #header h1 {
    border-bottom-color: #444;
  }

  /* Enlaces generales en oscuro */
  a, 
  a:visited,
  #nav a,
  #nav a:visited {
    color: #00FF00 !important; /* VERDE PURO #00FF00 */
    font-weight: 400;
  }

  /* 1. Títulos de Noticias (Resumen y Cuerpo) */
  .contents ol li > a,
  .contents ol li > a:visited,
  .item-title a,
  .item-title a:visited {
    color: #FF0000 !important; /* ROJO PURO #FF0000 */
    font-weight: 700;
  }

  /* 2. Fuentes / Repositorios / Subscripciones */
  .feed-title a,
  .feed-title a:visited,
  .item-feed-title a,
  .item-feed-title a:visited,
  #nav ul.subscriptions a,
  #nav ul.subscriptions a:visited {
    color: #00FF00 !important; /* VERDE PURO #00FF00 */
    font-weight: 400 !important;
  }

  #nav {
    background-color: #1e1e1e !important;
    border-color: #333;
  }

  .small {
    color: #aaa;
  }

  .new-date {
    border-color: #444;
  }

  hr.item-seperator {
    background-color: #333;
  }

  /* Metadatos en modo oscuro */
  .item-meta,
  .item-updated,
  .item-author {
    color: #888;
  }
}