/* --- 🍞 BREADCRUMBS (Estilo Modular) --- */

/* 1. El Contenedor (La fila completa) */
.mainter-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 15px 0 5px 0;
    font-size: 0.85rem;
    color: #6b7280;
    
    /* 🛑 FORZAMOS UNA SOLA LÍNEA */
    flex-wrap: nowrap; 
    white-space: nowrap;
    overflow: hidden; /* Seguridad extra */
}

/* 2. Los elementos que NO son el final (Home, Categoría, Separadores) */
/* Les decimos: "Ustedes nunca se encojan, muéstrense completos" */
.mainter-breadcrumbs a,
.mainter-breadcrumbs .separator {
    flex-shrink: 0; 
}

/* 3. El Elemento Final (El título largo) */
/* Le decimos: "Tú ocupa el espacio que sobre. Si no cabes, usa '...'" */
.mainter-breadcrumbs span:last-child,
.mainter-breadcrumbs .current-item {
    flex: 1;               /* Ocupa el espacio restante */
    min-width: 0;          /* CRUCIAL: Permite que flexbox lo encoja más allá de su contenido */
    white-space: nowrap;
    overflow: hidden;      /* Corta lo que sobre */
    text-overflow: ellipsis; /* Pone los "..." */
    
    /* Opcional: Si quieres que no se vea gris apagado */
    color: #374151; 
    font-weight: 500;
}

/* Contenedor Flex */
.mainter-breadcrumbs .container {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

/* Enlaces */
.crumb-link {
    color: #4b5563;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    white-space: nowrap; /* Vital: Evita que el texto se rompa */
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.crumb-link:hover {
    color: var(--theme-color-brand, #e25822);
    text-decoration: underline;
}

/* Separador */
.sep {
    color: #d1d5db;
    font-size: 10px;
    user-select: none;
}

/* Texto Actual (Título) */
.crumb-current {
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Puntos suspensivos ... */
    max-width: 400px; /* Límite en escritorio */
}

/* --- 📱 MÓVIL (Responsive App-Style) --- */
@media (max-width: 600px) {
    .mainter-breadcrumbs {
        padding: 10px 0;
        border-bottom: 1px solid rgba(0,0,0,0.03);
    }

    .mainter-breadcrumbs .container {
        /* Magia del Scroll Horizontal */
        flex-wrap: nowrap; 
        overflow-x: auto; 
        padding-bottom: 5px; /* Espacio para el dedo */
        
        /* Ocultar barra de scroll (UX limpia) */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE */
    }
    
    .mainter-breadcrumbs .container::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    /* En móvil, permitimos ver más texto deslizando */
    .crumb-current {
        max-width: none; 
        color: #374151; 
        padding-right: 15px; /* Margen final para que no se corte feo */
    }
}


/* Usamos la nueva variable --hero-accent */
.section-title span { /* El icono de fuego */
    color: var(--hero-accent, #e25822) !important; /* El !important asegura que sobrescriba */
}

.badge-featured {
    background: var(--hero-accent, #e25822);
}


/* --- 📄 SINGLE HERO (Centrado y Oscuro) --- */

.single-hero-header {
    position: relative;
    width: 100%;
    height: 30vh; /* Altura del Hero */
    min-height: 360px;
    background: #000;
    margin-bottom: 50px;
    
    /* FLEXBOX MÁGICO PARA CENTRAR */
    display: flex;
    align-items: center;     /* Centrado Vertical */
    justify-content: center; /* Centrado Horizontal */
    text-align: center;      /* Alineación de texto */
}

/* Imagen de fondo */
.single-hero-bg {
    position: absolute; inset: 0; width: 100%; height: 100%;
}

.single-hero-bg img {
    width: 100%; height: 100%; 
    object-fit: cover;
    opacity: 0.9; /* Pequeño toque de transparencia a la imagen base */
}

/* CAPA DE OSCURIDAD (Overlay) */
.single-hero-overlay {
    position: absolute; inset: 0;
    /* Un fondo negro semitransparente (60%) parejo en toda la imagen */
    background: rgba(0, 0, 0, 0.6); 
    
    /* Opcional: Si quieres mantener un toque de degradado extra abajo */
    /* background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.8)); */
}

/* Contenido */
.single-hero-container {
    position: relative; 
    z-index: 10; 
    width: 100%;
    padding: 0 20px; /* Margen lateral para que no toque los bordes en móvil */
    max-width: 900px; /* Limitamos el ancho para que el texto no se estire demasiado */
    margin: 0 auto; /* Centrar el bloque */
}

/* Elementos Individuales */
.hero-cat {
    display: inline-block;
    background: #e25822; 
    color: #fff;
    font-size: 0.8rem; font-weight: 800; text-transform: uppercase;
    padding: 6px 12px; border-radius: 50px; /* Más redondeado tipo botón */
    margin-bottom: 20px;
}

.single-hero-title {
    color: #fff;
    font-size: 3.5rem; /* Un poco más grande para impacto */
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 20px 0;
    text-shadow: 0 4px 15px rgba(0,0,0,0.5); /* Sombra para resaltar */
}

.single-hero-meta {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .single-hero-header { height: 50vh; min-height: 350px; }
    .single-hero-title { font-size: 2rem; }
}







/* --- COMENTARIOS (Estilo Moderno) --- */
.comments-area {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 30px;
}

/* --- A. FORMULARIO DE COMENTARIOS --- */
.comment-form {
    background: var(--card-bg, #fff); /* Soporte modo oscuro */
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    margin-bottom: 50px;
}

.comment-notes, .logged-in-as {
    font-size: 0.9rem; color: #666; margin-bottom: 20px;
}

/* Inputs y Textarea */
.comment-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 15px;
    background: #f9f9f9; /* Fondo gris muy suave */
    border: 2px solid transparent; /* Sin borde visible al inicio */
    border-radius: 12px; /* Redondeado moderno */
    font-size: 1rem;
    transition: all 0.3s ease;
    color: var(--theme-text-main);
}

/* Efecto Focus (Tu color de marca) */
.comment-form input:focus,
.comment-form textarea:focus {
    background: #fff;
    border-color: var(--theme-color-brand); /* ¡Aquí entra tu color! */
    outline: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.comment-form textarea {
    min-height: 150px; /* Altura cómoda para escribir */
    resize: vertical;
}

/* Botón de Enviar (Hereda tus estilos de botón, pero reforzamos) */
.comment-form .submit {
    background: var(--theme-color-brand) !important;
    color: #fff !important;
    padding: 12px 30px !important;
    border-radius: 50px !important; /* Estilo píldora como la foto */
    font-weight: 700;
    margin-top: 10px;
    width: auto;
    cursor: pointer;
    border: none;
    transition: opacity 0.3s;
}
.comment-form .submit:hover { opacity: 0.9; }


/* --- B. LISTA DE COMENTARIOS (Tarjetas) --- */

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Contenedor de cada comentario (La Tarjeta) */
.comment-body {
    background: var(--card-bg, #ffffff); /* Blanco o variable Dark Mode */
    padding: 25px;
    border-radius: 16px; /* Bordes redondeados */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* Sombra suave */
    margin-bottom: 25px;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05); /* Borde sutil */
    transition: transform 0.3s ease;
}

/* Hover en el comentario */
.comment-body:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

/* Header del comentario (Avatar + Nombre + Fecha) */
.comment-meta {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}

/* Avatar circular */
.avatar {
    border-radius: 50%;
    width: 50px; height: 50px;
    margin-right: 15px;
    object-fit: cover;
    border: 2px solid var(--theme-color-brand); /* Anillo de color de marca */
    padding: 2px; /* Espacio entre foto y anillo */
}

/* Autor */
.fn {
    font-style: normal;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--theme-text-main);
}
.fn a { color: inherit; text-decoration: none; }

/* Fecha y Hora */
.comment-metadata {
    margin-left: auto; /* Manda la fecha a la derecha */
    font-size: 0.85rem;
    color: #888;
}
.comment-metadata a { color: #888; text-decoration: none; }


/* Contenido del texto */
.comment-content p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--theme-text-main);
}

/* Botón Responder (Estilo Píldora Pequeña) */
.reply {
    text-align: right; /* Alinear a la derecha */
}

.comment-reply-link {
    display: inline-block;
    background: var(--theme-color-brand); /* Tu color */
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 20px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.comment-reply-link:hover {
    background: #333; /* Color oscuro al pasar mouse */
    color: #fff;
}

/* --- C. COMENTARIOS ANIDADOS (Respuestas) --- */
.children {
    list-style: none;
    padding-left: 0;
    margin-left: 20px; /* Indentación en móvil */
    border-left: 2px solid rgba(0,0,0,0.05); /* Línea guía */
}

@media (min-width: 768px) {
    .children {
        margin-left: 50px; /* Más indentación en PC */
        padding-left: 20px;
    }
}



/* --- D. MODO OSCURO (Compatibilidad) --- */
body.dark-mode .comment-form input,
body.dark-mode .comment-form textarea {
    background: #1f2937; /* Input oscuro */
    color: #fff;
    border-color: #374151;
}
body.dark-mode .comment-form input:focus,
body.dark-mode .comment-form textarea:focus {
    border-color: var(--theme-color-brand);
    background: #111827;
}

/* --- 👤 CAJA DE AUTOR SIMPLE --- */

.author-box-simple {
    background: #f5f5f5; /* Fondo gris claro */
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 50px; /* Separación de los comentarios */
    
    /* Layout Flexible (Foto izquierda, texto derecha) */
    display: flex;
    align-items: center; /* Centrado verticalmente */
    gap: 25px; /* Espacio entre foto y texto */
    
    border: 1px solid rgba(0,0,0,0.05);
}

/* Imagen (Avatar) */
.author-simple-avatar img {
    border-radius: 50%; /* Círculo perfecto */
    width: 100px;
    height: 100px;
    border: 4px solid #fff; /* Borde blanco elegante */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Contenedor de Texto */
.author-simple-content {
    flex: 1; /* Ocupa el resto del espacio */
}

/* Título y Nombre */
.author-simple-name {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: var(--theme-text-main);
    display: flex;
    flex-direction: column; /* Pone "Sobre el autor" arriba del nombre */
    line-height: 1.3;
}

.author-simple-name .small-label {
    font-size: 0.8rem;
    font-weight: 400;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 2px;
}

.author-simple-name a {
    font-weight: 800;
    text-decoration: none;
    color: inherit;
}

/* La Biografía */
.author-simple-bio {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
}

/* --- Responsive (Móvil) --- */
@media (max-width: 600px) {
    .author-box-simple {
        flex-direction: column; /* Uno encima del otro */
        text-align: center;
        padding: 25px;
    }
    
    .author-simple-name {
        margin-top: 15px;
    }
}

/* --- Modo Oscuro --- */
body.dark-mode .author-box-simple {
    background: #1f2937; /* Fondo oscuro */
    border-color: #374151;
}
body.dark-mode .author-simple-bio {
    color: #ccc;
}

/* --- 🔗 BOTONES DE COMPARTIR --- */

.mainter-share-section {
    margin: 40px 0;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.share-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--theme-text-main);
}

.share-buttons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Estilo Base del Botón */
.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 50px; /* Estilo Píldora */
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.share-btn svg {
    margin-right: 8px; /* Separar icono del texto */
}

.share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    color: #fff;
}

/* Colores de Marca */
.btn-fb { background-color: #1877F2; }
.btn-x  { background-color: #000000; }
.btn-wa { background-color: #25D366; }
.btn-li { background-color: #0a66c2; }

/* Responsive móvil */
@media (max-width: 480px) {
    .share-btn {
        flex: 1; /* Que ocupen el ancho disponible */
        justify-content: center;
        font-size: 0.8rem;
        padding: 10px 15px;
    }
    .share-btn span {
        display: none; /* Opcional: Ocultar texto en pantallas muy pequeñas y dejar solo icono */
    }
    .share-btn svg { margin-right: 0; }

} 


/* --- EL GRID DE 3 COLUMNAS --- */
.related-grid-wrapper {
    display: grid;
    /* 3 columnas de igual tamaño */
    grid-template-columns: repeat(3, 1fr); 
    gap: 25px; /* Espacio entre tarjetas */
}



/* Tablet (2 Columnas) */
@media (max-width: 991px) {
    .related-grid-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Móvil (1 Columna) */
@media (max-width: 576px) {
    .related-grid-wrapper {
        grid-template-columns: 1fr;
    }
    .related-item .post-card-image {
        height: 200px; /* Un poco más alto en móvil */
    }
}

/* --- 📑 TABLA DE CONTENIDOS (TOC) --- */

/* --- 1. CONTENEDOR PRINCIPAL --- */
.mainter-toc-container {
    margin: 40px 0;
    clear: both;
}

.mainter-toc {
    background: #fff;
    border-radius: 12px;
    /* Sombra suave estilo "card" */
    box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
    overflow: hidden;
    width: 100%;
    min-width: 320px;
    max-width: 100%;
    border: 1px solid rgba(0,0,0,0.05);
}

/* --- 2. CABECERA (Click para desplegar) --- */
.toc-header {
    padding: 18px 25px;
    cursor: pointer;
    font-weight: 800; /* Título grueso */
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-bottom: 2px solid #f3f4f6;
    transition: background 0.2s;
    list-style: none;
    color: #111827;
}

/* Icono de lista antes del título (Opcional, como en la foto) */
.toc-title-text::before {
    content: "☰"; /* Icono simple */
    margin-right: 10px;
    color: var(--theme-color-brand, #e25822); /* Color de marca */
}

/* Fix Safari */
.toc-header::-webkit-details-marker { display: none; }

/* Flecha de desplegar */
.toc-toggle-icon {
    font-size: 0.8rem;
    color: #9ca3af;
    transition: transform 0.3s ease;
    background: #f3f4f6;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
}

.mainter-toc[open] .toc-toggle-icon {
    transform: rotate(180deg);
    background: var(--theme-color-brand, #e25822);
    color: #fff;
}

/* --- 3. LISTA Y CONTADORES (La Magia) --- */
.toc-list-wrapper {
    padding: 25px;
    background: #fff;
    /* Inicializamos los contadores CSS */
    counter-reset: h2counter;
}

.toc-list-wrapper ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.toc-list-wrapper li {
    margin-bottom: 12px;
    line-height: 1.5;
    display: flex;
    align-items: baseline;
}

/* --- ESTILO DE LOS NÚMEROS (Las etiquetas de color) --- */
.toc-list-wrapper li::before {
    /* Diseño de la "etiqueta" */
    background-color: var(--theme-color-brand, #e25822); /* COLOR DE MARCA */
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 6px;
    margin-right: 12px;
    min-width: 35px; /* Ancho mínimo para que se alineen */
    text-align: center;
    box-shadow: 0 2px 4px rgba(var(--theme-color-brand-rgb, 226, 88, 34), 0.3);
}

/* Lógica para H2 (Nivel 1: 1., 2., 3...) */
.toc-item {
    counter-increment: h2counter; /* Suma 1 al H2 */
    counter-reset: h3counter;     /* Reinicia el contador de H3 */
}

.toc-item::before {
    /* Muestra el número H2 + punto */
    content: counter(h2counter) ".";
}

/* Lógica para H3 (Nivel 2: 1.1, 1.2...) */
.toc-subitem {
    counter-increment: h3counter; /* Suma 1 al H3 */
    margin-left: 20px; /* Indentación */
    font-size: 0.95rem; /* Texto un poco más pequeño */
}

.toc-subitem::before {
    /* Muestra H2 + punto + H3 */
    content: counter(h2counter) "." counter(h3counter);
    /* Hacemos la etiqueta del H3 un poco más sutil */
    background-color: #fff;
    color: var(--theme-color-brand, #e25822);
    border: 2px solid var(--theme-color-brand, #e25822);
    box-shadow: none;
    padding: 2px 6px;
}

/* --- ENLACES --- */
.toc-list-wrapper a {
    text-decoration: none;
    color: #374151;
    font-weight: 600;
    transition: color 0.2s;
    border-bottom: 2px solid transparent;
}

.toc-list-wrapper a:hover {
    color: var(--theme-color-brand, #e25822);
    border-bottom-color: var(--theme-color-brand, #e25822);
}

/* --- 🌙 MODO OSCURO (Ajustes para este diseño) --- */
body.dark-mode .mainter-toc,
body.dark-mode .toc-header,
body.dark-mode .toc-list-wrapper {
    background: #1f2937;
    border-color: #374151;
    color: #f3f4f6;
}
body.dark-mode .toc-header {
    border-bottom-color: #374151;
}
body.dark-mode .toc-toggle-icon {
    background: #374151; color: #e5e7eb;
}
body.dark-mode .mainter-toc[open] .toc-toggle-icon {
    background: var(--theme-color-brand, #e25822); color: #fff;
}
body.dark-mode .toc-list-wrapper a {
    color: #d1d5db;
}
body.dark-mode .toc-list-wrapper a:hover {
    color: var(--theme-color-brand, #e25822);
}
/* En modo oscuro, invertimos el H3 para que resalte */
body.dark-mode .toc-subitem::before {
     background-color: #374151;
}