/* ==================================================
   FRONT-LAYOUT.CSS
   Tipo: Layout de página
   Ámbito: Todas las páginas (se carga siempre)
   Define: Header (sticky, hamburger, frase, flechas,
           dropdown, búsqueda, redes), footer (logos,
           menús, legal). NO contiene estilos de zonas
           de contenido ni tipografía de noticias.
   Depende de: front-components.css
   ================================================== */

.lavoz-header-sitio {
    background: var(--lavoz-color-accent);
    padding: var(--lavoz-gap-md) 0;
    margin-bottom: 0;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: padding 0.2s ease, box-shadow 0.2s ease;
}

.lavoz-header-sitio.is-shrunk {
    padding: 6px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.lavoz-header-wrap {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--lavoz-gap-md);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    position: relative;
}

.lavoz-header-hamburger {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 4px;
    position: relative;
    align-self: start;
    margin-top: 7px;
}

.lavoz-header-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--lavoz-color-bg);
    border-radius: 1px;
    flex-shrink: 0;
}

.lavoz-header-hamburger-lines {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lavoz-header-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lavoz-header-nombre {
    font-family: var(--lavoz-font-heading);
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--lavoz-color-bg);
    text-decoration: none;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.lavoz-header-nombre:hover {
    opacity: 0.9;
}

.lavoz-header-imagen {
    display: block;
    max-height: 48px;
    width: auto;
    max-width: 100%;
    transition: max-height 0.2s ease;
}

.lavoz-header-sitio.is-shrunk .lavoz-header-imagen {
    max-height: 34px;
}

.lavoz-header-logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.lavoz-header-frase {
    font-family: var(--lavoz-font-body);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--lavoz-color-frase-cabecera);
    text-align: right;
    letter-spacing: 0.04em;
    opacity: 1;
    margin: 4px 0 0;
    padding-right: var(--lavoz-gap-md);
}

.lavoz-header-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* ── Navegación dual — desktop y mobile ──
   Dos bloques HTML independientes. El orden de declaración
   en este CSS garantiza la visibilidad correcta sin !important:
   los selectores modificadores van después del selector base,
   y el media query va al final del archivo. */
.lavoz-header-nav--desktop {
    display: flex;
}

.lavoz-header-nav--mobile {
    display: none;
}

.lavoz-header-fecha-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.lavoz-header-flechas {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.lavoz-header-fecha {
    font-family: var(--lavoz-font-body);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--lavoz-color-bg);
}

.lavoz-header-debug {
    font-family: monospace;
    font-size: 0.6rem;
    color: var(--lavoz-color-bg);
    opacity: 0.75;
    white-space: nowrap;
}

.lavoz-header-flecha {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
    cursor: pointer;
    flex-shrink: 0;
}

.lavoz-header-flecha--prev::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 9px solid #fff;
}

.lavoz-header-flecha--next::before {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 9px solid #fff;
}

.lavoz-header-flecha:hover {
    opacity: 1;
}

.lavoz-header-flecha--ghost {
    opacity: 0;
    cursor: default;
    pointer-events: none;
}

.lavoz-header-lateral {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
}

.lavoz-header-social {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
}

.lavoz-header-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lavoz-color-bg);
    transition: opacity 0.2s ease;
}

.lavoz-header-social-icon:hover {
    opacity: 0.7;
}

.lavoz-footer-sitio {
    background: var(--lavoz-color-accent);
    padding: var(--lavoz-gap-xl) 0;
    margin-top: 20px;
}

.lavoz-footer-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--lavoz-gap-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lavoz-footer-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--lavoz-gap-md);
    flex-wrap: wrap;
}

.lavoz-footer-logo-img {
    height: 50px;
    width: auto;
    display: block;
}

.lavoz-footer-info {
    color: var(--lavoz-color-bg);
    font-family: var(--lavoz-font-body);
    font-size: 0.9rem;
}

.lavoz-footer-info p {
    margin: 0;
}

.lavoz-menu-footer {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--lavoz-gap-md);
}

.lavoz-menu-footer li a {
    color: var(--lavoz-color-bg);
    text-decoration: none;
    font-family: var(--lavoz-font-body);
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
}

.lavoz-menu-footer li a:hover {
    opacity: 0.7;
}

.lavoz-footer-legal {
    margin-top: var(--lavoz-gap-sm);
}

.lavoz-menu-legal {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: var(--lavoz-gap-md);
}

.lavoz-menu-legal li a {
    color: var(--lavoz-color-bg);
    text-decoration: none;
    font-family: var(--lavoz-font-body);
    font-size: 0.8rem;
    transition: opacity 0.2s ease;
}

.lavoz-menu-legal li a:hover {
    opacity: 0.7;
}

/* ── Dropdown desktop ── */
.lavoz-dropdown-menu {
    position: absolute;
    top: calc(100%);
    left: 0;
    width: max-content;
    background: var(--lavoz-color-dropdown-bg) !important;
    border: 1px solid var(--lavoz-color-accent);
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    z-index: 1100;
    overflow: hidden;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.lavoz-dropdown-menu.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* X oculta en desktop */
.lavoz-dropdown-close {
    display: none;
}

/* ── Ítems del dropdown — desktop ── */
.lavoz-dropdown-lista li a {
    display: block;
    color: var(--lavoz-color-dropdown-texto) !important;
    text-decoration: none !important;
    font-family: var(--lavoz-font-body);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    transition: background 0.15s, color 0.15s;
    background: transparent !important;
}

.lavoz-dropdown-lista li:last-child a {
    border-bottom: none;
}

.lavoz-dropdown-lista li a:hover {
    background: var(--lavoz-color-dropdown-hover-bg) !important;
    color: var(--lavoz-color-dropdown-hover-texto) !important;
}

/* ── Dropdown mobile — panel desde la izquierda ── */
/* ── Mobile menu panel ── */
@media (max-width: 640px) {
    .lavoz-dropdown-menu {
        position: fixed;
        left: 0;
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        z-index: 9999;
        border-radius: 0;
        border: none;
        box-shadow: 0 6px 16px rgba(0,0,0,0.18);
        border-bottom: 4px solid #0f5274;
        background-color: #ffffff;
        overflow-y: auto;
        visibility: hidden;
        clip-path: inset(0 0 100% 0);
        transition: clip-path 0.3s ease, visibility 0.3s;
    }

    .lavoz-dropdown-menu.is-open {
        visibility: visible;
        clip-path: inset(0 0 -20px 0);
    }

    .lavoz-dropdown-lista {
        width: 100%;
    }

    .lavoz-dropdown-lista li a {
        display: block;
        color: #0f5274 !important;
        font-size: 1rem !important;
        padding: 14px 24px !important;
        border-bottom: 1px solid rgba(0,0,0,0.1) !important;
        text-decoration: none !important;
    }

    .lavoz-dropdown-close {
        display: flex !important;
        justify-content: center;
        padding: 16px;
        background: transparent;
        border: none;
        color: #0f5274;
        cursor: pointer;
        width: 100%;
        box-sizing: border-box;
        order: 99;
    }
}

/* ── Header mobile ── */
@media (max-width: 640px) {
    /* Grid mobile: hamburger izq | center ocupa cols 2-3, lateral baja a fila 2 */
    .lavoz-header-wrap {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        align-items: start;
        gap: 0;
    }

    /* Hamburger alineado arriba con el logo */
    .lavoz-header-hamburger {
        display: flex;
        align-self: start;
        justify-self: start;
        margin-top: 6px;
        grid-column: 1;
        grid-row: 1;
    }

    /* Center: col 2, fila 1 */
    .lavoz-header-center {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        align-self: start;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Lateral: ocupa las dos columnas en fila 2, centrado */
    .lavoz-header-lateral {
        grid-column: 1 / -1;
        grid-row: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 4px 0 2px;
    }

    /* Navegación: ocultar desktop, mostrar mobile */
    .lavoz-header-nav--desktop {
        display: none;
    }

    .lavoz-header-nav--mobile {
        display: grid;
        grid-template-columns: 24px auto 24px;
        align-items: center;
        justify-content: center;
        column-gap: 12px;
        width: 100%;
    }

    .lavoz-header-nav--mobile .lavoz-header-fecha-wrap {
        min-width: 0;
        align-items: center;
        text-align: center;
    }

    .lavoz-header-nav--mobile .lavoz-header-fecha {
        white-space: nowrap;
    }

    /* Redes: centradas en mobile */
    .lavoz-header-social {
        justify-content: center;
        margin: 0;
    }

    /* Frase centrada en mobile */
    .lavoz-header-frase {
        text-align: center;
        padding-right: 0;
    }

    .lavoz-header-imagen {
        max-height: 32px !important;
    }

    .lavoz-header-debug {
        display: none;
    }

    .lavoz-footer-wrap {
        flex-direction: column;
        gap: var(--lavoz-gap-md);
    }

    .lavoz-menu-footer {
        flex-direction: column;
        gap: var(--lavoz-gap-xs);
    }
}



/* ── Panel de búsqueda — segunda línea bajo el header ── */
.lavoz-search-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    width: 100%;
}

.lavoz-search-panel.is-open {
    max-height: 60px;
}

.lavoz-search-form {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 3px;
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
}

.lavoz-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--lavoz-color-bg);
    font-family: var(--lavoz-font-body);
    font-size: 0.95rem;
    padding: 8px 12px;
    flex: 1;
    width: 100%;
}

.lavoz-search-input::placeholder {
    color: rgba(255,255,255,0.6);
}

.lavoz-search-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--lavoz-color-bg);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.lavoz-search-btn:hover {
    opacity: 1;
}
