/*
Theme Name: Calculadoras DGT Theme
Theme URI: https://tramitesvehiculo.es/
Author: Tu Nombre
Author URI: https://tu-web.com/
Description: Un tema diseñado para ofrecer calculadoras de trámites vehiculares, basado en un diseño HTML/CSS optimizado para SEO.
Version: 1.1.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: one-column, custom-menu, blog, landing-page, responsive-layout
Text Domain: calculadorastheme
*/

/* ── Variables ── */
:root {
  /* Ajusta este valor a la altura real de tu header (mide con DevTools) */
  --header-height: 80px;
}

/* ── Header fijo sólo para el header principal ── */
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
}

/* ── Empujar contenido bajo header fijo ── */
#content {
  padding-top: var(--header-height);
}

/* --- Reset global --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Tipografía base --- */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f8fafc;
  transition: padding-top 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Hero section --- */
.hero {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}
.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
}
.hero-subtitle {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
.hero-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}
.hero-feature {
  background: rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  border-radius: 10px;
  backdrop-filter: blur(10px);
}
.hero-feature h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.hero-feature p {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* --- Secciones generales --- */
.section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #1e40af;
  font-weight: 700;
}
.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: #6b7280;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Tarjetas de calculadoras --- */
.calculadoras-principales {
  padding: 4rem 0;
  background: white;
}
.calculadoras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}
.calculadora-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 15px;
  padding: 2rem;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.calculadora-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #1e40af, #3b82f6);
}
.calculadora-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
  border-color: #3b82f6;
}
.calc-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.calc-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 0.8rem;
}
.calc-description {
  color: #6b7280;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  flex-grow: 1;
}
.calc-cta {
  background: #1e40af;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s;
  align-self: flex-start;
}
.calc-cta:hover {
  background: #1d4ed8;
}

/* --- Sección Blog en portada --- */
.blog-section {
  background: #f1f5f9;
  padding: 6rem 0 4rem;
  margin-top: var(--header-height);
}

/* --- FAQ Section --- */
.faq-section {
  padding: 4rem 0;
  background: white;
}
.faq-item {
  background: #f8fafc;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  border-left: 4px solid #1e40af;
}
.faq-question {
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 0.5rem;
}
.faq-answer {
  color: #6b7280;
  line-height: 1.6;
}

/* --- Footer --- */
footer {
  background: #1f2937;
  color: white;
  padding: 3rem 0 1rem;
}
.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-section h4 {
  margin-bottom: 1rem;
  color: #60a5fa;
}
.footer-section ul {
  list-style: none;
}
.footer-section a {
  color: #d1d5db;
  text-decoration: none;
  padding: 0.3rem 0;
  display: block;
  transition: color 0.3s;
}
.footer-section a:hover {
  color: #60a5fa;
}
.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 2rem;
  text-align: center;
  color: #9ca3af;
}

/* ===================================================================
   Estilos para Blog Index (home.php) y Archive
   =================================================================== */
.blog-index-container {
  padding-top: 4rem;
  padding-bottom: 4rem;
}
.page-header {
  text-align: center;
  margin-bottom: 3rem;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 2rem;
}
.page-title {
  font-size: 2.8rem;
  color: #1e40af;
  margin-bottom: 0.5rem;
}
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2.5rem;
}
.blog-post-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
}
.blog-post-card:hover {
  transform: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07);
}
.post-thumbnail-link img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}
.post-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.blog-post-card .entry-header {
  background-color: #1e40af;
  color: #fff;
  padding: 1.5rem;
}
.blog-post-card .blog-card-title {
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
  line-height: 1.3;
  color: #fff;
}
.blog-post-card .blog-card-title a {
  color: inherit;
  text-decoration: none;
}
.entry-meta {
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #dbeafe;
}
.entry-meta .post-category a {
  background-color: rgba(255,255,255,0.1);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.3);
}
.entry-meta .post-date {
  margin-left: 1rem;
}
.entry-summary {
  flex-grow: 1;
  color: #4b5563;
  padding: 1.5rem;
}
.read-more-link {
  align-self: flex-start;
  background: #1e40af;
  color: white;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  margin: 0 1.5rem 1.5rem;
}
.read-more-link:hover {
  background-color: #1d4ed8;
}

/* ===================================================================
   Estilos para Single Post (single.php)
   =================================================================== */
.single .hero,
.single .calculadoras-principales,
.single .blog-section,
.single .faq-section {
  display: none !important;
}
.article-clean-header {
  background: none;
  padding: 4rem 1rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  border-bottom: 1px solid #e5e7eb;
  margin-top: var(--header-height);
  position: relative;
  z-index: 1;
}
.article-clean-header .entry-title {
  font-size: 2.8rem;
  color: #1e40af;
  margin: 1rem 0 1.5rem;
  line-height: 1.2;
}
.article-clean-header .entry-meta {
  color: #6b7280;
}
.article-clean-header .entry-meta a {
  color: #1f2937;
  font-weight: 600;
}
.post-thumbnail-container {
  max-width: 800px;
  margin: 0 auto 3rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}
.post-thumbnail-container img {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
}
.entry-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.8;
}
.entry-content h2, .entry-content h3, .entry-content h4 {
  color: #1e40af;
  margin: 2.5rem 0 1.5rem;
}

/* ===================================================================
   Related Posts
   =================================================================== */
.related-posts-section {
  max-width: 1000px;
  margin: 3rem auto;
  padding-top: 3rem;
  border-top: 1px solid #e5e7eb;
}
.related-posts-title {
  text-align: center;
  font-size: 2rem;
  color: #1e40af;
  margin-bottom: 2.5rem;
}
.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.related-post-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.related-post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(30,64,175,0.1);
}
.related-post-thumbnail img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.related-post-title {
  font-size: 1.2rem;
  color: #1f2937;
  padding: 1.25rem;
  font-weight: 600;
}

/* ===================================================================
   Custom Logo
   =================================================================== */
.custom-logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
}
.custom-logo-link img {
  height: 40px;
}
.custom-logo-link .site-title-for-logo {
  font-size: 1.5rem;
  font-weight: bold;
}

/* ===================================================================
   Shortcode Última Matrícula
   =================================================================== */
.ultima-matricula-display {
  background-color: #1f2937;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-family: monospace;
  font-size: 1.2rem;
}

/* ===================================================================
   Responsive (móvil)
   =================================================================== */
@media (max-width: 768px) {
  /* Empujar contenido móvil bajo header */
  #content {
    padding-top: var(--header-height);
  }

  /* Hero */
  .hero h1 {
    font-size: 2.2rem;
  }
  .hero-subtitle {
    font-size: 1.1rem;
  }

  /* Grids a 1 columna */
  .calculadoras-grid,
  .blog-grid,
  .posts-grid {
    grid-template-columns: 1fr;
  }

  /* Header nav */
  .header-content {
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
  }
  nav ul {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Artículo (single) */
  .article-clean-header .entry-title {
    font-size: 2rem;
  }
  .post-thumbnail-container img {
    max-height: 250px;
  }

  /* Tabla scrollable */
  .page-content-wrapper > *,
  .single-post-container .entry-content > * {
    width: 100% !important;
    clear: both !important;
    margin: 0 !important;
    max-width: 100% !important;
  }
  .page-content-wrapper figure.wp-block-table,
  .single-post-container .entry-content figure.wp-block-table {
    overflow-x: auto;
    margin: 1.5rem 0;
  }
  .page-content-wrapper table,
  .single-post-container .entry-content table {
    display: block;
    width: 100% !important;
    min-width: auto !important;
  }

  /* Transferencia: siempre visible */
  .transfer-calculator-body,
  .calculator-layout,
  .form-container,
  .results-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 !important;
    padding: 1.5rem !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Ocultar mensaje genérico */
  .no-content-notice,
  .page-content-wrapper > p {
    display: none !important;
  }
}


/* ── Reset del UL del nav ── */
header.site-header nav ul {
  list-style: none;        /* Sin viñetas */
  margin: 0;               /* Sin márgenes por defecto */
  padding: 0;              /* Sin padding por defecto */
  display: flex;           /* Flex para alinearlo en fila */
  gap: 1.5rem;             /* Espacio entre ítems */
  justify-content: center; /* O usa flex-end para alinearlo a la derecha */
  align-items: center;     /* Centrar verticalmente */
}

/* ── Estilo de los LI dentro del nav ── */
header.site-header nav ul li {
  margin: 0;               /* Reiniciamos márgenes */
}

/* ── Estilo de los enlaces del nav ── */
header.site-header nav ul li a {
  color: #ffffff;          /* Enlace blanco */
  text-decoration: none;   /* Sin subrayado */
  font-weight: 500;
  transition: opacity 0.2s;
}

/* ── Hover / foco en los enlaces ── */
header.site-header nav ul li a:hover,
header.site-header nav ul li a:focus {
  opacity: 0.8;
}

/* ── Asegurar que el contenedor del nav ocupa toda la anchura de header ── */
header.site-header .header-content {
  display: flex;
  justify-content: space-between; /* Logo a la izquierda, nav a la derecha */
  align-items: center;
  width: 100%;
}

/* ── En móvil, que no salgan en columna con viñetas ── */
@media (max-width: 768px) {
  header.site-header nav ul {
    flex-direction: row;    /* Sigue en fila */
  }
}

/* ── Estilo más limpio para las tarjetas de blog ── */
.blog-post-card .entry-header {
  background: #ffffff;            /* Fondo blanco en la cabecera */
  color: #1e40af;                 /* Azul primario para texto */
  border-bottom: 2px solid #e5e7eb; /* Línea separadora */
  padding: 1.5rem;
}

.blog-post-card .entry-header .post-category a {
  background: #e5e7eb;            /* Fondo gris suave */
  color: #1e40af;                 /* Azul primario */
  border: none;
}

.blog-post-card .entry-header .post-date {
  color: #6b7280;                 /* Gris medio */
}

.blog-post-card .blog-card-title a {
  color: #1e40af;                 /* Azul primario */
}

.blog-post-card:hover {
  box-shadow: 0 12px 30px rgba(0,0,0,0.05);
}

.blog-post-card .entry-summary {
  background: #ffffff;            /* Asegura fondo blanco en el cuerpo */
  color: #334155;                 /* Gris oscuro para texto */
}

.read-more-link {
  background: #1e40af;            /* Azul primario */
  color: #ffffff;                 /* Blanco */
  border: none;
}
.read-more-link:hover {
  background: #3b82f6;            /* Azul secundario para hover */
}

/* Oculta la línea de autor de los artículos */
.article-clean-header .entry-meta {
  display: none !important;
}

