/*
Theme Name: Libro Timeline
Description: Tema minimalista y líneas de tiempo basadas en shortcode.
Version: 1.0.0
Author: Phillipe Calmet Williams
*/

/* --- 1. Reglas Globales Estrictas (Blanco y Negro) --- */
body {
    background-color: #ffffff !important;
    color: #000000 !important;
    font-family: 'Playfair Display', serif;
}

/* Enlaces: color normal, sin decoración, con borde inferior punteado */
a {
    color: #000000 !important;
    text-decoration: none !important;
    border-bottom: 1px dotted #000000 !important;
    transition: border-bottom-style 0.2s ease, opacity 0.2s ease;
}

a:hover {
    border-bottom-style: solid !important;
    opacity: 0.7;
}

/* --- 2. Estilos específicos para el contenido de los hitos --- */
.libro-contenido p {
    margin-bottom: 1rem;
}

.libro-contenido h3 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
    font-weight: 700;
}

.libro-contenido h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    margin-top: 2rem;
    font-weight: 600;
}

.libro-contenido table {
    margin-bottom: 1rem;
    margin-top: 2rem;
    display: block;
    overflow-x: auto; /* Permite scroll horizontal en móviles sin romper el diseño */
    width: 100%;
    border-collapse: collapse;
}

.libro-contenido table td,
.libro-contenido table th {
    padding: 0.5rem;
    border: 1px dotted #000000;
    text-align: left;
}

.libro-contenido ol {
    list-style: decimal;
    list-style-position: inside;
    margin-bottom: 1rem;
    margin-left: 2rem;
}

.libro-contenido ul,
.libro-contenido nav ul {
    list-style: disc;
    list-style-position: inside;
    margin-bottom: 1rem;
    margin-left: 2rem;
}

.libro-contenido ol li,
.libro-contenido ul li,
.libro-contenido nav ul li {
    margin-bottom: 0.5rem;
}

/* Forzar enlaces de la navegación inyectada por el plugin a cumplir la regla */
.libro-navegacion a {
    color: #000000 !important;
    border-bottom: 1px dotted #000000 !important;
    text-decoration: none !important;
}
.libro-navegacion a:hover {
    border-bottom-style: solid !important;
}

/* --- 3. Mecánica de la Línea de Tiempo (Shortcode) --- */
.tabla-contenido-libro {
    position: relative;
    padding: 2rem 0;
}

/* Línea vertical central negra */
.tabla-contenido-libro::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background-color: #000000;
    transform: translateX(-50%);
    z-index: 0;
}

/* Insignia del Capítulo */
.toc-capitulo > h2, 
.toc-capitulo > .text-4xl {
    text-align: center;
    background-color: #ffffff;
    display: inline-block;
    padding: 0.75rem 2rem;
    border: 2px solid #000000;
    color: #000000;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    margin-bottom: 2.5rem;
    margin-top: 1rem;
}

/* Elementos de la lista (hitos) */
.toc-capitulo ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 10;
}

.toc-capitulo ul li {
    position: relative;
    width: 50%;
    margin-bottom: 1rem;
}

/* Puntos en la línea */
.toc-capitulo ul li::after {
    content: '';
    position: absolute;
    top: 1.25rem;
    width: 12px;
    height: 12px;
    background-color: #ffffff;
    border: 2px solid #000000;
    border-radius: 50%;
    z-index: 20;
    transition: all 0.3s ease;
}

/* Lado izquierdo */
.toc-capitulo ul li:nth-child(odd) {
    left: 0;
    text-align: right;
    padding-right: 3rem;
}
.toc-capitulo ul li:nth-child(odd)::after {
    right: -6px;
}

/* Lado derecho */
.toc-capitulo ul li:nth-child(even) {
    left: 50%;
    text-align: left;
    padding-left: 3rem;
}
.toc-capitulo ul li:nth-child(even)::after {
    left: -7px;
}

.toc-capitulo ul li:hover::after {
    background-color: #000000;
}

/* Secciones (sub-capítulos) */
.toc-seccion {
    margin-top: 3rem;
    padding-left: 2rem;
    border-left: 2px dashed #000000;
}

.toc-seccion h3, 
.toc-seccion .text-2xl {
    color: #000000;
    font-size: 1.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #ffffff;
    display: inline-block;
    padding: 0.25rem 1rem;
    border: 1px solid #000000;
    margin-bottom: 1rem;
}

/* --- 4. Responsividad (Móvil) --- */
@media (max-width: 768px) {
    .tabla-contenido-libro::before {
        left: 20px;
    }
    .toc-capitulo > h2, 
    .toc-capitulo > .text-4xl {
        left: 20px;
        transform: none;
        text-align: left;
        padding-left: 3rem;
        width: calc(100% - 4rem);
    }
    .toc-capitulo ul li,
    .toc-capitulo ul li:nth-child(odd),
    .toc-capitulo ul li:nth-child(even) {
        width: 100%;
        left: 0;
        text-align: left;
        padding-left: 3.5rem;
        padding-right: 1rem;
    }
    .toc-capitulo ul li::after,
    .toc-capitulo ul li:nth-child(odd)::after,
    .toc-capitulo ul li:nth-child(even)::after {
        left: 12px;
        right: auto;
    }
    .toc-seccion {
        padding-left: 1rem;
    }
}