/* ============================================
   NoticiasBlog — Estilos globales
   Fuente: Open Sans | Color corporativo: #e30613
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

/* ---------- Reset básico ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ---------- Variables ---------- */
:root {
  --color-brand: #e30613;
  --color-bg: #ffffff;
  --color-text: #222222;
  --color-link: #e30613;
  --color-menu-bg: #f8f8f8;
  --color-footer-bg: #222222;
  --color-footer-text: #cccccc;
  --font-family: 'Open Sans', sans-serif;
  --font-size-base: 0.901rem;
  --header-height: auto;
  --padding-mobile: 30px;
  --max-width: 1200px;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: opacity 0.2s;
}
a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Contenedor ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   HEADER — sticky
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Primera fila: logo + nombre */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.header-logo img {
  height: 44px;
  width: auto;
}

.header-brand {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-brand);
  letter-spacing: -0.02em;
}

/* Segunda fila: menú de categorías */
.header-nav {
  background: var(--color-menu-bg);
  border-top: 1px solid #eee;
}

.nav-list {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  list-style: none;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0;
}

.nav-sep {
  color: #999;
  font-size: 0.8rem;
  user-select: none;
  padding: 0 2px;
}

.nav-list li a {
  display: block;
  padding: 10px 18px;
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color 0.2s, background 0.2s;
}

.nav-list li a:hover,
.nav-list li a.active {
  color: var(--color-brand);
  background: rgba(227, 6, 19, 0.06);
}

/* Hamburguesa (móvil) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--color-text);
  margin: 4px 0;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ============================================
   BANNER WHATSAPP (responsive image)
   ============================================ */
.whatsapp-banner-link {
  display: block;
  line-height: 0;
}

.whatsapp-banner-link img {
  width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 32px 20px 20px;
  font-size: 0.82rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.footer-left,
.footer-right {
  flex: 1 1 auto;
}

.footer-right {
  text-align: right;
}

.footer-right p {
  margin-bottom: 6px;
  line-height: 1.55;
}

.footer-right a {
  color: var(--color-footer-text);
  text-decoration: underline;
}

.footer-right a:hover {
  color: #ffffff;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
}

.footer-links a {
  color: var(--color-footer-text);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-copy {
  max-width: var(--max-width);
  margin: 20px auto 0;
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid #444;
  color: #888;
  font-size: 0.78rem;
}

/* ============================================
   UTILIDADES
   ============================================ */
/* ============================================
   HOME — Intro + Grid de categorías
   ============================================ */
.home-intro {
  padding-top: 40px;
  padding-bottom: 20px;
}

.home-intro h1 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.35;
  margin-bottom: 20px;
}

.home-intro p {
  margin-bottom: 14px;
  line-height: 1.7;
}

.home-categories {
  padding-top: 10px;
  padding-bottom: 50px;
}

.home-categories h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 28px;
  color: var(--color-text);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.category-card {
  display: block;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  transition: transform 0.2s, box-shadow 0.2s;
  color: var(--color-text);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.category-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.category-card-body {
  padding: 16px 18px 20px;
}

.category-card-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--color-brand);
}

.category-card-body p {
  font-size: 0.84rem;
  line-height: 1.55;
  color: #555;
}

@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .home-intro h1 {
    font-size: 1.3rem;
  }

  .category-card img {
    height: 140px;
  }
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   PÁGINA DE CATEGORÍA
   ============================================ */
.category-hero {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  padding-top: 66px;
  padding-bottom: 28px;
}

.category-hero img {
  width: 340px;
  min-width: 280px;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}

.category-hero-text h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.35;
  margin-bottom: 16px;
}

.category-hero-text p {
  line-height: 1.7;
}

.category-articles {
  padding-bottom: 100px;
}

.category-articles h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--color-text);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.article-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  color: var(--color-text);
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.11);
}

.article-card-img {
  width: 120px;
  min-width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
}

.article-card-content h3 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-brand);
  margin-bottom: 6px;
}

.article-card-content p {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #555;
  margin: 0;
}

.articles-placeholder {
  padding: 24px;
  background: var(--color-menu-bg);
  border-radius: 8px;
  text-align: center;
  color: #888;
  font-style: italic;
}

@media (max-width: 768px) {
  .category-hero {
    flex-direction: column;
  }

  .category-hero img {
    width: 100%;
    min-width: auto;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .article-card-img {
    width: 90px;
    min-width: 90px;
    height: 68px;
  }
}

/* ============================================
   UTILIDADES
   ============================================ */
/* ============================================
   PÁGINA DE ARTÍCULO
   ============================================ */
.article-page {
  padding-top: 36px;
  padding-bottom: 40px;
}

.article-hero h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text);
  margin-bottom: 14px;
}

.article-excerpt {
  font-size: 1rem;
  line-height: 1.65;
  color: #555;
  margin-bottom: 20px;
}

.article-hero-img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #888;
  padding-bottom: 24px;
  border-bottom: 1px solid #eee;
  margin-bottom: 32px;
}

.article-share {
  display: flex;
  gap: 10px;
  align-items: center;
}

.article-share a {
  color: var(--color-brand);
  font-weight: 600;
  font-size: 0.82rem;
}

/* Dos columnas 70-30 */
.article-two-col {
  display: grid;
  grid-template-columns: 70fr 30fr;
  gap: 32px;
  margin-bottom: 36px;
}

.article-main h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 14px;
}

.article-main p {
  line-height: 1.7;
  margin-bottom: 14px;
}

.article-sidebar {
  background: var(--color-menu-bg);
  border-radius: 8px;
  padding: 20px;
}

.article-sidebar h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 14px;
}

.article-sidebar ul {
  list-style: none;
  padding: 0;
}

.article-sidebar ul li {
  margin-bottom: 10px;
}

.article-sidebar ul li a {
  font-size: 0.84rem;
  color: var(--color-brand);
  line-height: 1.45;
}

/* Una sola columna */
.article-full {
  margin-bottom: 36px;
}

.article-full h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 14px;
}

.article-full p {
  line-height: 1.7;
  margin-bottom: 14px;
}

/* Tres columnas finales */
.article-footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid #eee;
}

.article-col h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
}

.article-col p,
.article-col ul,
.article-col li {
  font-size: 0.84rem;
  line-height: 1.6;
  color: #555;
}

.article-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-col li {
  margin-bottom: 6px;
}

.article-col li a {
  color: var(--color-link);
  font-size: 0.82rem;
  font-weight: 400;
  text-decoration: none;
}

.article-col li a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .article-two-col {
    grid-template-columns: 1fr;
  }

  .article-footer-cols {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--padding-mobile);
  }

  .header-top {
    padding: 10px var(--padding-mobile);
  }

  /* Hamburguesa visible */
  .nav-toggle {
    display: block;
  }

  /* Menú colapsado */
  .header-nav .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
  }

  .header-nav .nav-list.open {
    display: flex;
  }

  .nav-sep {
    display: none;
  }

  .nav-list li a {
    padding: 12px var(--padding-mobile);
    border-bottom: 1px solid #eee;
    text-align: left;
  }

  /* Footer en columna */
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-right {
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .header-logo img {
    height: 36px;
  }

  .header-brand {
    font-size: 1.1rem;
  }
}

/* ---------- Enlaces internos en artículos ---------- */
.article-body-link {
  color: #0066cc;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  transition: color 0.2s, opacity 0.2s;
}
.article-body-link:hover {
  color: #004499;
  opacity: 1;
}
.article-internal-links {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
  font-size: 0.92rem;
  color: #444;
}
