/* === Estilos globales === */
:root {
  --bg: #ffffff;
  --text: #333333;
  --link: #0056b3;
  --link-hover: #003f7f;
  --header-bg: #f8f9fa;
  --main-width: 1100px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --text: #e0e0e0;
    --link: #66aaff;
    --link-hover: #339dff;
    --header-bg: #1e1e1e;
  }
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  word-break: break-word;
}
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  line-height: 1.6;
  padding: 0 1rem;
  overflow-x: hidden;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}
h1, h2, h3 {
  margin: 1rem 0 0.5rem 0;
}
p {
  margin: 0.5rem 0 1rem 0;
}
ul, ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}
figure {
  margin: 1.5rem 0;
  text-align: center;
}

    figure img {
      max-width: 400px;
      height: auto;
      display: block;
      margin: 0 auto;
    }

figcaption {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
}
iframe {
  border: none;
  margin: 1rem 0;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
footer {
  text-align: center;
  padding: 2rem 0 1rem;
  font-size: 0.9rem;
  color: #888;
  border-top: 1px solid #ddd;
  margin-top: 2rem;
}

/* === HEADER NUEVO === */
header {
  background: linear-gradient(90deg, #3142fa 0%, #00c6fb 100%);
  color: white;
  padding: 1rem;
  border-radius: 0 0 1.2rem 1.2rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 3px 20px rgba(50,60,140,0.07);
  overflow-x: hidden;
}

.header-contenedor {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
}

.logo {
  font-size: clamp(1.2rem, 5vw, 2rem);
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  letter-spacing: 1px;
  padding: 0.2rem 1rem;
  border-radius: 2rem;
  transition: background 0.18s;
}
.logo:hover {
  cursor: pointer;
}

.menu-toggle {
  font-size: 2rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.5rem 1rem;
  display: none;
}

nav {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 6px rgba(60,80,200,0.04);
  border-radius: 0 0 1rem 1rem;
  overflow: hidden;
}

.categorias {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0.75rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.categorias li {
  margin: 0;
}

.categorias a {
  text-decoration: none;
  color: #3142fa;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 1.2rem;
  transition: background .18s;
  white-space: nowrap;
}

.categorias a:hover,
.categorias a:focus {
  background: #e7ecfa;
  color: #00178a;
}

    .adsense {
      text-align: center;
      margin: 2rem auto;
      padding: 1rem;
      background: #f9f9f9;
      border: 1px dashed #ccc;
      border-radius: 0.5rem;
    }

/* RESPONSIVE NAV */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    position: absolute;
    right: 1rem;
    top: 1rem;
    z-index: 1000;
  }
  nav {
    display: none;
  }
  nav.active {
    display: block;
  }
  .categorias {
    flex-direction: column;
    align-items: center;
  }
}

@media (prefers-color-scheme: dark) {
  header {
    background: linear-gradient(90deg, #0d163e 0%, #005f7b 100%);
    color: #e3e7f1;
  }
  nav {
    background: #141724;
    border-bottom: 1px solid #353a4d;
    box-shadow: 0 2px 12px rgba(15,18,48,0.08);
  }
  .categorias a {
    color: #7aa5ff;
  }
  .categorias a:hover,
  .categorias a:focus {
    background: #242e51;
    color: #b5d2ff;
  }
}

/* Botones para compartir */
.compartir {
  margin-top: 2rem;
  text-align: center;
}
.compartir h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.compartir a {
  display: inline-block;
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #f0f4ff;
  color: #0033a0;
  border-radius: 1rem;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
}
.compartir a:hover {
  background-color: #e1eaff;
  color: #001b70;
}
@media (prefers-color-scheme: dark) {
  .compartir a {
    background-color: #1f2a48;
    color: #9dc1ff;
  }
  .compartir a:hover {
    background-color: #273a5c;
    color: #d3e4ff;
  }
}

/* ESTRUCTURA */

.contenedor-principal {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 2rem;
}

.contenido {
  max-width: 700px;
  flex: 1;
}

.sidebar {
  width: 300px;
}

@media (max-width: 768px) {
  .contenedor-principal {
    flex-direction: column;
  }

  .sidebar {
    display: none;
  }
}
