/* =========================================
   SERVICIOS D&G - ESTILOS DE MARCA
   ========================================= */

:root {
    --color-primary: #0A2647;
    --color-accent: #14B8A6;
    --color-bg-light: #F8FAFC;
    --color-text: #334155;
}

/* HEADER CON LÍNEA VERDE */
.site-header {
  background: white;
  box-shadow: 0 2px 8px rgba(10, 38, 71, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid #14B8A6;  /* ← LÍNEA VERDE */
}

.logo-link img { 
    transition: transform 0.3s ease; 
}

/* LOGO CON EFECTO HOVER */
.logo-link {
  display: inline-block;
  transition: transform 0.3s ease;
}

.logo-link:hover {
  transform: scale(1.05);  /* ← EFECTO HOVER */
}

/* Estilos generales */
body {
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--color-text);
  background-color: var(--color-bg-light);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-primary);
}

a {
  color: var(--color-primary);
}

a:hover {
  color: var(--color-accent);
}

/* =========================================
   ESTILOS PÁGINA "QUIÉNES SOMOS"
   ========================================= */

.about-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ESTADÍSTICAS - GRID CON ESTILO */
.about-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  margin: 4rem 0;
  text-align: center;
}

.stat-item {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 2.5rem 1.5rem;
  border-radius: 12px;
  border-left: 4px solid #14B8A6; /* Verde D&G */
  box-shadow: 0 4px 12px rgba(10, 38, 71, 0.1);
  transition: all 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(10, 38, 71, 0.15);
}

.stat-number {
  display: block;
  font-size: 3.5rem;
  font-weight: 800;
  color: #14B8A6; /* Verde D&G */
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  display: block;
  font-size: 1.1rem;
  color: #0A2647; /* Azul D&G */
  font-weight: 600;
  text-transform: uppercase;
}

/* VALORES - TARJETAS */
.about-values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.value-card {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  border-left: 4px solid #0A2647; /* Azul D&G */
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s;
}

.value-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.value-title {
  color: #0A2647;
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.value-desc {
  color: #64748b;
  line-height: 1.6;
}

/* TEXTO E IMAGEN */
.about-text-image-row {
  display: flex;
  gap: 3rem;
  align-items: center;
  margin: 3rem 0;
}

.about-text-image-row .text-col,
.about-text-image-row .image-col {
  flex: 1;
}

.about-text-image-row img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(10, 38, 71, 0.15);
}

.layout-reverse {
  flex-direction: row-reverse;
}

.about-heading {
  font-size: 2.5rem;
  color: #0A2647;
  margin-bottom: 1.5rem;
  text-align: center;
}

.about-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #334155;
  margin-bottom: 2rem;
}

.about-image-full {
  width: 100%;
  border-radius: 12px;
  margin: 2rem 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .stat-number {
    font-size: 2.5rem;
  }
  
  .about-text-image-row,
  .layout-reverse {
    flex-direction: column;
  }
  
  .about-stats-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* =========================================
   BLOG STYLES
   ========================================= */

.blog-index-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

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

.blog-header h1 {
  font-size: 2.5rem;
  color: #0A2647;
  margin-bottom: 1rem;
}

.blog-intro {
  font-size: 1.2rem;
  color: #64748b;
  max-width: 600px;
  margin: 0 auto;
}

/* Grid de posts */
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.blog-post-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(10, 38, 71, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid #e2e8f0;
}

.blog-post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(10, 38, 71, 0.15);
}

.post-thumbnail,
.post-thumbnail-placeholder {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #0A2647, #14B8A6);
}

.post-thumbnail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: white;
}

.post-content {
  padding: 1.5rem;
}

.post-content h2 {
  margin: 0 0 1rem 0;
  font-size: 1.4rem;
}

.post-content h2 a {
  color: #0A2647;
  text-decoration: none;
}

.post-content h2 a:hover {
  color: #14B8A6;
}

.post-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: #f1f5f9;
  color: #0A2647;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #e2e8f0;
}

.read-more {
  color: #14B8A6;
  font-weight: 600;
  text-decoration: none;
}

.read-more:hover {
  text-decoration: underline;
}

/* Post individual */
.blog-post {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.post-header {
  margin-bottom: 3rem;
  text-align: center;
}

.featured-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: 2.5rem;
  color: #0A2647;
  margin-bottom: 1rem;
}

.post-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #334155;
}

.post-body h2 {
  color: #0A2647;
  margin: 2rem 0 1rem 0;
}

.post-body p {
  margin-bottom: 1.5rem;
}

.post-image {
  max-width: 100%;
  border-radius: 8px;
  margin: 2rem 0;
}

.code-block {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  margin: 1.5rem 0;
}

.markdown-content {
  margin-bottom: 1.5rem;
}

.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #e2e8f0;
}

.back-to-blog {
  color: #14B8A6;
  font-weight: 600;
  text-decoration: none;
}

.no-posts {
  text-align: center;
  font-size: 1.2rem;
  color: #64748b;
  padding: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
  .blog-posts-grid {
    grid-template-columns: 1fr;
  }
  
  .post-header h1 {
    font-size: 2rem;
  }
}

/* =========================================
   FOOTER DEFINITIVO (Forzado)
   ========================================= */

.site-footer {
  background-color: #0A2647 !important; /* Azul Oscuro Forzado */
  color: #ffffff !important;            /* Texto Blanco Forzado */
  padding: 2rem 0 !important;
  margin-top: 4rem;
  border-top: 4px solid #14B8A6 !important; /* ✅ LÍNEA VERDE */
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex !important;
  justify-content: space-between !important; /* Separa Copyright y Wagtail */
  align-items: center !important;
}

.footer-copyright {
  margin: 0;
  color: #cbd5e1 !important;
  font-size: 0.9rem;
}

.wagtail-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #ffffff !important;
  transition: color 0.3s;
  font-weight: 600;
}

.wagtail-link:hover {
  color: #14B8A6 !important; /* Verde al pasar el mouse */
}

.wagtail-icon {
  width: 20px;
  height: 20px;
  fill: currentColor; /* Hereda el color del texto */
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* =========================================
   PÁGINAS ESTÁNDAR (Metodología, Open Source, etc.)
   ========================================= */

.standard-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.page-header {
  margin-bottom: 3rem;
  text-align: center;
}

.page-header h1 {
  font-size: 2.5rem;
  color: #0A2647;
  margin-bottom: 1rem;
}

.page-intro {
  font-size: 1.2rem;
  color: #64748b;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

.page-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #334155;
}

.section-heading {
  font-size: 1.8rem;
  color: #0A2647;
  margin: 3rem 0 1.5rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #14B8A6;
}

.rich-text {
  margin-bottom: 1.5rem;
}

.markdown-content {
  margin-bottom: 2rem;
}

.page-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 2rem 0;
  box-shadow: 0 4px 12px rgba(10, 38, 71, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .standard-page {
    padding: 2rem 1rem;
  }
  
  .page-header h1 {
    font-size: 2rem;
  }
  
  .section-heading {
    font-size: 1.5rem;
  }
}

/* =========================================
   BLOG LAYOUT (Main + Sidebar) - FORZADO
   ========================================= */

.blog-layout {
  display: grid !important;
  grid-template-columns: 2fr 1fr !important; /* 2/3 contenido, 1/3 sidebar */
  gap: 3rem !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 3rem 2rem !important;
}

.blog-main {
  min-width: 0; /* Prevenir desbordamiento */
}

.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

/* Sidebar - Asegurar que esté en la columna correcta */
.blog-sidebar {
  grid-column: 2 / 3 !important; /* Forzar columna 2 */
  position: sticky;
  top: 100px;
  height: fit-content;
}

.sidebar-widget {
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  border: 1px solid #e2e8f0;
}

.widget-title {
  font-size: 1.1rem;
  color: #0A2647;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #14B8A6;
}

.category-list, .recent-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-list li, .recent-posts-list li {
  margin-bottom: 0.75rem;
}

.category-list a, .recent-posts-list a {
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.95rem;
  display: block;
  padding: 0.25rem 0;
}

.category-list a:hover, .recent-posts-list a:hover {
  color: #14B8A6;
  padding-left: 5px;
}

.category-list li.active a {
  color: #14B8A6;
  font-weight: 700;
}

/* Tags - Asegurar que se vean como cápsulas */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tag {
  background: #f1f5f9;
  color: #0A2647;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  display: inline-block;
}

/* Responsive */
@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  
  .blog-sidebar {
    grid-column: 1 / -1 !important;
    position: static !important;
  }
  
  .blog-posts-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   CONTACT PAGE - ESTILOS CORREGIDOS
   ========================================= */

.contact-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.contact-form-wrapper {
  background: #ffffff;
  padding: 3rem;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(10, 38, 71, 0.08);
  border: 1px solid #e2e8f0;
  margin-top: 2rem;
}

/* Forzar estructura vertical en el formulario */
form.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Ocultar el wrapper de ayuda si aparece vacío */
.helptext { display: none; }

/* Estilos para las etiquetas (Labels) */
form.contact-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #0A2647;
  font-size: 0.95rem;
}

/* Forzar inputs y textarea al 100% */
form.contact-form input[type="text"],
form.contact-form input[type="email"],
form.contact-form textarea,
form.contact-form select {
  width: 100% !important;
  padding: 12px 16px !important;
  border: 2px solid #e2e8f0 !important;
  border-radius: 8px !important;
  font-size: 1rem !important;
  background-color: #fff;
  transition: border-color 0.2s ease;
  font-family: inherit;
}

/* Efecto focus */
form.contact-form input:focus,
form.contact-form textarea:focus {
  outline: none;
  border-color: #14B8A6 !important;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1);
}

/* Estilo del Botón de Enviar */
button.btn-submit,
input[type="submit"].btn-submit {
  display: block;
  width: 100% !important;
  padding: 14px 24px !important;
  background-color: #0A2647 !important; /* Azul oscuro corporativo */
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
  text-align: center;
  margin-top: 10px;
}

button.btn-submit:hover {
  background-color: #14B8A6 !important; /* Turquesa al pasar el mouse */
  transform: translateY(-2px);
}

/* Mensaje de error */
.errorlist {
  color: #ef4444;
  list-style: none;
  padding: 0;
  margin: 5px 0;
  font-size: 0.85rem;
}

/* =========================================
   HOME PAGE - LAYOUT CENTRADO
   ========================================= */

.home-wrapper {
  width: 100%;
  overflow-x: hidden;
}

/* Contenedor estándar para todas las secciones */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
  box-sizing: border-box;
}

/* HERO */
.hero-section {
  background: linear-gradient(135deg, #0A2647 0%, #14B8A6 100%);
  color: white;
  padding: 6rem 0;
  text-align: center;
}

.hero-section h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
  opacity: 0.95;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* SERVICIOS */
.services-section {
  padding: 5rem 0;
  background: #f8fafc;
}

.section-title {
  text-align: center;
  font-size: 2.2rem;
  color: #0A2647;
  margin-bottom: 3rem;
  font-weight: 700;
}

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

.service-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(10,38,71,0.06);
  border: 1px solid #e2e8f0;
  transition: transform 0.2s, box-shadow 0.2s;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(10,38,71,0.12);
}

.service-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.service-card h3 { color: #0A2647; font-size: 1.3rem; margin-bottom: 0.75rem; }
.service-card p { color: #64748b; line-height: 1.6; margin-bottom: 1rem; }
.service-features { list-style: none; padding: 0; margin: 0; }
.service-features li { color: #475569; padding: 0.3rem 0; font-size: 0.9rem; }

/* POR QUÉ ELEGIRNOS */
.why-us-section {
  padding: 5rem 0;
  background: white;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  text-align: center;
}

.feature-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.feature-item h4 { color: #0A2647; font-size: 1.15rem; margin-bottom: 0.5rem; }
.feature-item p { color: #64748b; font-size: 0.95rem; }

/* CTA FINAL */
.cta-section {
  padding: 4rem 0;
  background: linear-gradient(135deg, #14B8A6 0%, #0A2647 100%);
  color: white;
  text-align: center;
}

.cta-section h2 { font-size: 2rem; margin-bottom: 0.75rem; }
.cta-section p { font-size: 1.1rem; margin-bottom: 1.5rem; opacity: 0.95; }

/* BOTONES */
.btn-primary {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: white;
  color: #0A2647;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }

.btn-secondary {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: transparent;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  border: 2px solid rgba(255,255,255,0.6);
  transition: all 0.2s;
}
.btn-secondary:hover { background: white; color: #0A2647; border-color: white; }

.btn-large { padding: 1rem 2.5rem; font-size: 1.1rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .container { padding: 0 1.25rem; }
  .hero-section h1 { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .section-title { font-size: 1.8rem; }
  .services-grid, .features-grid { grid-template-columns: 1fr; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .btn-primary, .btn-secondary { width: 100%; max-width: 280px; text-align: center; }
}
