/* ========== VARIABLES ========== */
:root {
  --fondo-claro: #F8F8F8;
  --texto-principal: #1B1D1A;
  --color-primario: #DFBD69;
  --exito: #2ECC71;
  --advertencia: #E74C3C;
  --gris-oscuro: #333333;
  --gris-claro: #E0E0E0;

  --fuente-titular: 'Poppins', 'Montserrat', sans-serif;
  --fuente-base: 'Inter', 'Lato', sans-serif;
}

/* ========== RESETEO GENERAL ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--fuente-base);
  color: var(--texto-principal);
  background-color: var(--fondo-claro);
  line-height: 1.6;
}

/* ========== TIPOGRAFÍA ========== */
h1, h2, h3 {
  font-family: var(--fuente-titular);
  color: var(--texto-principal);
  margin-bottom: 0.5em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* ========== BOTONES Y ENLACES ========== */
a {
  text-decoration: none;
  color: var(--color-primario);
}

a:hover {
  text-decoration: underline;
}

button {
  background-color: var(--color-primario);
  color: #fff;
  padding: 0.5em 1.2em;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* ========== CONTAINERS Y LAYOUT ========== */
.container {
  width: 90%;
  max-width: 1350px;
  margin: auto;
  padding: 2rem 0;
}

section {
  padding: 2rem 0;
}

/* ========== CARDS DE ARTÍCULOS ========== */
.card {
  display: block;
  background: #fff;
  border: 1px solid var(--gris-claro);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.card h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

.card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  margin-bottom: 1rem;
  object-fit: cover;
}

.badge-nuevo {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--color-primario);
  color: var(--texto-principal);
  padding: 0.35em 0.7em;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ========== FOOTER ========== */
.footer {
  background-color: #1B1D1A; /* fondo oscuro de marca */
  color: #f8f8f8;
  padding: 3rem 2rem 2rem;
  font-size: 0.95rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 2rem 1rem;
  gap: 2rem;
}

.footer-col.left {
  flex: 1;
  min-width: 250px;
}

.footer-col.right {
  text-align: right;
  min-width: 200px;
}

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

.footer-col.right ul li {
  margin-bottom: 0.5rem;
}

.footer-col.right ul li a {
  color: #ffffff;
  text-decoration: none;
}

.footer-col.right ul li a:hover {
  text-decoration: underline;
}


.footer-col h3 {
  font-size: 1.3rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.footer-col p {
  line-height: 1.5;
  color: #dddddd;
}

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

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col ul li a {
  text-decoration: none;
  color: #dddddd;
  transition: color 0.2s ease;
}

.footer-col ul li a:hover {
  color: #DFBD69; /* dorado */
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.85rem;
  color: #aaaaaa;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1rem;
}

/* Responsive */
@media (min-width: 768px) {
  .footer-content {
    justify-content: space-between;
    align-items: flex-start;
  }

  .footer-col:first-child {
    flex: 1;
  }

  .footer-col:last-child {
    flex: 0 0 auto;
    text-align: right;
  }
}

@media (max-width: 578px) {
  .footer-col.right {
    text-align: center;
    width: 100%;
  }
}

/* ========== MEDIA QUERIES ========== */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.25rem; }
  .container { width: 95%; }
  .menu-toggle {
    display: block;
    margin-left: auto;
  }
  .header-content { position: relative; }
  .nav-menu {
    display: none;
    flex-direction: column;
    background: #fff;
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    gap: 1rem;
  }
  .nav-menu.open { display: flex; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .nav-menu {
    width: 100%;
    right: 0;
  }
  .nav-menu li { text-align: center; }
  #search-results .result-item {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  #search-results .result-item img {
    width: 100%;
  }
}

#scrollToTop {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  padding: 0;
  z-index: 100;
  background: var(--color-primario);
  border: 1px solid var(--color-primario);
  border-radius: 50%;
  backdrop-filter: blur(6px);
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease;
}

#scrollToTop img {
  width: 24px;
  height: 24px;
}

#scrollToTop:hover {
  background: rgba(223, 189, 105, 0.35);
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 2rem auto;
}

.input-buscador {
  width: 100%;
  padding: 1rem 1rem 1rem 2.5rem;
  border: 2px solid var(--gris-claro);
  border-radius: 999px;
  margin: 2rem auto;
  display: block;
  font-size: 1rem;
  padding-left: 3rem;
  background-color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.icon-search {
  position: absolute;
  top: 50%;
  left: 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  transform: translateY(-50%);
  pointer-events: none;
  color: #666;
}


.input-buscador:focus {
  outline: none;
  border-color: var(--color-primario);
  box-shadow: 0 0 0 3px rgba(223, 189, 105, 0.3);
}

.input-buscador::placeholder {
  color: #999;
}

.intro {
  text-align: center;
}
.intro h2 {
  font-size: 2rem;
}

.highlight {
  color: #DFBD69;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}


.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

#articulos-container {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  #articulos-container {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

#article-list {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  #article-list {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

.ver-todos {
  text-align: center;
  margin-top: 1rem;
}

.ver-todos a {
  background-color: var(--color-primario);
  color: var(--texto-principal);
  padding: 0.5em 1.2em;
  border-radius: 6px;
  font-weight: bold;
  text-decoration: none;
}

.ver-todos a:hover {
  background-color: #c9a850;
}

.card {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
  position: relative;
}
.card:hover {
  transform: translateY(-5px);
}
.card h4 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* === PAGINACIÓN === */
.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination a,
.pagination span {
  padding: 0.4rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #1B1D1A;
  font-size: 0.9rem;
}

.pagination a:hover {
  background-color: #f5f5f5;
}

.pagination .active {
  background-color: #DFBD69;
  border-color: #DFBD69;
  color: #fff;
}

/* === HEADER === */

.header-glass {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.8); /* más visible */
  backdrop-filter: blur(4px);
  border-bottom: 1px solid rgba(185, 185, 185, 0.425);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo elegante */
.logo a {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--fuente-titular);
  color: #1B1D1A;
  text-decoration: none;
}

.logo span {
  color: #DFBD69;
}

/* Botón menú móvil */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #1B1D1A;
}

/* Menú principal */
.nav-menu {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
}

.nav-menu li a {
  position: relative;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  color: #1B1D1A;
  transition: all 0.3s ease;
  padding-bottom: 4px;
}

.nav-menu li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0%;
  background-color: #DFBD69;
  transition: width 0.3s ease;
}

.nav-menu li a:hover {
  color: #DFBD69;
}

.nav-menu li a:hover::after {
  width: 100%;
}

/* 🎯 Estilo general del artículo */
.post-page {
  max-width: 850px;
  margin: 3rem auto;
  padding: 0 1rem;
  font-family: var(--fuente-base);
  color: #1B1D1A;
}

/* 📰 Título y subtítulo */
.post-page h1 {
  font-size: 2.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #1B1D1A;
}
.post-page .subtitulo {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 1rem;
}

/* 📆 Meta info */
.meta {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 2rem;
  border-left: 4px solid #DFBD69;
  padding-left: 1rem;
}

/* 🖼️ Imagen destacada */
#imagen {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* 📝 Contenido */
.post-contenido p {
  line-height: 1.8;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  text-align: justify;
}

.post-page ul {
  margin-left: 1.5rem;
  padding-left: 0;
  list-style: none;
}

.post-page ol {
  margin-left: 1.5rem;
  padding-left: 0;
  list-style: none;
  counter-reset: lista;
}

.post-page ul li {
  position: relative;
  margin-bottom: 0.75rem;
  padding-left: 1.6rem;
  font-size: 1rem;
  line-height: 1.6;
}

.post-page ol li {
  position: relative;
  margin-bottom: 0.75rem;
  padding-left: 1.6rem;
  font-size: 1rem;
  line-height: 1.6;
  counter-increment: lista;
}

.post-page ul li::before {
  content: "•";
  color: #DFBD69; /* dorado */
  font-weight: bold;
  position: absolute;
  left: 0;
  top: 0;
}

.post-page ol li::before {
  content: counter(lista) ".";
  color: #DFBD69;
  font-weight: bold;
  position: absolute;
  left: 0;
  top: 0;
}

.post-page .subtitulo {
  font-size: 1.25rem;
  font-weight: 400;
  color: #3a3a3a;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.post-page .meta {
  font-size: 0.9rem;
  color: #777;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}

.post-page .h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #1b1d1a; /* negro verdoso */
  line-height: 1.4;
}

/* 🔖 Etiquetas */
.etiquetas {
  margin-top: 2rem;
}
.etiquetas .tag {
  display: inline-block;
  margin: 0.25rem;
  background: #DFBD69;
  color: #1B1D1A;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
}


.share-section {
  margin-top: 60px;
  text-align: center;
  margin-bottom: 30px;
}

.share-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 12px;
  color: #1b1d1a;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #f2f2f2;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-share img {
  width: 20px;
  height: 20px;
}

.btn-share:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-share.twitter { background-color: #1da1f2; }
.btn-share.facebook { background-color: #3b5998; }
.btn-share.whatsapp { background-color: #25d366; }

#related-posts {
  background: var(--fondo-claro);
}

#related-posts h3 {
  text-align: center;
}

#related-posts .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}

#related-posts .card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
}

#search-results {
  display: none;
}

#search-results h3 {
  text-align: center;
}

#search-results .results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

#search-results .result-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 4rem;
  align-items: center;
  background-color: var(--fondo-claro);
  border: 1px solid var(--color-primario);
  border-radius: 8px;
  padding: 0.75rem;
  text-decoration: none;
  color: inherit;
}

#search-results .result-item img {
  width: 120px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}

#search-results .result-item h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
}

#search-results .result-item p {
  margin: 0;
  font-size: 0.875rem;
}

.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.article-list article {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.article-list article:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.article-list article img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.article-list article div {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.article-list article h2 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.article-list article h2 a {
  color: #1B1D1A;
  text-decoration: none;
}

.article-list article h2 a:hover {
  text-decoration: underline;
}

.article-list article p {
  color: #444;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.nav-menu a.activo {
  color: #DFBD69; /* dorado */
  font-weight: bold;
  border-bottom: 2px solid #DFBD69;
}


/* === COOKIE BANNER === */
.cookie-banner {
  display: none;
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #1B1D1A;
  color: #fff;
  padding: 1rem;
  text-align: center;
  font-size: 14px;
  z-index: 1000;
}

.cookie-banner button {
  margin-left: 1rem;
  background: #DFBD69;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  color: #1B1D1A;
  font-weight: bold;
}

/* Re-applied mobile menu styles after global nav rules */
@media (max-width: 1250px) {
  .menu-toggle {
    display: block;
    margin-left: auto;
  }
  .header-content { position: relative; }
  .nav-menu {
    display: none;
    flex-direction: column;
    background: #fff;
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    gap: 1rem;
  }
  .nav-menu.open { display: flex; }

}

/* ------ Ajustes adicionales para pantallas pequeñas ------ */
@media (max-width: 480px) {
  .card-grid,
  .article-list,
  #article-list,
  #articulos-container {
    grid-template-columns: repeat(2, 1fr);
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
  }

  .card { padding: 1rem; }

  .post-page h1 { font-size: 1.8rem; }
  .post-page .subtitulo { font-size: 1rem; }
  .post-contenido p { font-size: 1rem; }
  .post-page .meta { font-size: 0.8rem; }
  .article-list article h2 { font-size: 1rem; }
  .article-list article p { font-size: 0.85rem; }
}