/* Cabecera global (Personalizador) — alineado al tema Magro v1 */

/* Tipografía sans Neutiva en cabecera (coherente con css/magro-neutiva.css) */
.top_bar_01,
.top_bar_01 a,
.top_bar_01 .dates_times,
.header_01,
.header_01 .main_menu,
.header_01 .main_menu ul.sub-menu li a,
.header_01 .main_menu > ul > li > a,
.header_01 .social_01 a {
    font-family: 'Neutiva', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Marca: franja #003E57 + bloque derecho (antes rojo) #BBE700 */
.top_bar_01 .header_bar {
    background: #003e57;
    overflow: hidden;
}

.top_bar_01.full_bg {
    background: #003e57;
}

/* Franja: columnas a la misma altura; menú superior alineado en vertical */
.top_bar_01 .header_bar > .row {
    align-items: stretch;
    min-height: 45px;
}

.top_bar_01 .header_bar > .row > [class*='col-']:first-child {
    display: flex;
    align-items: stretch;
}

.top_bar_01 .top_nav {
    padding-top: 14px;
    padding-bottom: 14px;
    align-self: center;
}

.top_bar_01 .top_nav li a:hover {
    color: rgba(255, 255, 255, 0.95);
}

.top_bar_01 .header_bar > .row > [class*='col-']:last-child {
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
}

/* Bloque derecho (fecha / clima / ciudad): ancho = contenido (flexible), pegado a la derecha */
.top_bar_01 .top_info {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    float: none;
    align-self: stretch;
    flex: 0 1 auto;
    max-width: 100%;
    min-width: 0;
    min-height: 100%;
    box-sizing: border-box;
    background: #bbe700;
    color: #003e57;
    padding: 14px clamp(12px, 2.5vw, 28px);
    line-height: 1.2;
}

/* Separador fecha | clima sobre fondo lima */
.top_bar_01 .top_info .dates_times::after {
    background: rgba(0, 62, 87, 0.35);
}

.top_bar_01 .top_info::after {
    content: none;
    display: none;
}

.top_bar_01 .top_info .dates_times,
.top_bar_01 .top_info .weathers {
    float: none;
    flex-shrink: 0;
    align-self: center;
    line-height: 1.2;
    padding-top: 0;
    padding-bottom: 0;
}

.top_bar_01 .top_info .dates_times {
    margin-right: 11px;
    padding-right: 13px;
}

.top_bar_01 .magro-topbar-city {
    display: inline-block;
    float: none;
    flex-shrink: 0;
    align-self: center;
    margin-left: 10px;
    padding: 0;
    background: transparent;
    color: #003e57;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Neutiva', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: 0.18px;
    text-transform: none;
    line-height: 1.2;
    border-radius: 0;
    vertical-align: middle;
}

.magro-header-no-search .header_01_settings .search_btn {
    display: none !important;
}

/* Tablet: theme responsive.css añade margin-right 110px a .header_01_settings (hueco buscador);
   sin buscador empuja / desalinea el bloque de redes respecto al contenido. */
@media (min-width: 768px) and (max-width: 991px) {
    .magro-header-no-search .header_01_settings {
        margin-right: 0;
        margin-top: 0;
    }
}

/* Menú en una sola fila (escritorio): quitar floats del tema en el ul principal */
@media (min-width: 992px) {
    .magro-header-single-line-nav .main_menu {
        padding-top: 42px;
    }

    .magro-header-single-line-nav .main_menu > ul {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-end;
    }

    .magro-header-single-line-nav .main_menu > ul > li {
        float: none;
        flex-shrink: 0;
        padding: 0 3px 16px;
        margin-right: 22px;
    }

    .magro-header-single-line-nav .main_menu > ul > li:last-child {
        margin-right: 0;
    }

    .magro-header-single-line-nav .main_menu > ul > li > a {
        font-size: 14px;
        white-space: nowrap;
    }

    /* Menos espacio entre logo y menú. */
    .magro-header-single-line-nav .header_01_inner {
        padding-left: 12px;
        padding-right: 8px;
    }

    /* .row por defecto margin ±15px; con padding-right 8px la rejilla sobresalía ~7px del fondo blanco
       (ícono sobre el gris). Usar márgenes que cancelen el padding real de este inner. */
    .magro-header-single-line-nav .header_01_inner > .row {
        margin-left: -12px;
        margin-right: -8px;
        align-items: flex-start;
    }

    .magro-header-single-line-nav .header_01 .noPaddingLeft {
        padding-left: 0;
        min-width: 0;
    }

    .magro-header-single-line-nav .header_01_inner > .row > [class*='col-']:last-child {
        padding-right: 0;
        min-width: 0;
    }

    .magro-header-single-line-nav .header_01_settings {
        padding-top: 42px;
        padding-right: 10px;
        box-sizing: border-box;
        justify-content: flex-end;
        /* Ancho del contenido dentro de .col-auto; no forzar 100% del row. */
        width: auto;
        max-width: 100%;
    }

    /* Redes: sin floats; sin padding vertical del theme (12px / 10px bajaba los íconos). */
    .magro-header-single-line-nav .social_01 {
        margin-right: 0;
        float: none;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding-top: 0;
        padding-bottom: 0;
    }

    .magro-header-single-line-nav .social_01 a {
        float: none;
        flex-shrink: 0;
        margin-right: 10px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
    }

    /* Misma caja óptica que el enlace del menú (theme: line-height .8 en .main_menu > ul > li > a). */
    .magro-header-single-line-nav .main_menu > ul > li > a {
        line-height: 1;
        padding-bottom: 2px;
    }

    .magro-header-single-line-nav .social_01 a:last-child {
        margin-right: 0;
    }

    .magro-header-single-line-nav .logo_01 {
        padding-top: 22px;
        padding-bottom: 22px;
    }
}

/* 992–1199: una fila; menú compacto; si no cabe, scroll solo dentro del bloque del menú. */
@media (min-width: 992px) and (max-width: 1199px) {
    .magro-header-single-line-nav .header_01_inner > .row {
        flex-wrap: nowrap;
        align-items: center;
    }

    .magro-header-single-line-nav .header_01_inner > .row > [class*='col-']:first-child {
        flex-shrink: 0;
    }

    .magro-header-single-line-nav .header_01_inner > .row > [class*='col-']:nth-child(2) {
        min-width: 0;
        flex: 1 1 auto;
    }

    .magro-header-single-line-nav .header_01_inner > .row > [class*='col-']:nth-child(3) {
        flex-shrink: 0;
    }

    .magro-header-single-line-nav .header_01 .main_menu {
        min-width: 0;
        max-width: 100%;
    }

    .magro-header-single-line-nav .main_menu > ul {
        flex-wrap: nowrap;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .magro-header-single-line-nav .main_menu > ul > li {
        flex-shrink: 0;
        margin-right: 8px;
        padding: 0 2px 10px;
    }

    .magro-header-single-line-nav .main_menu > ul > li:last-child {
        margin-right: 0;
    }

    .magro-header-single-line-nav .main_menu > ul > li > a {
        font-size: 12px;
        letter-spacing: 0.02em;
    }
}

.magro-header-compact .top_bar_01 {
    padding-top: 6px;
    padding-bottom: 6px;
}

.magro-header-compact .header_01 .header_01_inner {
    padding-top: 0;
    padding-bottom: 0;
}

.magro-header-compact .logo_01 {
    padding-top: 16px;
    padding-bottom: 16px;
}

.magro-header-compact .main_menu {
    padding-top: 34px !important;
}

/* Móvil/tablet: el menú hamburguesa no debe heredar el padding de escritorio (compact / theme). */
@media (max-width: 991px) {
    .header_01 .main_menu.mobile_menu {
        padding-top: 0 !important;
    }
}

/* Buscador YTL — mismo ancho que el contenido (.container), no banda a todo el viewport */
body.magro-ytl-active {
    overflow-x: hidden;
}

.magro-ytl-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
    contain: layout;
    overflow-x: hidden;
    padding: 12px 0;
}

/* Caja gris alineada al grid del tema (Bootstrap .container) */
.magro-ytl-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    background: #f5f5f5;
    border: 1px solid #e5e5e5;
    border-radius: 2px;
    padding: 12px;
}

/* Capa extra: recorta embeds que pidan 100vw o ancho fijo */
.magro-ytl-clip {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

.magro-ytl-inner {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Wrappers típicos del código pegado */
.magro-ytl-inner > div,
.magro-ytl-inner > span {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.magro-ytl-inner iframe,
.magro-ytl-inner embed,
.magro-ytl-inner object {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.magro-ytl-inner table {
    max-width: 100% !important;
    table-layout: auto;
}

.magro-ytl-inner img {
    max-width: 100%;
    height: auto;
}

@media (prefers-reduced-motion: reduce) {
    body.body_with_bg {
        background-attachment: scroll !important;
    }
}

/* Blog list centrado (category_2 sin smileys ni sidebar) */
.magro-bloglist-page .row.justify-content-center {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.magro-bloglist-page .tw5_list:last-of-type {
    margin-bottom: 0;
}

.magro-bloglist-pagination {
    margin-top: 36px;
}

.magro-bloglist-pagination a,
.magro-bloglist-pagination span {
    display: inline-block;
    margin: 0 4px;
    padding: 8px 12px;
}

.magro-bloglist-page .navigation.pagination {
    margin-top: 24px;
}

.magro-bloglist-page .navigation.pagination .nav-links {
    display: inline-block;
}

/* Cabecera: redes con Instagram/TikTok y clics fiables (capas del menú / ícono no intercepta). */
.header_01 .header_01_settings {
    position: relative;
    z-index: 10;
}

.magro-header-social .magro-header-social-link {
    position: relative;
    z-index: 11;
    cursor: pointer;
}

.magro-header-social .magro-header-social-link i {
    pointer-events: none;
}

/* Tablet: el tema sube .header_01_settings con margin-top negativo y el área útil del enlace no coincide con el dibujo */
@media (min-width: 768px) and (max-width: 991px) {
    .header_01 .header_01_settings {
        margin-top: 0;
    }
}

/* TikTok en cabecera y sidebar (antes solo en magro-v2.css, que no carga en todas las vistas) */
.magro-v2-icon-tiktok::before {
    content: "";
    display: inline-block;
    width: 17px;
    height: 17px;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-5.2 1.74 2.89 2.89 0 0 1 2.31-4.64v-3.4a6.34 6.34 0 1 0 6.34 6.33V8.84a8.16 8.16 0 0 0 4.77 1.52v-3.67z'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-5.2 1.74 2.89 2.89 0 0 1 2.31-4.64v-3.4a6.34 6.34 0 1 0 6.34 6.33V8.84a8.16 8.16 0 0 0 4.77 1.52v-3.67z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Pie: correo largo (Customizer) sin desbordar ni provocar scroll horizontal. */
footer .about_magro {
    min-width: 0;
}

footer .about_magro h4 {
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    max-width: 100%;
}

footer .about_magro h4 span {
    overflow-wrap: anywhere;
    word-break: break-word;
}
