/* === RESET GLOBAL === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'American Typewriter', 'Courier New', Courier, monospace;
  line-height: 1.6;
  background-color: #fff;
  color: #222;
}
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* === HEADER === */
header {
  background-color: #c00000;
  color: #fff;
  padding: 0.5em 1.5em;
  text-align: center;
}

header h1 {
  margin: 0.2em 0;
  font-size: 1.8em;
}

header p {
  margin: 0.1em 0;
  font-size: 1em;
  font-weight: 300;
  letter-spacing: 0.5px;
  text-align: center; /* refuerzo por si acaso */
}

.subtitulo-singularidad {
  font-family: 'Georgia', serif;
  font-size: 0.9em;
  font-style: italic;
  font-weight: bold;
  color: #ffeaea;
  margin: 0.1em 0;
  letter-spacing: 0.3px;
  text-align: center; /* aseguramos centrado también */
}
.cabecera-articulo {
  padding: 1em 1.5em;
  background-color: red;
  color: white;
  text-align: center;
}

/* === NAVBAR === */
nav {
  background-color: #000;
  color: white;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.5em;
}

nav a {
  color: white;
  margin: 0 1em;
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

/* === CONTENEDOR PRINCIPAL === */
.contenedor {
  display: flex;
  flex-direction: row;
  flex: 1;
}

/* === PANEL LATERAL === */


.panel-lateral h2 {
  font-size: 20px;
  margin-bottom: 1em;
  border-bottom: 2px solid #666;
  padding-bottom: 0.5em;
}

.panel-lateral ul {
  list-style: none;
}

.panel-lateral ul li {
  margin-bottom: 10px;
}

.panel-lateral ul li a {
  color: white;
  text-decoration: none;
  padding: 5px 10px;
  display: block;
}

.panel-lateral ul li a:hover {
  background-color: #333;
  color: #ffcccc;
}
/* Listado del panel lateral izquierdo */
.sidebar-lista-izq {
  padding-left: 0;
  padding-right: 0;
  margin: 0;
  text-align: left;
  list-style: none;
}

.sidebar-lista-izq li {
  margin-bottom: 10px;
}

.sidebar-lista-izq li a {
  color: white;
  text-decoration: none;
  padding: 5px 10px;
  display: block;
}

.sidebar-lista-izq li a:hover {
  background-color: #333;
  color: #ffcccc;
}
/* Panel lateral izquierdo y derecho heredan el diseño base */
.panel-lateral-izquierdo,
.panel-lateral-derecho {
  background-color: #111;
  color: white;
  width: 250px;
  padding: 20px;
  flex-shrink: 0;
  border-right: 1px solid #444;
  position: relative;
}
.panel-lateral-izquierdo::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 1000px; /* lo suficiente para que tape cualquier hueco */
  width: 100%;
  background-color: #111;
  z-index: -1;
}
.panel-lateral-izquierdo h2,
.panel-lateral-derecho h2 {
  font-size: 20px;
  margin-bottom: 1em;
  border-bottom: 2px solid #666;
  padding-bottom: 0.5em;
}

.panel-lateral-izquierdo ul,
.panel-lateral-derecho ul {
  list-style: none;
}

.panel-lateral-izquierdo ul li,
.panel-lateral-derecho ul li {
  margin-bottom: 10px;
}

.panel-lateral-izquierdo ul li a,
.panel-lateral-derecho ul li a {
  color: white;
  text-decoration: none;
  padding: 5px 10px;
  display: block;
}

.panel-lateral-izquierdo ul li a:hover,
.panel-lateral-derecho ul li a:hover {
  background-color: #333;
  color: #ffcccc;
}

/* === CONTENIDO PRINCIPAL === */
.contenido-principal {
  flex: 1;
   padding: 2em 6em;
  background-color: #fafafa;
}

.contenido-limitado {
  /*max-width: 900px;*/
  margin: 0 auto;
}

/* === SECCIONES GENERALES === */
/* Espaciado entre párrafos */
p {
 text-align: justify;
  margin-top: 1.2em;  /* espacio antes del párrafo */
  margin-bottom: 1.2em;  /* espacio después del párrafo */
  text-indent: 1.5em;  /* sangría en la primera línea */
  line-height: 1.6;  /* opcional: mejora la legibilidad dentro del párrafo */
}
/* Estilo solo para las listas dentro del contenido principal */
.contenido-principal ul {
  padding-left: 3em;
  padding-right: 1em;
  margin: 1em 0;
  text-align: justify;
  list-style-position: outside;
}

.contenido-principal ul li {
  margin-bottom: 0.8em;
}


/* Espaciado entre títulos y los párrafos */
h2 {
  margin-top: 2em;
  margin-bottom: 1em;
}

/* También puedes aplicar esto a otros encabezados si quieres uniformidad */
h3, h4 {
  margin-top: 1.8em;
  margin-bottom: 0.8em;
}


.destacado {
  background-color: #f4f4f4;
  padding: 1em;
  border-left: 5px solid #c00000;
  margin-bottom: 1.5em;
}

.post-preview {
  border-bottom: 1px solid #ddd;
  margin-bottom: 2em;
  padding-bottom: 1em;
}

.post-preview h3 {
  margin: 0.2em 0;
  color: #c00000;
}

.post-preview a {
  text-decoration: none;
  color: #000;
}

/* === FOOTER === */
footer {
  background-color: #111;
  color: #fff;
  text-align: center;
  padding: 1em;
  font-size: 0.9em;
}

/* === ARTÍCULOS INDIVIDUALES === */
article {
  max-width: 800px;
  margin: auto;
   padding: 0 2em 2em 2em; /* elimina el padding superior */
}

article header {
   text-align: center;
  margin-top: 0;
  margin-bottom: 1em;
}

article h1 {
  margin-top: 0; /* importante */
  color: #c00000;
}

article em {
  color: #555;
}

a.volver {
  display: inline-block;
  margin-top: 2em;
  text-decoration: none;
  color: #c00000;
}

/* === BOTÓN DE ENLACE === */
.boton-enlace {
  display: inline-block;
  background-color: #c00000;
  color: white;
  padding: 0.5em 1em;
  text-decoration: none;
  border-radius: 4px;
  margin-top: 0.5em;
}

.boton-enlace:hover {
  background-color: #a00000;
}

.recurso-formacion {
  background-color: #f9f9f9;
  padding: 1.5em;
  border-radius: 8px;
  margin-bottom: 1em;
}

.navbar {
  background-color: #c00000;
  color: white;
  padding: 1.5em 2em;
  text-align: center;
}

.navbar a {
  color: white;
  margin: 0 1em;
  text-decoration: none;
  font-weight: bold;
}

.navbar a:hover {
  text-decoration: underline;
}

.subtitulo-singularidad {
  font-style: italic;
  font-size: 0.95em;
  margin-bottom: 0.5em;
  color: #ffdddd;
}
/* === DISEÑO EN REJILLA DE PUBLICACIONES === */
.rejilla-publicaciones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2em;
}

/* Asegura que cada post-preview se comporte como una tarjeta */
.post-preview {
  background: white;
  border: 1px solid #ddd;
  padding: 1.2em;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.post-preview:hover {
  transform: scale(1.02);
}
/* === DISEÑO RESPONSIVE === */
@media screen and (max-width: 1024px) {
  .contenedor {
    flex-direction: column;
  }

  .panel-lateral {
    width: 100%;
    padding: 1em;
    border-right: none;
    border-bottom: 1px solid #444;
  }

  .contenido-principal {
    padding: 0.5em;
  }

  nav {
    flex-wrap: wrap;
    gap: 0.5em;
  }

  nav a {
    margin: 0.5em;
  }

  article {
    padding: 0 0.5em 1em 0.5em;
    font-size: 2.4em;
    line-height: 2;
  }

  article h1 {
    font-size: 2.2em;
  }

  article p {
    font-size: 1.3em;
  }
}
@media screen and (max-width: 768px) {
  .panel-lateral-izquierdo {
    display: none;
  }

  .contenido-principal {
    padding: 1em;
  }
}