:root {
  --terracota: #ac6142;
  --terracota-dark: #351f18;
  --crema: #f9f1e6;
  --texto: #3d3d3d;
  --blanco: #ffffff;
  --verde-oliva: #918754;
  --verde-dark: #4a462f;
  --nav-height: 80px;
  --transicion: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Parkinsans', sans-serif;
  background-color: var(--crema);
  color: var(--texto);
  overflow-x: hidden;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Parkinsans', serif;
  font-weight: 600;
  line-height: 1.3;
}

h1 span, h2 span, h3 span {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400 !important;
}

/* --- BARRA DE PROGRESO DE LECTURA --- */
.reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 1001;
}

.reading-progress-bar {
  height: 100%;
  background-color: var(--terracota);
  width: 0%;
  transition: width 0.1s ease-out;
}

/* --- CABECERA --- */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8%;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.3s ease;
}

nav.scrolled {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  max-width: 190px;
  text-decoration: none;
}

.logo img {
  width: 100%;
  height: auto;
  display: block;
}

.btn-volver {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--verde-oliva);
  color: var(--blanco);
  padding: 10px 22px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(145, 135, 84, 0.25);
}

.btn-volver:hover {
  background-color: var(--verde-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(74, 70, 47, 0.35);
}

.icon-arrow-left {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.btn-volver:hover .icon-arrow-left {
  transform: translateX(-3px);
}

/* --- CABECERA DEL BLOG Y FILTROS --- */
.blog-header {
  padding: calc(var(--nav-height) + 4rem) 8% 2.5rem 8%;
  text-align: center;
}

.blog-header-content {
  max-width: 780px;
  margin: 0 auto;
}

.blog-subtitle {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--verde-oliva);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.blog-header h1 {
  font-size: 2.6rem;
  color: var(--terracota);
  margin-bottom: 1rem;
}

.blog-header p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--texto);
  margin-bottom: 2.5rem;
  opacity: 0.9;
}

/* Filtros tipo píldora (Pill Filters) */
.filter-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1rem;
}

.filter-btn {
  background-color: var(--blanco);
  color: var(--texto);
  border: 1px solid rgba(172, 97, 66, 0.2);
  padding: 10px 22px;
  border-radius: 50px;
  font-family: 'Parkinsans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.filter-btn:hover {
  border-color: var(--terracota);
  color: var(--terracota);
  transform: translateY(-2px);
}

.filter-btn.active {
  background-color: var(--terracota);
  color: var(--blanco);
  border-color: var(--terracota);
  box-shadow: 0 6px 15px rgba(172, 97, 66, 0.3);
}

/* --- CUADRÍCULA DE ARTÍCULOS --- */
.blog-main {
  padding: 1rem 8% 5rem 8%;
  flex: 1;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Tarjeta de Artículo */
.blog-card {
  background-color: var(--blanco);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(172, 97, 66, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.3s ease;
  animation: fadeInCard 0.45s ease forwards;
}

.blog-card.oculto {
  display: none;
}

@keyframes fadeInCard {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 18px 40px rgba(53, 31, 24, 0.09);
}

/* Imagen de la tarjeta */
.card-img-wrapper {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background-color: #eae0d5;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.blog-card:hover .card-img-wrapper img {
  transform: scale(1.08);
}

/* Etiqueta flotante sobre foto */
.card-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  color: var(--terracota-dark);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* Contenido de la tarjeta */
.card-content {
  padding: 1.5rem 1.8rem 1.8rem 1.8rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Bloque de autora */
.card-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e2ddd7;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
}

.author-name {
  font-size: 0.88rem;
  color: #666666;
  font-weight: 400;
}

.card-content h2 {
  font-size: 1.25rem;
  color: var(--terracota-dark);
  margin-bottom: 0.9rem;
  line-height: 1.35;
  transition: color 0.3s ease;
}

.blog-card:hover .card-content h2 {
  color: var(--terracota);
}

.card-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: 1.8rem;
  flex-grow: 1;
}

/* Botón CTA Leer más */
.btn-card-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  color: var(--terracota);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 18px;
  border-radius: 50px;
  border: 1.5px solid var(--terracota);
  transition: all 0.3s ease;
}

.btn-card-more svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.btn-card-more:hover {
  background-color: var(--terracota);
  color: var(--blanco);
}

.btn-card-more:hover svg {
  transform: translateX(4px);
}


/* ==========================================================================
   ESTILOS EDITORIALES PARA PÁGINA DE ARTÍCULO INDIVIDUAL
   ========================================================================== */

/* --- MIGAS DE PAN (BREADCRUMBS) --- */
.breadcrumb-bar {
  margin-top: var(--nav-height);
  background-color: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(172, 97, 66, 0.12);
  padding: 14px 8%;
}

.breadcrumb-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
}

.breadcrumb-link {
  color: var(--verde-dark);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.25s ease;
}

.breadcrumb-link:hover {
  color: var(--terracota);
}

.breadcrumb-sep {
  color: rgba(61, 61, 61, 0.35);
  font-weight: 400;
}

.breadcrumb-current {
  color: var(--terracota);
  font-weight: 600;
}

/* --- CONTENEDOR EDITORIAL PRINCIPAL --- */
.article-main {
  padding: 3.5rem 8% 4rem 8%;
  flex: 1;
}

.editorial-article {
  max-width: 900px;
  margin: 0 auto;
  background-color: var(--blanco);
  border-radius: 32px;
  padding: 4rem 5.5rem;
  box-shadow: 0 15px 45px rgba(53, 31, 24, 0.04);
  border: 1px solid rgba(172, 97, 66, 0.08);
}

/* Cabecera del artículo */
.article-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.8rem auto;
}

.article-category-tag {
  display: inline-block;
  background-color: var(--crema);
  color: var(--terracota);
  border: 1px solid rgba(172, 97, 66, 0.25);
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.2rem;
}

.article-header h1 {
  font-size: 2.65rem;
  color: var(--terracota-dark);
  line-height: 1.22;
  margin-bottom: 1.4rem;
}

.article-standfirst {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  line-height: 1.55;
  color: #5a524c;
  font-style: italic;
  margin-bottom: 2rem;
}

/* Firma superior (Byline) */
.article-byline {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding-top: 1.4rem;
  border-top: 1px solid #e9e2d8;
  text-align: left;
}

.byline-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--crema);
}

.byline-info {
  display: flex;
  flex-direction: column;
}

.byline-author {
  font-size: 0.92rem;
  color: var(--terracota-dark);
}

.byline-meta {
  font-size: 0.8rem;
  color: #777;
}

/* Imagen principal editorial */
.article-hero-figure {
  margin: 0 -2rem 3rem -2rem;
}

.article-hero-img-box {
  border-radius: 22px;
  overflow: hidden;
  max-height: 460px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.07);
}

.article-hero-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-hero-figure figcaption {
  text-align: center;
  font-size: 0.82rem;
  color: var(--verde-oliva);
  margin-top: 12px;
  font-style: italic;
}

/* Cuerpo de lectura del artículo */
.article-body {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--texto);
}

.article-body p {
  margin-bottom: 1.6rem;
}

/* Letra capitular (Drop Cap) en el primer párrafo */
.dropcap-paragraph::first-letter {
  float: left;
  font-family: 'Playfair Display', serif;
  font-size: 4.2rem;
  line-height: 0.85;
  padding-top: 4px;
  padding-right: 14px;
  padding-bottom: 4px;
  color: var(--terracota);
  font-weight: 700;
}

.article-body h2 {
  font-size: 1.7rem;
  color: var(--terracota-dark);
  margin: 3rem 0 1.2rem 0;
  line-height: 1.3;
}

.article-body strong {
  color: var(--terracota-dark);
  font-weight: 600;
}

/* Cita destacada editorial (Pull Quote) */
.editorial-quote {
  margin: 2.8rem 0;
  padding: 2rem 2.4rem;
  background-color: var(--crema);
  border-left: 4px solid var(--terracota);
  border-radius: 0 20px 20px 0;
  position: relative;
}

.editorial-quote p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.45;
  color: var(--terracota-dark);
  margin: 0;
}

/* Caja de conclusión / Nota práctica */
.editorial-callout {
  background-color: rgba(145, 135, 84, 0.12);
  border: 1px solid rgba(145, 135, 84, 0.3);
  border-radius: 20px;
  padding: 2rem 2.2rem;
  margin: 2.5rem 0;
}

.editorial-callout h3 {
  font-size: 1.15rem;
  color: var(--verde-dark);
  margin-bottom: 0.6rem;
}

.editorial-callout p {
  font-size: 0.98rem;
  line-height: 1.65;
  margin: 0;
  color: var(--texto);
}

/* Tarjetas numeradas de señales */
.editorial-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 2rem 0 2.8rem 0;
}

.step-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background-color: var(--crema);
  padding: 1.6rem 1.8rem;
  border-radius: 18px;
  border: 1px solid rgba(172, 97, 66, 0.12);
  transition: transform 0.3s ease;
}

.step-card:hover {
  transform: translateX(6px);
}

.step-num {
  font-size: 2rem;
  font-weight: 600;
  color: var(--terracota);
  line-height: 1;
  flex-shrink: 0;
}

.step-text h3 {
  font-size: 1.12rem;
  color: var(--terracota-dark);
  margin-bottom: 0.4rem;
}

.step-text p {
  font-size: 0.96rem;
  line-height: 1.6;
  margin: 0;
  color: #555;
}

/* Lista con viñetas personalizadas */
.editorial-list {
  list-style: none;
  margin: 1.5rem 0 2.2rem 0;
  padding: 0;
}

.editorial-list li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 1.1rem;
  font-size: 1.02rem;
  line-height: 1.7;
}

.editorial-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--verde-oliva);
}

/* Caja de firma de autora al pie del post */
.article-author-box {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid #e6dfd5;
  display: flex;
  align-items: center;
  gap: 22px;
}

.author-box-img {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.author-box-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--verde-oliva);
  font-weight: 600;
}

.author-box-content h3 {
  font-size: 1.2rem;
  color: var(--terracota-dark);
  margin: 2px 0 6px 0;
}

.author-box-content p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #666;
  margin: 0;
}

/* Artículos relacionados */
.related-articles {
  max-width: 900px;
  margin: 4.5rem auto 0 auto;
}

.related-header {
  text-align: center;
  margin-bottom: 2.2rem;
}

.related-header h2 {
  font-size: 1.9rem;
  color: var(--terracota-dark);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}


/* --- BANNER INTERMEDIO DE CONVERSIÓN --- */
.blog-cta-banner {
  padding: 0 8% 5rem 8%;
}

.cta-box {
  max-width: 1000px;
  margin: 0 auto;
  background-color: var(--verde-oliva);
  color: var(--blanco);
  padding: 3.5rem 2.5rem;
  border-radius: 30px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(145, 135, 84, 0.25);
}

.cta-box h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--blanco);
}

.cta-box p {
  font-size: 1.05rem;
  max-width: 650px;
  margin: 0 auto 2rem auto;
  line-height: 1.6;
  opacity: 0.95;
}

.btn-cta-blog {
  display: inline-block;
  background-color: var(--blanco);
  color: var(--verde-dark);
  padding: 15px 34px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.btn-cta-blog:hover {
  background-color: var(--terracota);
  color: var(--blanco);
  transform: translateY(-3px);
}

/* --- FOOTER BÁSICO --- */
.footer-legal {
  background-color: var(--verde-dark);
  padding: 3rem 8%;
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.85rem;
}

.footer-contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto 1.5rem auto;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.contact-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.contact-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: 0.3s;
  display: flex;
  align-items: center;
}

.contact-link:hover {
  color: var(--terracota);
}

.contact-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.phone-text {
  font-size: 0.9rem;
  font-weight: 500;
}

.mini-logo {
  height: 37px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.85;
  transition: 0.3s;
}

.mini-logo:hover {
  opacity: 1;
}

.footer-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 1.5rem auto;
  width: 100%;
  max-width: 1100px;
}

/* --- BOTÓN FLOTANTE VOLVER ARRIBA (FAB / BACK TO TOP) --- */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--terracota);
  color: var(--blanco);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(53, 31, 24, 0.25);
  z-index: 9999;
  opacity: 1;
  visibility: visible;
  transition: all 0.35s ease;
}

.back-to-top svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.back-to-top:hover {
  background-color: var(--verde-dark);
  box-shadow: 0 8px 25px rgba(53, 31, 24, 0.35);
  transform: translateY(-3px);
}

.back-to-top:hover svg {
  transform: translateY(-3px);
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 1024px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .editorial-article {
    padding: 3rem 3rem;
  }

  .article-hero-figure {
    margin: 0 0 2.5rem 0;
  }
}

@media (max-width: 680px) {
  nav {
    padding: 0 5%;
  }

  .logo {
    max-width: 145px;
  }

  .btn-volver {
    padding: 8px 16px;
    font-size: 0.82rem;
  }

  .breadcrumb-bar {
    padding: 12px 5%;
  }

  .breadcrumb-container {
    font-size: 0.78rem;
    gap: 7px;
  }

  .blog-header {
    padding: calc(var(--nav-height) + 2.5rem) 5% 2rem 5%;
  }

  .blog-header h1 {
    font-size: 2rem;
  }

  .blog-header p {
    font-size: 1rem;
    margin-bottom: 1.8rem;
  }

  .filter-container {
    gap: 8px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 0.82rem;
  }

  .blog-main {
    padding: 1rem 5% 4rem 5%;
  }

  .blog-grid,
  .related-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Ajustes responsive del artículo editorial */
  .article-main {
    padding: 1.8rem 4% 3rem 4%;
  }

  .editorial-article {
    padding: 2.2rem 1.4rem;
    border-radius: 24px;
  }

  .article-header h1 {
    font-size: 1.85rem;
  }

  .article-standfirst {
    font-size: 1.1rem;
  }

  .article-body {
    font-size: 1rem;
    line-height: 1.75;
  }

  .article-body h2 {
    font-size: 1.4rem;
    margin: 2.2rem 0 1rem 0;
  }

  .editorial-quote {
    padding: 1.5rem 1.4rem;
  }

  .editorial-quote p {
    font-size: 1.15rem;
  }

  .step-card {
    flex-direction: column;
    gap: 8px;
    padding: 1.3rem 1.4rem;
  }

  .article-author-box {
    flex-direction: column;
    text-align: center;
  }

  .blog-cta-banner {
    padding: 0 5% 4rem 5%;
  }

  .cta-box {
    padding: 2.5rem 1.5rem;
  }

  .cta-box h2 {
    font-size: 1.6rem;
  }

  .footer-contact-row {
    justify-content: center;
    gap: 2rem;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .logo {
    max-width: none !important;
  }

  .logo img.logo-img {
    content: url("../img/logo_cc_mini.png");
    width: 130px !important;
    max-width: none !important;
    height: auto !important;
  }
}