/* Colors */
:root {
    --cream: #f9e4c8;
    --mint: #cadfd8;
    --blue: #024269;
    --red: #d91a3d;
    --green: #0abf01;
    --ink: #5d5b71;
    --line: rgb(93 91 113 / 24%);
}

/* Style basicos */
* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: 7rem;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: "Inter", sans-serif;
    font-weight: 500;
}

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 6px;
}

::selection {
    background: var(--green);
    color: var(--cream);
}

img {
    border-radius: 10px;
    width: 250px;
    padding: 10px;
}

.organization-logos img {
    max-width: 100%;
    height: auto;
}

/* Menu floating */
.floating-menu {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0 2rem;
    flex-wrap: wrap;
    padding: 0.25rem 1rem;
    background: var(--cream);
    color: var(--ink);
}
.navigation-links {
    display: contents;
}
.mobile-navigation {
    display: none;
}
.floating-menu a,
.floating-menu summary {
    padding: 1rem 0;
    font:
        500 0.95rem/1.2 "Inter",
        sans-serif;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.floating-menu a:hover,
.floating-menu a:focus-visible,
.floating-menu summary:hover,
.floating-menu summary:focus-visible {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 0.25em;
    text-decoration-color: var(--red);
}

.editions-menu {
    position: relative;
}
.editions-menu summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    cursor: pointer;
}
.editions-menu summary::-webkit-details-marker {
    display: none;
}
.editions-menu summary::after {
    content: "";
    width: 0.4rem;
    height: 0.4rem;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: translateY(-0.1rem) rotate(45deg);
}
.editions-menu[open] summary::after {
    transform: translateY(0.1rem) rotate(225deg);
}
.editions-menu[open] summary {
    color: var(--green);
}
.editions-menu summary:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 3px;
}
.editions-submenu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 100%;
    margin: 0;
    padding: 0.5rem;
    list-style: none;
    background: var(--cream);
    border: 1px solid var(--line);
    box-shadow: 0 8px 20px #5d5b7120;
    border-radius: 5px;
}
.editions-submenu a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 5px;
}
.editions-submenu a:hover,
.editions-submenu a:focus-visible {
    background: var(--mint);
    border-radius: 5px;
}

/* Follow the visible section, with anchor highlighting when JavaScript is unavailable. */
.floating-menu a[aria-current="location"],
.floating-menu a[aria-current="page"],
html:not(.scroll-navigation) body:not(:has(:target)) .floating-menu a[href="#home"],
html:not(.scroll-navigation) body:has(#home:target) .floating-menu a[href="#home"],
html:not(.scroll-navigation) body:has(#call:target) .floating-menu a[href="#call"],
html:not(.scroll-navigation) body:has(#program:target) .floating-menu a[href="#program"],
html:not(.scroll-navigation) body:has(#travel:target) .floating-menu a[href="#travel"],
html:not(.scroll-navigation) body:has(#organization:target) .floating-menu a[href="#organization"] {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 0.4em;
    text-decoration-color: var(--green);
    text-decoration-thickness: 3px;
}

/* Header wallpaper e titulo */
.hero {
    min-height: 300px;
    min-height: min(300px, 30svh);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8rem 5vw 3rem;
    background-color: var(--mint);
    background-image: url("/img/FUNDO.jpg");
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

.hero-title {
    padding-top: 5rem;
}
/* Small uppercase labels */
.eyebrow {
    margin: 0 0 1.8rem;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    line-height: 1.6;
}
.hero .eyebrow {
    color: var(--blue);
}
h1 {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.2em 0.25em;
    margin: 0 0 1.3rem;
    color: var(--red);
    font:
        500 clamp(2.6rem, 10vw, 10rem)/1 "Inter",
        sans-serif;
    letter-spacing: -0.06em;
    text-transform: uppercase;
}

.hero {
    position: relative;
}

.hero-title {
    position: relative;
}

.hero-year {
    position: absolute;
    top: 0;
    right: 0;
    color: var(--green);
    font-family: "Inter", sans-serif;
    font-size: clamp(6rem, 6vw, 6rem);
    font-weight: 400;
    letter-spacing: -0.04em;
}

.hero-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
}
.hero-bottom p {
    margin: 0;
    font:
        italic clamp(1.3rem, 3vw, 2.4rem) "STIX Two Text",
        serif;
    color: var(--green);
}
/* Alternating sections — label first, main content second */
.left-section,
.right-section {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3rem;
    padding: 6rem 5vw;
}
.left-section {
    background: var(--mint);
}
.right-section > :first-child {
    grid-column: 1;
}
.right-section > :last-child {
    grid-column: 2 / 4;
}
.left-section > :first-child {
    grid-column: 3;
    grid-row: 1;
}
.left-section > :last-child {
    grid-column: 1 / 3;
    grid-row: 1;
}
#program {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}
#program > :first-child {
    grid-column: 2;
}
#program > :last-child {
    grid-column: 1;
}
.schedule-image {
    display: block;
    width: 100%;
    height: auto;
    padding: 0;
    border-radius: 5px;
}

main section > * {
    min-width: 0;
    overflow-wrap: anywhere;
}
/* Section headings and body text */
h2 {
    margin: 0 0 2rem;
    color: var(--blue);
    font:
        normal clamp(2rem, 4vw, 4rem)/1.05 "STIX Two Text",
        serif;
    letter-spacing: -0.045em;
}
h2 em {
    font-weight: normal;
    color: inherit;
}
main section p:not(.eyebrow) {
    max-width: 38rem;
    font-size: 1rem;
    line-height: 1.75;
    text-align: justify;
    hyphens: auto;
}
h3 {
    color: var(--blue);
}
main section li {
    max-width: 38rem;
    line-height: 1.75;
    text-align: justify;
    hyphens: auto;
}
main section .intro {
    font-size: 1.25rem;
}
/* Poster image */
#poster {
    grid-template-areas: "poster poster copy";
}
#poster > div {
    grid-area: copy;
    text-align: left;
}
#poster > .poster-image {
    grid-area: poster;
}
.poster-image {
    display: block;
    max-width: 380px;
    width: 100%;
    justify-self: center;
    box-shadow: 0 12px 35px #5d5b7120;
}
.poster-image img {
    display: block;
    width: 100%;
    height: auto;
}
/* Image preview */
.image-preview-trigger {
    cursor: zoom-in;
}
.image-preview-trigger:focus-visible,
.image-overlay-close:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 4px;
}
html.image-overlay-open,
html.image-overlay-open body {
    overflow: hidden;
}
.image-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 4.5rem 1.5rem 1.5rem;
    border: 0;
    background: transparent;
}
.image-overlay[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-overlay::backdrop {
    background: rgb(15 24 29 / 65%);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
.image-overlay img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    padding: 0;
    object-fit: contain;
    box-shadow: 0 16px 60px rgb(0 0 0 / 25%);
}
.image-overlay-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 40%);
    border-radius: 50%;
    background: rgb(0 0 0 / 30%);
    color: white;
    font: 32px/1 sans-serif;
    cursor: pointer;
}
/* Footer */
footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin: 0 5vw;
    padding: 2rem 0;
    border-top: 1px solid var(--line);
}
footer > a:first-child {
    font:
        500 1.75rem "Inter",
        sans-serif;
    color: var(--green);
    text-transform: uppercase;
}
footer > a:first-child span {
    font:
        500 0.75rem "Inter",
        sans-serif;
}
footer p,
footer > a:last-child {
    font-size: 0.75rem;
    line-height: 1.6;
}

/* Wide screens — align content within the page margins */
@media (min-width: 1600px) {
    .left-section,
    .right-section,
    .hero,
    footer {
        padding-left: max(5vw, calc((100vw - 1440px) / 2));
        padding-right: max(5vw, calc((100vw - 1440px) / 2));
    }
    footer {
        margin: 0;
    }
}
/* Small screens — wrap the menu and stack section content */
@media (max-width: 800px) {
    #poster {
        grid-template-areas:
            "copy"
            "poster";
    }
    html {
        scroll-padding-top: 9rem;
    }
    .floating-menu {
        gap: 0 1rem;
        padding: 0.2rem 1rem;
    }
    .floating-menu a,
    .floating-menu summary {
        font-size: 0.85rem;
    }
    .hero {
        min-height: 580px;
        padding-top: 10rem;
        padding-bottom: 2rem;
    }
    .hero-title {
        padding-top: 6rem;
    }
    .hero-bottom {
        align-items: flex-start;
        flex-direction: column;
    }
    .left-section,
    .right-section,
    #program {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    #program > :first-child,
    #program > :last-child,
    main .left-section > *,
    main .right-section > * {
        grid-column: 1;
        grid-row: auto;
    }
    #program > :last-child {
        grid-row: 1;
    }
    #program > :first-child {
        grid-row: 2;
    }
    footer {
        flex-wrap: wrap;
        gap: 1rem;
    }
    footer p {
        width: 100%;
        order: 3;
        margin: 0;
    }
}

/* Smartphone - so uns ajustes */
@media (max-width: 600px) {
    h1 {
        flex-direction: column;
        align-items: flex-start;
    }
    html {
        scroll-padding-top: 5rem;
    }
    .floating-menu {
        display: block;
        padding: 0.5rem 5vw;
        border-bottom: 1px solid var(--line);
    }
    .navigation-links {
        display: none;
    }
    .mobile-navigation {
        display: block;
    }
    .floating-menu .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 44px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--green);
        font:
            500 1rem/1.2 "Inter",
            sans-serif;
        cursor: pointer;
    }
    .mobile-menu-toggle {
        list-style: none;
    }
    .mobile-menu-toggle::-webkit-details-marker {
        display: none;
    }
    .mobile-menu-toggle::after {
        content: "☰";
    }
    .mobile-navigation[open] > .mobile-menu-toggle::after {
        content: "×";
    }
    .mobile-menu-toggle:focus-visible {
        outline: 3px solid var(--green);
        outline-offset: 3px;
    }
    .mobile-navigation-links {
        display: flex;
        flex-direction: column;
        max-height: calc(100svh - 70px);
        overflow-y: auto;
        padding: 0.5rem 0;
    }
    .floating-menu a,
    .floating-menu summary {
        display: flex;
        align-items: center;
        min-height: 48px;
        padding: 0.75rem 0.5rem;
        font-size: 0.95rem;
        white-space: normal;
    }
    .editions-menu summary {
        justify-content: space-between;
    }
    .editions-submenu {
        position: static;
        padding: 0 0 0 1rem;
        border: 0;
        border-left: 2px solid var(--green);
        box-shadow: none;
        border-radius: 5px;
    }
    .mobile-navigation-links a:focus-visible,
    .editions-menu summary:focus-visible {
        outline-offset: -3px;
    }
}

/* Accessibility — respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
