/* Blog - título, subrayado, descripción, búsqueda, tarjetas */
:root {
  --blog-ink: #313131;
  --blog-muted: rgba(49, 49, 49, 0.72);
  --blog-border: #E4E4E4;
  --blog-accent: #313131;
  --blog-accent-light: #313131;
}

/* Modo claro: fondo y cards blancos; navbar blanco (como en Servicios) */
.blog-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 5rem 2rem 4rem;
  background: #FAFAFA;
  color: var(--blog-ink);
}

.blog-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #FAFAFA;
}

/* Navbar blanco en modo claro solo en Blog */
html:not([data-theme="dark"]) body.page-blog .navbar,
html:not([data-theme="dark"]) body.page-blog .navbar.scrolled {
  background: #FAFAFA;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid #E4E4E4;
}

html:not([data-theme="dark"]) body.page-blog .navbar.scrolled .logo {
  color: #313131;
}

html:not([data-theme="dark"]) body.page-blog .navbar.scrolled .logo-img {
  filter: brightness(0) invert(1) !important; /* Logo blanco siempre en responsive */
}

html:not([data-theme="dark"]) body.page-blog .navbar.scrolled .nav-links a,
html:not([data-theme="dark"]) body.page-blog .navbar.scrolled .nav-dropdown-toggle {
  color: #313131;
}

html:not([data-theme="dark"]) body.page-blog .navbar.scrolled .nav-dropdown-menu {
  background: #FAFAFA;
  border: 1px solid #E4E4E4;
}

html:not([data-theme="dark"]) body.page-blog .navbar.scrolled .nav-dropdown-menu a {
  color: #313131;
}

html:not([data-theme="dark"]) body.page-blog .navbar.scrolled .nav-dropdown-menu a:hover {
  background: rgba(0, 0, 0, 0.06);
}

html:not([data-theme="dark"]) body.page-blog .navbar.scrolled .nav-theme-btn {
  color: #313131;
  background: #F4F0EF;
}

html:not([data-theme="dark"]) body.page-blog .navbar.scrolled .nav-theme-btn:hover {
  background: rgba(0, 0, 0, 0.12);
}

.blog-section {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1400px; /* Mismo ancho que las secciones del home */
  margin: 0 auto;
  padding: 0 2rem; /* Mismo padding que las secciones del home */
}

.blog-wrap {
  width: 100%;
}

.blog-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.blog-title {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem); /* Mismo tamaño que otros títulos */
  font-weight: 700;
  letter-spacing: -0.02em; /* Mismo letter-spacing que otros títulos */
  color: var(--blog-ink);
  margin: 2rem 0 0.5rem; /* Margin-top agregado */
  text-transform: lowercase; /* Mismo estilo que otros títulos */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); /* Mismo sombreado */
}
.blog-title::first-letter {
  text-transform: uppercase;
}

.blog-title-underline {
  display: block;
  width: 56px; /* Mismo ancho que contacto */
  height: 4px;
  margin: 0 auto 1.25rem; /* Mismo margen que contacto */
  background: var(--geo-military-green); /* Mismo color verde que contacto */
  border-radius: 2px;
}

.blog-desc {
  font-size: 1.1rem; /* Mismo tamaño que los párrafos */
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none; /* Sin mayúsculas */
  color: var(--blog-muted);
  margin: 0 auto;
  max-width: 800px; /* Limitar ancho para mejor legibilidad */
  text-align: center; /* Centrado */
  line-height: 1.7; /* Mismo line-height que los párrafos */
}

.blog-search-form {
  display: flex;
  align-items: center;
  max-width: 560px;
  margin: 0 auto 3rem;
  background: #F4F0EF;
  border: 1px solid var(--blog-border);
  border-radius: 999px;
  overflow: hidden;
}

.blog-search-input {
  flex: 1;
  padding: 0.875rem 1.5rem;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: var(--blog-ink);
  outline: none;
}

.blog-search-input::placeholder {
  color: var(--blog-muted);
}

.blog-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 4px;
  border: 2px solid var(--geo-military-green);
  background: transparent;
  color: var(--geo-military-green);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.blog-search-btn:hover {
  background: var(--geo-military-green-hover-bg);
  transform: scale(1.05);
}

.blog-search-icon {
  width: 20px;
  height: 20px;
}

.blog-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3 cards por fila */
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  justify-items: center;
}

.blog-card {
  background: rgba(15, 20, 25, 0.95); /* Fondo más opaco sin transparencia */
  border: 1px solid rgba(255, 255, 255, 0.2); /* Mismo borde que cards de proyectos */
  border-radius: 16px; /* Mismo border-radius que cards de proyectos */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 380px;
}

.blog-card-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: block;
}

.blog-card-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  color: #fff; /* Texto blanco para cards transparentes oscuras */
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.blog-card-title::first-letter {
  text-transform: uppercase;
}

.blog-card-intro {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85); /* Texto blanco con opacidad para cards transparentes oscuras */
  line-height: 1.5;
  margin: 0 0 1rem;
  flex: 1;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.blog-card-intro::first-letter {
  text-transform: uppercase;
}

.blog-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff !important; /* Texto blanco forzado */
  text-decoration: none;
  margin-left: auto;
}

.blog-card-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.4); /* Borde blanco */
  border-radius: 50%;
  color: #fff; /* Flecha blanca */
}

.blog-card-link-icon svg {
  width: 14px;
  height: 14px;
  color: #fff !important; /* Asegurar que la flecha sea blanca */
  fill: currentColor;
  stroke: currentColor;
}

/* Dark mode: misma tonalidad que cards de proyectos */
[data-theme="dark"] .blog-card {
  background: rgba(15, 20, 25, 0.95); /* Fondo más opaco sin transparencia */
  border-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 1200px) {
  .blog-cards {
    grid-template-columns: repeat(3, 1fr); /* 3 cards en pantallas medianas */
    gap: 1.5rem;
    max-width: 1000px;
  }
}

@media (max-width: 900px) {
  .blog-cards {
    grid-template-columns: repeat(2, 1fr); /* 2 cards en tablets */
    gap: 1.5rem;
  }
}

@media (max-width: 600px) {
  .blog-cards {
    grid-template-columns: 1fr; /* 1 card en móvil */
    gap: 1.5rem;
  }
}

@media (max-width: 1100px) {
  .blog-section {
    width: 100%;
    max-width: 100%;
    padding: 0 2rem;
  }
}

@media (max-width: 560px) {
  .blog-page {
    padding: 4.5rem 1rem 3rem;
  }

  .blog-section {
    padding: 0 1rem;
  }

  .blog-header {
    margin-bottom: 1.75rem;
  }

  .blog-search-form {
    margin-bottom: 2rem;
  }
}

/* Dark mode: línea del título igual que contacto */
[data-theme="dark"] .blog-title-underline {
  background: rgba(255, 255, 255, 0.4);
}

/* ========== BLOG DETALLE ========== */
.blog-detail-page {
  position: relative;
  min-height: 100vh;
  padding: 7.5rem 2rem 4rem;
  background: #313131;
  color: rgba(255, 255, 255, 0.92);
}

.blog-detail-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #313131;
}

.blog-detail-article {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.blog-detail-container {
  width: 100%;
}

.blog-detail-header {
  margin-bottom: 3rem;
}

.blog-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: color 0.2s ease;
}

.blog-detail-back:hover {
  color: #fff;
}

.blog-detail-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
  margin: 0 0 1rem;
  text-transform: lowercase;
}

.blog-detail-title::first-letter {
  text-transform: uppercase;
}

.blog-detail-meta {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 1rem;
}

.blog-detail-content {
  font-size: 1.1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
}

.blog-detail-intro {
  font-size: 1.2rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 3rem;
  font-weight: 400;
}

.blog-detail-section {
  margin-bottom: 2.5rem;
}

.blog-detail-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 1rem;
  text-transform: lowercase;
  letter-spacing: -0.01em;
}

.blog-detail-section-title::first-letter {
  text-transform: uppercase;
}

.blog-detail-section p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.7;
}

.blog-detail-conclusion {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-detail-conclusion p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.blog-detail-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-detail-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.blog-detail-back-link:hover {
  color: #fff;
}

@media (max-width: 900px) {
  .blog-detail-page {
    padding: 6rem 1.5rem 3rem;
  }

  .blog-detail-title {
    font-size: 1.75rem;
  }

  .blog-detail-intro {
    font-size: 1.1rem;
  }

  .blog-detail-section-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 600px) {
  .blog-detail-page {
    padding: 5rem 1rem 2rem;
  }
}