/* ==========================================================================
   TORNAVIAJE.ORG — MOTOR ESTÁTICO EDITORIAL CONTEMPORÁNEO
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Spectral:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

:root {
    --bg-main: #FAFAF7;
    --text-color: #1a1815;
    --heading-color: #111111;
    --text-muted: #555555;
    --border-color: #e5e2db;
    --accent: #d88935;
    --accent-hover: #b86e20;
    --brand-blue: #144b8e;
    --brand-blue-hover: #0f3768;
    --font-serif: 'Spectral', Georgia, serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-color);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   CABECERA TRÍPTICO
   ========================================================================== */
.site-header {
    background-color: var(--bg-main);
    width: 100%;
    position: relative;
    z-index: 100;
}

.header-top-row {
    max-width: 1040px;
    margin: 0 auto;
    padding: 12px 18px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.header-nav-left {
    justify-self: start;
}

.header-nav-right {
    justify-self: end;
}

.header-nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header-nav-links a {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 500;
    color: #1a1815;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}

.header-nav-links a:hover {
    color: var(--accent);
}

.header-brand-center {
    text-align: center;
}

.header-brand-center .brand-link {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-brand-center .brand-title {
    font-family: var(--font-serif);
    font-size: 34px;
    font-weight: 600;
    color: #111111;
    line-height: 1;
    letter-spacing: -0.015em;
}

.header-brand-center .brand-tagline {
    font-family: var(--font-sans);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.26em;
    color: #111111;
    text-transform: uppercase;
    margin-top: 3px;
}

.header-search-btn {
    background: transparent;
    border: none;
    color: #1a1815;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    transition: color 0.2s ease, transform 0.2s ease;
}

.header-search-btn:hover {
    color: var(--accent);
    transform: scale(1.08);
}

.header-accent-line {
    height: 1.5px;
    background-color: var(--accent);
    width: 100%;
}

/* Barra de progreso de lectura */
.tv-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background-color: var(--accent);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ==========================================================================
   PORTADA: MARCO REDONDEADO EXTERIOR (42px)
   ========================================================================== */
@media (min-width: 1024px) {
    body.is-home {
        background-color: #ebe7df !important;
        padding: 36px 0 48px 0 !important;
    }

    body.is-home .home-magazine-frame {
        max-width: 1040px;
        margin: 0 auto;
        background-color: #FAFAF7;
        border-radius: 42px;
        overflow: hidden;
        box-shadow: 0 6px 28px rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(0, 0, 0, 0.06);
    }
}

/* ==========================================================================
   BOTÓN SÍGUENOS Y ENLACES
   ========================================================================== */
.btn-siguenos-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--brand-blue);
    color: #ffffff !important;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 8px 20px;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-siguenos-pill:hover {
    background-color: var(--brand-blue-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

/* ==========================================================================
   PLANTILLAS DE LECTURA DE ARTÍCULOS (740px)
   ========================================================================== */
.article-reading-container {
    max-width: 740px;
    margin: 40px auto 80px auto;
    padding: 0 20px;
}

.article-header {
    margin-bottom: 25px;
}

.article-badges-row {
    margin-bottom: 14px;
}

.article-badge {
    display: inline-block;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 3px;
}

.article-title {
    font-family: var(--font-serif);
    font-size: clamp(28px, 3.6vw, 38px);
    font-weight: 700;
    color: var(--heading-color);
    line-height: 1.2;
    margin: 0 0 16px 0;
}

.article-lead {
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.article-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.tv-font-resizer-bar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #faf8f5;
    border: 1px solid #ded8cb;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.tv-btn-fontsize {
    background: transparent;
    border: 1px solid transparent;
    color: #444;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    cursor: pointer;
}

.tv-btn-fontsize.is-active {
    background: #eadecc;
    border-color: #d0c4b2;
    color: #1a1815;
}

.entry-content {
    font-size: 17.5px;
    line-height: 1.85;
    color: var(--text-color);
}

.entry-content h2 {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 700;
    color: #111111;
    margin: 35px 0 16px 0;
    line-height: 1.25;
}

.entry-content p {
    margin: 0 0 20px 0;
}

/* Ficha Técnica */
.spec-box {
    background: #faf8f5;
    border: 1px solid #e2ddd3;
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    padding: 18px 22px;
    margin: 25px 0 30px 0;
}

.spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px 16px;
}

/* ==========================================================================
   PIE DE PÁGINA
   ========================================================================== */
.site-footer {
    background-color: var(--bg-main);
    border-top: 1px solid var(--border-color);
    padding: 35px 20px;
    margin-top: 60px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

body.is-home .site-footer {
    max-width: 1040px;
    margin: 25px auto 0 auto;
    background: transparent !important;
    border-top: none;
}

.footer-legal-nav {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.footer-legal-nav a:hover {
    color: var(--accent);
}

/* ==========================================================================
   MODAL DE BÚSQUEDA INSTANTÁNEA
   ========================================================================== */
.search-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 20px;
}

.search-modal-backdrop.is-open {
    display: flex;
}

.search-modal-box {
    background: #FAFAF7;
    border-radius: 12px;
    max-width: 620px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid #ded8cb;
}

.search-input-field {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    font-family: var(--font-sans);
}

.search-input-field:focus {
    border-color: var(--accent);
}

.search-results-list {
    margin-top: 18px;
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-result-item {
    padding: 10px 12px;
    border-bottom: 1px solid #efece6;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: #f0eee8;
}

/* ==========================================================================
   VISOR LIGHTBOX (ZOOM 450%)
   ========================================================================== */
.lightbox-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 20, 0.95);
    z-index: 20000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
}

.lightbox-backdrop.is-open {
    display: flex;
}

.lightbox-img-wrap {
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    cursor: zoom-in;
}

.lightbox-img-wrap.is-zoomed {
    cursor: grab;
    overflow: auto;
}

.lightbox-img-wrap img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.lightbox-caption {
    color: #e2ddd3;
    font-size: 13.5px;
    max-width: 800px;
    text-align: center;
    margin-top: 14px;
    line-height: 1.5;
}

.lightbox-close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}
