/* =====================
RESET Y BASE
===================== */
* {
 margin: 0;
 padding: 0;
 box-sizing: border-box;
}

html {
 scroll-behavior: smooth; 
}

body {
 font-family: Arial, sans-serif;
 line-height: 1.6;
 color: #1a1a1a;
 overflow-x: hidden; 
}

h1, h2, h3, h4 {
 line-height: 1.25;
}

.container {
 width: 90%;
 max-width: 1100px;
 margin: auto;
}

.related-tools ul{
 margin-top:10px;
 padding-left:20px;
}

.related-tools li{
 margin-bottom:8px;
}

main a, .author-info-home a {
 color: #0d1b2a;
 font-weight: 600;
 text-decoration: underline;
 text-decoration-color: #f4a261; 
 text-decoration-thickness: 2px;
 text-underline-offset: 3px; 
 transition: all 0.2s ease;
}

main a:hover, .author-info-home a:hover {
 text-decoration-color: #0d1b2a;
 color: #f4a261;
}

/* =====================
HEADER
===================== */
.header {
 background: #0d1b2a;
 padding: 15px 0;
 position: relative;
}

.header-container {
 display: flex;
 justify-content: space-between;
 align-items: center;
}
.logo {
 display: flex;
 align-items: center;
 text-decoration: none;
}

.logo img {
 margin-right: 10px;
 display: block;
}

.logo-text {
 color: white;
 font-weight: bold;
 text-decoration: none;
}

.menu-toggle {
 display: none;
 font-size: 28px;
 cursor: pointer;
 color: white;
}

nav a {
 color: white;
 margin-left: 20px;
 text-decoration: none;
 font-weight: 500;
}

.nav-cta {
 background: #f4a261;
 padding: 8px 14px;
 border-radius: 5px;
}

/* =====================
HERO (GENERAL)
===================== */
.hero {
 padding: 60px 0;
}

.hero-content {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 40px;
}

.hero-text h1 {
 font-size: 2.2rem;
 margin-bottom: 15px;
 line-height: 1.2; 
}

.hero-buttons {
 margin-top: 20px;
 display: flex;
 gap: 10px;
}

.btn-primary {
 background: #0d1b2a;
 color: white;
 padding: 12px 20px;
 text-decoration: none;
 border-radius: 6px;
 border: none;
 cursor: pointer;
 display: inline-block;
 text-align: center;
 font-weight: bold;
}

.btn-secondary {
 background: #e0e0e0;
 padding: 12px 20px;
 text-decoration: none;
 border-radius: 6px;
 color: #333;
 border: none;
 cursor: pointer;
 display: inline-block;
 text-align: center;
 font-weight: bold;
}

.hero-image img {
 max-width: 100%;
 height: auto;
}

/* FIX UX: AJUSTES ESPECÍFICOS PARA EL HERO DE LA HOME */
.home-hero .hero-left-col {
 width: 50%;
}
.home-hero .hero-image {
 width: 50%;
 text-align: right;
}

/* =====================
BREADCRUMB
===================== */
.breadcrumb {
 font-size: 14px;
 margin: 12px auto 0 auto;
 color: #555;
}

.breadcrumb a {
 color: #0d1b2a;
 text-decoration: none;
}

.breadcrumb a:hover {
 text-decoration: underline;
}

.breadcrumb + h1,
.breadcrumb + section h1 {
 margin-top: 0px;
}

.breadcrumb + .hero {
 padding-top: 20px;
}

/* =====================
FEATURES (PÁGINAS PILAR)
===================== */
.features {
 display: flex;
 gap: 30px;
 padding: 60px 0;
}

.hero + .features {
 padding-top: 20px;
}

.card-link {
 text-decoration: none;
 color: inherit;
 display: block; 
 width: 100%;
 flex: 1;
}

.card {
 padding: 25px 20px;
 border: 1px solid #e2e8f0;
 text-align: center;
 border-radius: 12px;
 transition: all 0.3s ease;
 background: #ffffff;
 height: 100%;
 width: 100%;
 box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.card:hover {
 transform: translateY(-5px);
 box-shadow: 0 12px 20px rgba(0,0,0,0.08);
 border-color: #cbd5e1;
}

/* =====================
ESTILOS ESPECÍFICOS DE LA HOME (DIRECTORIO)
===================== */
.home-features {
   display: grid;
   grid-template-columns: repeat(3, 1fr);
   gap: 30px;
   padding: 60px 0;
}

.home-features .card {
   display: flex;
   flex-direction: column;
   padding: 30px 25px;
}

.home-features .card img {
   width: 140px;
   height: auto;
   margin: 0 auto 20px auto;
   display: block;
   transition: transform 0.3s ease;
}

.home-features .card:hover img {
   transform: scale(1.05);
}

.home-features .card > p {
   color: #555;
   font-size: 0.95rem;
   margin-bottom: 25px;
   flex-grow: 1;
}

.home-features .card h2 a {
   color: #0d1b2a;
   text-decoration: none; 
   transition: color 0.2s ease;
}
.home-features .card h2 a:hover {
   color: #f4a261; 
}

.card-links {
   list-style: none;
   padding: 0;
   text-align: left;
   border-top: 1px solid #f1f5f9;
   padding-top: 20px;
}

.card-links li {
   margin-bottom: 12px;
}

.card-links a {
   text-decoration: none; 
   color: #333;
   font-weight: 500;
   display: flex;
   align-items: center;
   font-size: 0.95rem;
   transition: color 0.2s ease;
}

.card-links a::before {
   content: "▸";
   color: #f4a261;
   margin-right: 8px;
   font-size: 1.2rem;
}

.card-links a:hover {
   color: #0d1b2a;
   text-decoration: underline;
   text-decoration-color: #f4a261;
}

/* =====================
CAJA E-E-A-T (AUTOR) PARA LA HOME
===================== */
.author-box-home {
   background: #f8fafc;
   border: 1px solid #e2e8f0;
   border-radius: 12px;
   padding: 30px;
   display: flex;
   align-items: center;
   gap: 25px;
   margin: 60px auto;
   max-width: 900px;
   box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.author-avatar-home {
   width: 80px;
   height: 80px;
   background-color: #0d1b2a;
   color: white;
   border-radius: 50%;
   display: flex;
   justify-content: center;
   align-items: center;
   font-size: 2rem;
   font-weight: bold;
   flex-shrink: 0;
}

.author-info-home h3 {
   margin: 0 0 8px 0;
   color: #0d1b2a;
   font-size: 1.3rem;
}

.author-info-home p {
   margin: 0;
   font-size: 1.05rem;
   color: #555;
}

/* =====================
CTA INTERMEDIO Y WHY
===================== */
.cta-intermedio {
 background: #f1f5f9;
 text-align: center;
 padding: 60px 0;
}

.cta-intermedio a {
 display: inline-block;
 margin-top: 20px;
}

.why {
 display: flex;
 align-items: center;
 justify-content: space-between;
 padding: 60px 0;
 gap: 40px;
}

.why-text ul {
 margin-top: 15px;
}

.why-text li {
 margin-bottom: 8px;
}

.why-image img {
 width: 130px;
 height: auto;
}

/* =====================
FOOTER
===================== */
footer {
 background: #0d1b2a;
 color: white;
 text-align: center;
 padding: 30px 0;
}

.footer-links{
 display:flex;
 gap:20px;
 justify-content:center;
 margin-top:10px;
 font-size:0.9rem;
}

.footer-links a{
 color:#666;
 text-decoration:none;
}

.footer-links a:hover{
 text-decoration:underline;
}

/* =====================
CALCULADORA Y CONTENIDO SEO
===================== */
.herramienta-header {
 text-align: center;
 margin: 40px auto 20px auto;
 max-width: 800px;
}

.herramienta-header h1 {
 line-height: 1.2;
 margin-bottom: 10px;
 color: #0d1b2a;
}

.calculadora-box {
 max-width: 500px; 
 margin: 0 auto 50px auto; 
 background: #ffffff;
 padding: 25px;
 border-radius: 8px;
 border: 1px solid #ddd;
 box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
}

.calculadora-box .form-group {
 margin-bottom: 18px;
 text-align: left;
}

.calculadora-box label {
 display: block;
 margin-bottom: 6px;
 font-weight: 600;
}

.calculadora-box input[type="number"] {
 width: 100%;
 padding: 10px;
 font-size: 15px;
 border: 1px solid #ddd;
 border-radius: 5px;
}

.calculadora-box button {
 width: 100%;
 margin-top: 15px;
}

.contenido-seo {
 max-width: 800px; 
 margin: 0 auto 60px auto; 
}

.contenido-seo h2 {
 margin-top: 40px;
 margin-bottom: 15px;
 color: #0d1b2a;
}

.contenido-seo h3 {
 margin-top: 35px;
 margin-bottom: 15px;
 color: #1a1a1a;
 font-size: 1.35rem;
}

.contenido-seo p {
 margin-bottom: 16px;
}

.contenido-seo ul:not(.caja-enlaces ul) {
 padding-left: 20px;
 margin-bottom: 20px;
}

.contenido-seo li {
 margin-bottom: 8px;
}

/* =====================
COMPONENTES NUEVOS: RESULTADOS, GRÁFICAS, FAQs Y SILOS
===================== */
#resultado {
 margin-top: 20px;
 display: flex;
 flex-direction: column;
 gap: 12px;
}

.resultado-card {
 background: #f4f4f4;
 padding: 15px;
 border-radius: 8px;
 text-align: center;
 box-shadow: 0 4px 8px rgba(0,0,0,0.05);
 font-weight: 600;
}

.resultado-card strong {
 font-size: 1.2rem;
 color: #0d1b2a;
}

#graficoContainer {
 margin-top: 30px;
 padding: 15px;
 background: #ffffff;
 border-radius: 8px;
 border: 1px solid #e2e8f0;
 display: none; 
}

.caja-estilo {
 background: #f8fafc; 
 padding: 15px 18px;
 border-radius: 8px;
 margin-bottom: 15px;
 border: 1px solid #e2e8f0;
}

/* Variante blanca para cajas de artículos */
.caja-articulos {
 background: #ffffff;
 border: 1px solid #e2e8f0;
}

/* Ajustes acordeón dentro de cajas de artículos */
.caja-articulos .miniarticulo details:hover {
 background: transparent;
 border-color: #e2e8f0;
}

.caja-articulos .miniarticulo details[open] {
 background: transparent;
}

/* FIX: quitar espacio extra en acordeón de guías */
.caja-articulos .faq-seo {
 margin-top: 10px;
}

/* Opcional: un pelín más de aire */
.caja-articulos ul li {
 margin-bottom: 10px;
}

/* Opcional: títulos ligeramente más destacados */
.caja-articulos h3 {
 font-size: 1.2rem;
}

/* =====================
CAJA ARTÍCULOS HOME (alineada con layout)
===================== */
.caja-home-articulos {
 max-width: 100%;
 margin: 0 auto;
 padding: 20px 25px;
}

.caja-home-articulos h3 {
 font-size: 1.3rem;
}

.faq-seo { 
 margin-top: 40px; 
}

.miniarticulo details {
 transition: all 0.2s ease;
 cursor: pointer;
}

.miniarticulo details:hover {
 border-color: #cbd5e1;
 background: #f1f5f9;
}

.miniarticulo summary {
 font-weight: 600;
 font-size: 1.1rem;
 color: #0d1b2a;
 list-style: none;
 position: relative;
 padding-right: 20px;
}

.miniarticulo summary::-webkit-details-marker { display: none; }

.miniarticulo summary::after {
 content: "▼";
 position: absolute;
 right: 0;
 top: 50%;
 transform: translateY(-50%);
 color: #f4a261;
 transition: transform 0.3s ease;
}

.miniarticulo details[open] summary::after {
 transform: translateY(-50%) rotate(180deg);
}

.separador-interno {
 margin-top: 15px;
 padding-top: 12px;
 border-top: 1px solid #e2e8f0;
 color: #333;
 line-height: 1.6;
}

.caja-enlaces h3 {
 margin-top: 0;
 margin-bottom: 5px;
 font-size: 1.15rem;
 color: #0d1b2a;
}

.caja-enlaces p {
 color: #555;
 font-size: 0.95rem;
 margin-bottom: 0;
}

.caja-enlaces ul {
 list-style: none;
 padding-left: 0;
 margin-bottom: 0;
}

.caja-enlaces li {
 margin-bottom: 8px;
}

.caja-enlaces a {
 color: #0d1b2a;
 font-weight: 600;
 text-decoration: none;
 display: inline-block;
 transition: color 0.2s ease;
}

.caja-enlaces a:hover {
 color: #f4a261;
 text-decoration: underline;
 text-decoration-color: #f4a261;
}

.caja-enlaces a::before {
 content: "▸ ";
 color: #f4a261;
}

.autor-credito {
 font-size: 0.85rem;
 color: #64748b;
 margin-top: 30px;
 font-style: italic;
}

.disclaimer-ymyl {
 font-size: 0.75rem;
 color: #94a3b8;
 max-width: 900px;
 margin: 25px auto 0 auto;
 border-top: 1px solid rgba(255,255,255,0.1);
 padding-top: 15px;
 text-align: center;
 line-height: 1.5;
}
.disclaimer-ymyl a {
 color: #cbd5e1;
 text-decoration: underline;
}

/* =====================
RESPONSIVE (MÓVIL Y TABLET)
===================== */
@media (max-width: 900px) {

 /* ORDEN MÁGICO PARA LA HOME EN MÓVIL (Texto -> Imagen -> Botones) */
 .home-hero .hero-content {
     display: flex;
     flex-direction: column;
 }
 .home-hero .hero-left-col {
     display: contents; 
 }
 .home-hero .hero-text {
     order: 1;
     text-align: center;
 }
 
 /* FIX ESPACIOS MÓVIL: Imagen súper ajustada al texto y botones */
 .home-hero .hero-image {
     order: 2;
     width: 100%;
     text-align: center;
     margin: 10px 0 5px 0; /* Solo 10px por arriba y 5px por abajo */
 }
 
 /* FIX ESPACIOS MÓVIL: Botones pegados a la imagen */
 .home-hero .hero-buttons {
     order: 3;
     width: 100%;
     display: flex;
     flex-direction: column;
     gap: 12px;
     margin-top: 5px; /* Quitamos el margin-top nativo de 20px */
 }
 .home-hero .hero-buttons a {
     width: 100%; 
     margin: 0;
 }

 /* El resto de páginas mantiene el centrado normal */
 .hero-content:not(.home-hero .hero-content),
 .why {
     flex-direction: column;
     text-align: center;
 }

 /* Forzamos Flexbox Column a todas las cajas de tarjetas para que se apilen 100% perfecto */
 .features,
 .home-features {
     display: flex !important;
     flex-direction: column !important;
     align-items: center;
     gap: 20px;
     width: 100%;
 }

 .card, .card-link {
     width: 100%;
     margin: 0;
 }

 nav {
     display: none;
 }

 .hero-text h1, .herramienta-header h1 {
     line-height: 1.25;
 }

 .why-text ul {
     text-align: left; 
     padding-left: 1.2em;
 }

 .calculadora-box {
     width: 100%;
     padding: 20px;
 }
 
 .hero + .features, .hero + .home-features {
     padding-top: 0px;
 }
}

@media (max-width: 768px) {
 #nav-menu {
   display: none;
   flex-direction: column;
   background: #0d1b2a;
   position: absolute;
   top: 70px;
   right: 0;
   width: 100%;
   text-align: center;
   z-index: 999;
 }

 #nav-menu a {
   padding: 15px;
   display: block;
   color: white;
   border-top: 1px solid rgba(255,255,255,0.1);
   margin-left: 0;
 }

 .menu-toggle {
   display: block;
 }
 
 .author-box-home {
     flex-direction: column;
     text-align: center;
 }
}