:root {
    --leu-red: #d02d27;
    --leu-ink: #000029;
    --leu-white: #fff;
    --leu-wide-gutter: clamp(20px, 1.875vw, 36px);
    --leu-header-height: clamp(100px, 13.25vh, 144px);
    --leu-nav-indent: clamp(132px, 10.625vw, 180px);
    font-family: 'Roboto', sans-serif;
    color: var(--leu-ink);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 280px;
    margin: 0;
    padding-top: var(--leu-header-height);
    color: var(--leu-ink);
    background: var(--leu-white);
    font-family: 'Roboto', sans-serif;
}

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

body.admin-bar {
    --leu-adminbar-height: 32px;
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 5px;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link:focus {
    z-index: 100001;
    top: 8px;
    left: 8px;
    width: auto;
    height: auto;
    padding: 12px 18px;
    margin: 0;
    clip: auto;
    background: var(--leu-white);
    color: var(--leu-ink);
}

/* Os dois contêineres reutilizáveis do projeto. */
.container--fluid {
    width: 100%;
    padding-inline: var(--leu-wide-gutter);
}

.container--content {
    width: min(100% - 2 * var(--leu-wide-gutter), 1640px);
    margin-inline: auto;
}

/* Cabeçalho: fixo, com expansão sobre o conteúdo. */
.site-header {
    position: fixed;
    z-index: 1000;
    inset: 0 0 auto;
    height: var(--leu-header-height);
    overflow: hidden;
    background: var(--leu-red);
    color: var(--leu-white);
    transition: height 260ms cubic-bezier(.22, 1, .36, 1);
}

.site-header.is-expanded {
    height: var(--leu-header-expanded-height, clamp(238px, 34.6dvh, 360px));
}

body.admin-bar .site-header {
    top: var(--leu-adminbar-height);
}

.has-gsap .site-header {
    transition: none;
}

.site-header__inner {
    position: relative;
    height: 100%;
}

.site-header__top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--leu-header-height);
    padding-block: 0;
}

.site-header__title {
    display: inline-flex;
    flex-direction: column;
    flex: none;
    color: var(--leu-white);
    font-size: clamp(21px, 1.5625vw, 23px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.02em;
    text-decoration: none;
}

.site-header__title span {
    display: block;
}

.site-header__tools {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-header__logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: clamp(82px, 6vw, 114px);
    height: clamp(72px, 9.8vh, 106px);
    color: var(--leu-white);
    text-decoration: none;
}

.site-header__logo,
.site-header__logo-link svg {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.site-header__logo-fallback {
    font-size: clamp(26px, 3vw, 48px);
    font-weight: 700;
    line-height: 1;
}

.site-header__navigation {
    position: absolute;
    top: clamp(20px, 2.8vh, 30px);
    left: calc(var(--leu-wide-gutter) + var(--leu-nav-indent));
    z-index: 3;
    max-width: min(60vw, 850px);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 220ms ease, visibility 0s linear 220ms;
}

.site-header.is-expanded .site-header__navigation {
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition-delay: 40ms, 40ms, 0s;
}

.has-gsap .site-header__navigation {
    transition: none;
}

.site-header__menu {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0;
    margin: 0;
    list-style: none;
}

.site-header__menu > li {
    padding: 0;
    margin: 0;
    opacity: 0;
    transform: translateY(7px);
    transition: opacity 170ms ease, transform 210ms ease;
}

.site-header.is-expanded .site-header__menu > li {
    opacity: 1;
    transform: none;
}

.site-header.is-expanded .site-header__menu > li:nth-child(2) { transition-delay: 30ms; }
.site-header.is-expanded .site-header__menu > li:nth-child(3) { transition-delay: 55ms; }
.site-header.is-expanded .site-header__menu > li:nth-child(4) { transition-delay: 80ms; }
.site-header.is-expanded .site-header__menu > li:nth-child(5) { transition-delay: 105ms; }
.site-header.is-expanded .site-header__menu > li:nth-child(6) { transition-delay: 130ms; }

.has-gsap .site-header__menu > li {
    transition: none;
}

.site-header__menu a {
    display: inline-block;
    color: var(--leu-white);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -.018em;
    text-decoration: none;
}

.site-header__menu a:hover,
.site-header__menu a:focus-visible,
.site-header__menu .current-menu-item > a,
.site-header__menu .current_page_item > a {
    font-weight: 700;
}

.site-header__menu a:focus-visible,
.site-header__menu-toggle:focus-visible,
.site-header__title:focus-visible,
.site-header__logo-link:focus-visible {
    outline-color: var(--leu-white);
}

.site-header__menu-toggle {
    display: none;
}

/* Fallback para o menu desktop caso o JavaScript esteja desativado. */
@media (min-width: 901px) and (hover: hover) {
    html:not(.has-header-js) .site-header:hover,
    html:not(.has-header-js) .site-header:focus-within {
        height: var(--leu-header-expanded-height, clamp(238px, 34.6dvh, 360px));
    }

    html:not(.has-header-js) .site-header:hover .site-header__navigation,
    html:not(.has-header-js) .site-header:focus-within .site-header__navigation {
        visibility: visible;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    html:not(.has-header-js) .site-header:hover .site-header__menu > li,
    html:not(.has-header-js) .site-header:focus-within .site-header__menu > li {
        opacity: 1;
        transform: none;
    }
}

/* Colagem: ocupa a largura inteira e a área útil abaixo da faixa vermelha. */
.home-main {
    width: 100%;
}

.home-hero {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--leu-header-height));
    height: calc(100dvh - var(--leu-header-height));
    min-height: 360px;
    overflow: hidden;
    background: #fff;
}

.home-hero__picture,
.home-hero__image {
    display: block;
    width: 100%;
    height: 100%;
}

.home-hero__image {
    object-fit: cover;
    object-position: center center;
}

/* Os arquivos e as tabelas ainda receberão o layout nas etapas seguintes. */
.publication-table-container {
    overflow-x: auto;
}

.publication-table {
    width: 100%;
    border-collapse: collapse;
}

.publication-table th,
.publication-table td {
    padding: .5rem;
    text-align: left;
}

:where(code, pre, .font-mono) {
    font-family: 'Roboto Mono', monospace;
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    :root {
        --leu-wide-gutter: 18px;
        --leu-header-height: 78px;
    }

    .site-header.is-expanded {
        height: calc(100vh - var(--leu-adminbar-height, 0px));
        height: calc(100dvh - var(--leu-adminbar-height, 0px));
    }

    .site-header__top {
        align-items: center;
        padding-block: 12px;
    }

    .site-header__title {
        font-size: clamp(15px, 3.85vw, 18px);
        line-height: 1.15;
        letter-spacing: -.015em;
    }

    .site-header__tools {
        align-items: center;
        gap: clamp(12px, 3.3vw, 20px);
    }

    .site-header__logo-link {
        width: 52px;
        height: 54px;
    }

    .site-header__logo-fallback {
        font-size: 26px;
    }

    .site-header__menu-toggle {
        display: grid;
        flex: none;
        place-items: center;
        width: 40px;
        height: 44px;
        padding: 6px;
        border: 0;
        background: transparent;
        color: var(--leu-white);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .site-header__menu-bars {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 29px;
        height: 23px;
    }

    .site-header__menu-bars span {
        display: block;
        width: 100%;
        height: 2px;
        background: currentColor;
        border-radius: 1px;
        transform-origin: center;
        transition: transform 220ms ease, opacity 140ms ease;
    }

    .site-header.is-expanded .site-header__menu-bars span:first-child {
        transform: translateY(10.5px) rotate(45deg);
    }

    .site-header.is-expanded .site-header__menu-bars span:nth-child(2) {
        opacity: 0;
    }

    .site-header.is-expanded .site-header__menu-bars span:last-child {
        transform: translateY(-10.5px) rotate(-45deg);
    }

    .site-header__navigation {
        top: calc(var(--leu-header-height) + 22px);
        right: var(--leu-wide-gutter);
        bottom: 22px;
        left: var(--leu-wide-gutter);
        max-width: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .site-header__menu {
        align-items: flex-start;
        padding-block: 4px 28px;
    }

    .site-header__menu a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding-block: 8px;
        font-size: clamp(16px, 5vw, 20px);
        line-height: 1.25;
    }

    .home-hero {
        min-height: 240px;
    }
}

@media (max-width: 782px) {
    body.admin-bar {
        --leu-adminbar-height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .site-header,
    .site-header__navigation,
    .site-header__menu > li,
    .site-header__menu-bars span {
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
}
