.portal-header {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
}


.portal-header__main {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 28px 24px 20px;
}


.portal-header__brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}


.portal-header__logo--primary {
    display: block;
    width: min(100%, 520px);
    height: auto;
}


/*
 * La versión aprobada conserva una composición vertical de campaña. Este
 * encuadre la adapta como masthead sin deformarla ni aumentar la altura del
 * encabezado.
 */
.portal-header__logo--primary.portal-header__logo--original-white {
    width: min(100%, 640px);
    height: 148px;
    object-fit: cover;
    object-position: center 53%;
}


.portal-header__navigation {
    border-top: 1px solid #ececec;
}


.portal-header__navigation-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 58px;


    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 24px;
}


.portal-menu-toggle,
.portal-header-sticky__mobile-search {
    display: none;
}


.portal-menu-toggle {
    width: 42px;
    height: 42px;
    padding: 9px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}


.portal-menu-toggle > span {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
}


.portal-menu-toggle > span + span {
    margin-top: 5px;
}


.portal-header__categories {
    min-width: 0;
}


.portal-header__category-list,
.portal-header-sticky__category-list {
    display: flex;
    align-items: center;
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}


.portal-header__category-list {
    justify-content: center;
}


.portal-header-sticky__category-list {
    gap: 24px;
}


.portal-category-item {
    position: relative;
    margin: 0;
}


.portal-header__categories a {
    color: #111111;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}


.portal-header__categories a:hover,
.portal-header__categories a:focus {
    color: #D71920;
}


.portal-header__search {
    display: inline-flex;
    align-items: center;
    justify-content: center;


    width: 42px;
    height: 42px;


    padding: 0;
    border: 0;
    background: transparent;
    color: #111111;


    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}


.portal-header__search:hover,
.portal-header__search:focus {
    color: #D71920;
}

.portal-header-sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;


    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;


    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;


    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}


.portal-header-sticky.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}


.portal-header-sticky__inner {
    max-width: 1200px;
    min-height: 60px;
    margin: 0 auto;
    padding: 0 24px;


    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}


.portal-header-sticky__nav {
    display: flex;
    align-items: center;
    gap: 24px;
}


.portal-header-sticky__nav--left {
    justify-content: flex-end;
}


.portal-header-sticky__nav--right {
    justify-content: flex-start;
}


.portal-header-sticky__nav a {
    color: #111111;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}


.portal-header-sticky__nav a:hover,
.portal-header-sticky__nav a:focus {
    color: #D71920;
}


.portal-header-sticky__brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}


.portal-header-sticky__logo {
    display: block;
    width: 42px;
    height: 42px;
    object-fit: contain;
}


.portal-header-sticky__search {
    display: inline-flex;
    align-items: center;
    justify-content: center;


    width: 38px;
    height: 38px;


    padding: 0;
    border: 0;
    background: transparent;
    color: #111111;


    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}


.portal-header-sticky__search:hover,
.portal-header-sticky__search:focus {
    color: #D71920;
}


.portal-category-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 220px;
    margin: 0;
    padding: 10px 0;
    list-style: none;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
}


.portal-category-submenu .portal-category-submenu {
    top: -11px;
    left: 100%;
}


.portal-category-item:hover > .portal-category-submenu,
.portal-category-item:focus-within > .portal-category-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}


.portal-category-submenu .portal-category-item > a {
    display: block;
    padding: 10px 16px;
    line-height: 1.3;
}


.portal-header-sticky__nav--right .portal-category-submenu {
    right: 0;
    left: auto;
}


.portal-header-sticky__nav--right .portal-category-submenu .portal-category-submenu {
    right: 100%;
    left: auto;
}

body.admin-bar .portal-header-sticky {
    top: 32px;
}


@media screen and (max-width: 782px) {
    body.admin-bar .portal-header-sticky {
        top: 0;
    }
}


/* Identidad La Escena */
.portal-header {
    background: var(--portal-color-ink);
    border-bottom-color: var(--portal-color-brand);
    border-bottom-width: 4px;
    font-family: var(--portal-font-sans);
}


.portal-header__main {
    min-height: 176px;
    padding-top: 0;
    padding-bottom: 10px;
}


.portal-header__logo--primary {
    width: min(100%, 640px);
    max-height: 148px;
    object-fit: contain;
}


/* Versión rectangular: conserva el foco y la claqueta sin recortarlos. */
.portal-header__logo--original-rectangular {
    width: min(100%, 460px);
    height: auto;
    max-height: none;
}


.portal-header__logo--brush {
    max-height: 135px;
}


.portal-header__navigation {
    background: var(--portal-color-ink);
    border-top: 4px solid var(--portal-color-brand);
}


.portal-header__categories a,
.portal-header-sticky__nav a {
    position: relative;
    color: var(--portal-color-text-inverse);
    font-family: var(--portal-font-sans);
}


.portal-header__category-list > .portal-category-item > .portal-category-link::after,
.portal-header-sticky__category-list > .portal-category-item > .portal-category-link::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: -10px;
    left: 0;
    height: 3px;
    background: var(--portal-current-category, var(--portal-color-brand));
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--portal-transition-fast);
}


.portal-category-item:hover > .portal-category-link::after,
.portal-category-item:focus-within > .portal-category-link::after {
    transform: scaleX(1);
}


.portal-header__categories a:hover,
.portal-header__categories a:focus,
.portal-header-sticky__nav a:hover,
.portal-header-sticky__nav a:focus {
    color: var(--portal-color-brand);
}


.portal-header__search,
.portal-header-sticky__search {
    color: var(--portal-color-brand);
}


.portal-header__search:hover,
.portal-header__search:focus,
.portal-header-sticky__search:hover,
.portal-header-sticky__search:focus {
    color: var(--portal-color-text-inverse);
}


.portal-header-sticky {
    background: var(--portal-color-ink);
    border-bottom: 3px solid var(--portal-color-brand);
}


.portal-header-sticky__logo {
    width: 44px;
    height: 44px;
}


.portal-category-submenu {
    background: var(--portal-color-surface);
    border-color: var(--portal-color-border);
}


.portal-category-submenu .portal-category-item > a {
    color: var(--portal-color-text);
    border-left: 4px solid var(--portal-current-category, var(--portal-color-brand));
}


.portal-category-submenu .portal-category-item > a:hover,
.portal-category-submenu .portal-category-item > a:focus {
    background: var(--portal-color-surface-alt);
    color: var(--portal-color-ink);
}


@media (max-width: 768px) {
    .portal-header__main {
        min-height: 118px;
        padding: 16px;
    }


    .portal-header__logo--primary {
        max-height: 88px;
    }


    .portal-header__logo--original-rectangular {
        width: min(100%, 300px);
        max-height: none;
    }


    .portal-header__logo--original-white {
        width: min(100%, 360px);
        height: 88px;
    }
}


/* Navegación editorial */
.portal-header__category-list > .portal-category-item > .portal-category-link,
.portal-header-sticky__category-list > .portal-category-item > .portal-category-link {
    display: inline-flex;
    align-items: center;
    min-height: 58px;
    padding: 0 10px;
    border-radius: 4px;
    transition:
        color var(--portal-transition-fast),
        background-color var(--portal-transition-fast);
}


.portal-header-sticky__category-list > .portal-category-item > .portal-category-link {
    min-height: 60px;
}


.portal-header__category-list > .portal-category-item:hover > .portal-category-link,
.portal-header__category-list > .portal-category-item:focus-within > .portal-category-link,
.portal-header-sticky__category-list > .portal-category-item:hover > .portal-category-link,
.portal-header-sticky__category-list > .portal-category-item:focus-within > .portal-category-link {
    background: rgba(255, 255, 255, 0.08);
    color: var(--portal-color-brand);
}


.portal-header__category-list > .portal-category-item > .portal-category-link::after,
.portal-header-sticky__category-list > .portal-category-item > .portal-category-link::after {
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
}


.portal-category-submenu {
    top: 100%;
    min-width: 230px;
    padding: 8px;
    background: var(--portal-color-charcoal);
    border: 1px solid rgba(255, 212, 0, 0.28);
    border-top: 3px solid var(--portal-color-brand);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
    transform: translateY(6px);
}


.portal-category-submenu .portal-category-submenu {
    top: -11px;
    border-radius: 8px;
}


.portal-category-submenu .portal-category-item > a {
    position: relative;
    padding: 12px 14px 12px 34px;
    border: 0;
    border-radius: 5px;
    color: var(--portal-color-text-inverse);
    transition:
        color var(--portal-transition-fast),
        background-color var(--portal-transition-fast),
        transform var(--portal-transition-fast);
}


.portal-category-submenu .portal-category-item > a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--portal-current-category, var(--portal-color-brand));
    transform: translateY(-50%);
}


.portal-category-submenu .portal-category-item > a:hover,
.portal-category-submenu .portal-category-item > a:focus {
    background: rgba(255, 255, 255, 0.1);
    color: var(--portal-color-brand);
    transform: translateX(2px);
}


.portal-category-submenu .portal-category-item + .portal-category-item {
    margin-top: 2px;
}


body.portal-search-is-open {
    overflow: hidden;
}


body.portal-menu-is-open {
    overflow: hidden;
}


.portal-mobile-menu[hidden] {
    display: none;
}


.portal-mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 1300;
    font-family: var(--portal-font-sans);
}


.portal-mobile-menu__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(11, 11, 11, 0.72);
}


.portal-mobile-menu__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(88vw, 420px);
    height: 100%;
    overflow-y: auto;
    padding: 24px;
    background: var(--portal-color-ink);
    border-left: 4px solid var(--portal-color-brand);
    box-shadow: -18px 0 50px rgba(0, 0, 0, 0.32);
}


.portal-mobile-menu__header {
    display: flex;
    margin-bottom: 18px;
    padding-bottom: 16px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}


.portal-mobile-menu__header p {
    margin: 0;
    color: var(--portal-color-text-inverse);
    font-family: var(--portal-font-display);
    font-size: 20px;
    font-weight: 700;
}


.portal-mobile-menu__close {
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    background: transparent;
    color: var(--portal-color-text-inverse);
    font-size: 28px;
    cursor: pointer;
}


.portal-mobile-menu__list,
.portal-mobile-menu__list .portal-category-submenu {
    position: static;
    display: block;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    list-style: none;
}


.portal-mobile-menu__list > .portal-category-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}


.portal-mobile-menu__list .portal-category-link {
    display: block;
    padding: 15px 4px;
    color: var(--portal-color-text-inverse);
    font-size: 16px;
    font-weight: 650;
    line-height: 1.25;
    text-decoration: none;
}


.portal-mobile-menu__list > .portal-category-item > .portal-category-link {
    border-left: 4px solid var(--portal-current-category, var(--portal-color-brand));
    padding-left: 14px;
}


.portal-mobile-menu__list .portal-category-submenu {
    padding: 0 0 10px 18px;
}


.portal-mobile-menu__list .portal-category-submenu .portal-category-link {
    padding: 9px 12px;
    color: rgba(255, 255, 255, 0.74);
    font-size: 14px;
}


.portal-mobile-menu__list .portal-category-submenu .portal-category-link::before {
    display: none;
}


.portal-mobile-menu__list .portal-category-link:hover,
.portal-mobile-menu__list .portal-category-link:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: var(--portal-color-brand);
}


.portal-search-dialog[hidden] {
    display: none;
}


.portal-search-dialog {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: start center;
    padding: 120px 24px 32px;
    font-family: var(--portal-font-sans);
}


.portal-search-dialog__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(11, 11, 11, 0.82);
    cursor: default;
}


.portal-search-dialog__panel {
    position: relative;
    width: min(100%, 760px);
    padding: 44px;
    border-top: 5px solid var(--portal-color-brand);
    border-radius: 0 0 10px 10px;
    background: var(--portal-color-surface);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}


.portal-search-dialog__close {
    position: absolute;
    top: 14px;
    right: 16px;
    display: grid;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--portal-color-ink);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}


.portal-search-dialog__close:hover,
.portal-search-dialog__close:focus-visible {
    background: var(--portal-color-brand);
}


.portal-search-dialog__eyebrow {
    margin: 0 0 8px;
    color: var(--portal-color-mustard, #9a7600);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}


.portal-search-dialog__title {
    margin: 0 52px 28px 0;
    color: var(--portal-color-title, #111111);
    font-family: var(--portal-font-display);
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.1;
}


.portal-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}


.portal-search-form__input {
    min-width: 0;
    height: 54px;
    padding: 0 18px;
    border: 2px solid var(--portal-color-border, #d9d6cb);
    border-radius: 5px;
    background: #ffffff;
    color: var(--portal-color-text, #252525);
    font-size: 17px;
}


.portal-search-form__input:focus {
    border-color: var(--portal-color-brand);
    outline: 3px solid rgba(255, 212, 0, 0.25);
}


.portal-search-form__submit {
    min-height: 54px;
    padding: 0 26px;
    border: 2px solid var(--portal-color-ink);
    border-radius: 5px;
    background: var(--portal-color-ink);
    color: var(--portal-color-text-inverse);
    font-weight: 800;
    cursor: pointer;
    transition:
        color var(--portal-transition-fast),
        background-color var(--portal-transition-fast),
        transform var(--portal-transition-fast);
}


.portal-search-form__submit:hover,
.portal-search-form__submit:focus-visible {
    background: var(--portal-color-brand);
    color: var(--portal-color-ink);
    transform: translateY(-1px);
}


@media (max-width: 600px) {
    .portal-search-dialog {
        padding: 80px 16px 24px;
    }


    .portal-search-dialog__panel {
        padding: 36px 22px 24px;
    }


    .portal-search-form {
        grid-template-columns: 1fr;
    }
}


@media (min-width: 1401px) {
    .portal-header-sticky__inner {
        grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
        grid-template-rows: 60px;
        grid-auto-flow: row;
        column-gap: clamp(12px, 1.8vw, 26px);
    }

    .portal-header-sticky__menu-toggle,
    .portal-header-sticky__mobile-search {
        display: none;
    }

    .portal-header-sticky__nav--left {
        grid-column: 1;
        grid-row: 1;
    }

    .portal-header-sticky__brand {
        grid-column: 2;
        grid-row: 1;
    }

    .portal-header-sticky__nav--right {
        grid-column: 3;
        grid-row: 1;
    }

    .portal-header-sticky__nav {
        min-width: 0;
        gap: 0;
        flex-wrap: nowrap;
    }

    .portal-header-sticky__category-list {
        min-width: 0;
        gap: clamp(2px, 0.45vw, 7px);
        flex-wrap: nowrap;
    }

    .portal-header-sticky__category-list > .portal-category-item {
        flex: 0 0 auto;
    }

    .portal-header-sticky__category-list > .portal-category-item > .portal-category-link {
        padding-right: clamp(2px, 0.35vw, 5px);
        padding-left: clamp(2px, 0.35vw, 5px);
        font-size: clamp(11px, 0.88vw, 13px);
    }

    .portal-header-sticky__nav--right .portal-header-sticky__search {
        flex: 0 0 34px;
        width: 34px;
        margin-left: 8px;
    }
}


@media (max-width: 1400px) {
    .portal-header__navigation-inner,
    .portal-header-sticky__inner {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 12px;
    }


    .portal-menu-toggle,
    .portal-header-sticky__mobile-search {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }


    .portal-menu-toggle {
        flex-direction: column;
    }


    .portal-header__menu-toggle {
        color: var(--portal-color-text-inverse);
    }


    .portal-header__categories,
    .portal-header-sticky__nav {
        display: none;
    }


    .portal-header__search {
        grid-column: 3;
    }


    .portal-header-sticky__menu-toggle {
        grid-column: 1;
        color: var(--portal-color-text-inverse);
    }


    .portal-header-sticky__brand {
        grid-column: 2;
        grid-row: 1;
    }


    .portal-header-sticky__mobile-search {
        grid-column: 3;
        grid-row: 1;
    }
}


@media (max-width: 600px) {
    .portal-header__navigation-inner,
    .portal-header-sticky__inner {
        min-height: 54px;
        padding: 0 14px;
    }


    .portal-header-sticky__logo {
        width: 38px;
        height: 38px;
    }


    .portal-mobile-menu__panel {
        width: min(92vw, 380px);
        padding: 20px 18px;
    }
}
