:root {
    --logo-blue: #0069b3;

    --top-menu-active-blue: #8bc4ed;
    --top-menu-active-orange: rgb(252, 185, 126);

    --menu-bg: gray;
    --link-blue: #004a82;
    --link-blue-hover: #0069b3;

    --border-color-decent: #cdcdcd;
    --border-color-hover: black;

    --logo-caption-color-decent: #555;
    --logo-caption-color-hover: black;

    --wide-content-width: 1250px;
    --wide-content-inner-width: 1050px;

    --heading-blue: #003d70;
    --text-body: #2c2c3a;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    color: var(--text-body);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

header.site-header {
    max-width: var(--wide-content-width);
    margin: 0 auto;
    padding: 0 20px;

    .site-header-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 75px;

        .site-header-logo-container {
            order: 2;
            max-width: 100%;
            display: flex;
            align-items: center;
            margin: 0 0 0.5em 0;

            >img,
            >a>img {
                width: 180px;
                height: auto;
                max-width: 100%;
                position: relative;
                top: 10px;
            }
        }

        .site-header-info-container {
            padding: 2em 0 1em 5px;
            line-height: 1.6;
            font-size: 0.95rem;

            .site-header-info {
                padding: 1em;
                border: 2px transparent solid;
            }

            strong {
                color: var(--heading-blue);
                font-size: 1rem;
            }

            address {
                font-style: normal;
                margin-top: 0.25em;
            }

            a {
                color: var(--logo-blue);
                text-decoration: none;

                &:hover {
                    text-decoration: underline;
                }
            }
        }

        &.page-home {
            .site-header-logo-container {
                display: none;
            }
        }

        @media screen and (max-width: 800px) {
            flex-direction: column;
            margin: 1em 0 2em 0;

            &.page-home .site-header-logo-container {
                display: flex;
            }

            .site-header-logo-container {
                margin: 0;
            }

            .site-header-info-container {
                display: none;
            }

        }

    }


    nav.site-header-menu {
        display: block;
        background-color: white;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
        overflow: visible;
        border-radius: 40px;
        z-index: 1;
        position: relative;

        .site-header-menu-toggle {
            display: none;
        }

        ul {
            list-style-type: none;
            padding: 0;
            margin: 0;
            display: flex;
            align-items: stretch;
            justify-content: flex-start;
            flex-wrap: wrap;

            li {
                padding: 0;
                display: flex;

                a {
                    display: flex;
                    align-items: center;
                    gap: 0.4em;
                    padding: 1.2ex 2.2ex 1ex 2.2ex;
                    color: #333333;
                    text-transform: uppercase;
                    text-decoration: none;
                    line-height: 1.2em;
                    font-size: 0.85rem;
                    font-weight: 600;
                    letter-spacing: 0.03em;
                    position: relative;
                    transition: background 0.18s ease, color 0.15s ease;

                    .nav-icon {
                        flex-shrink: 0;
                        opacity: 0.75;
                    }

                    svg+.menu-item-label {
                        display: none;
                    }

                    &:hover:not(.active) {
                        background: linear-gradient(to bottom, white 0%, #e8f4fc);
                        color: var(--logo-blue);
                    }
                }

                &:first-child {
                    padding-left: 2em;
                }

                &:nth-child(2n + 1) {
                    a.active {
                        background: linear-gradient(to bottom, white -3px, var(--top-menu-active-blue));
                        color: var(--heading-blue);
                    }
                }

                &:nth-child(2n + 0) {
                    a.active {
                        background: linear-gradient(to bottom, white -3px, var(--top-menu-active-orange));
                    }
                }
            }
        }

        @media screen and (max-width: 1250px) {
            border-radius: 12px;
            overflow: hidden;

            .site-header-menu-toggle {
                display: flex;
                align-items: center;
                justify-content: space-between;
                width: 100%;
                padding: 0.85em 1.4em;
                background: none;
                border: none;
                cursor: pointer;
                font-weight: 600;
                font-size: 0.9rem;
                text-transform: uppercase;
                color: #333;
                letter-spacing: 0.04em;
                box-sizing: border-box;

                .icon-close {
                    display: none;
                }
            }

            &.open {
                .site-header-menu-toggle {
                    border-bottom: 1px solid #e8e8e8;

                    .icon-hamburger {
                        display: none;
                    }

                    .icon-close {
                        display: block;
                    }
                }
            }

            ul {
                flex-direction: column;
                align-items: stretch;
                flex-wrap: nowrap;
                max-height: 0;
                overflow: hidden;
                transition: max-height 0.25s ease-out;

                li {
                    padding: 0;

                    &:first-child {
                        padding-left: 0;
                    }

                    a {
                        width: 100%;
                        padding: 0.85em 1.4em;
                        border-radius: 0;
                        font-size: 0.9rem;

                        svg+.menu-item-label {
                            display: block;
                        }
                    }

                    &:last-child a {
                        border-radius: 0 0 12px 12px;
                    }
                }
            }

            &.open ul {
                max-height: 600px;
                transition: max-height 0.3s ease-in;
            }
        }
    }

}

footer.site-footer {
    background: #1e2535;

    .footer-content {
        max-width: var(--wide-content-width);
        margin: 0 auto;
        padding: 4rem 2.5rem;
        box-sizing: border-box;

        min-height: 200px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 3rem;

        .footer-menu-container {

            ul {
                list-style-type: none;
                margin: 0;
                padding: 0 1em 0 0;
                display: flex;
                flex-direction: column;
                gap: 0.5rem;
                text-align: right;

                li {
                    a {
                        text-decoration: none;
                        color: #b0bec5;
                        font-size: 0.9rem;
                        transition: color 0.15s;

                        &:hover {
                            color: white;
                            text-decoration: none;
                        }

                        &.active {
                            font-weight: 600;
                            color: white;
                        }
                    }
                }
            }
        }

        .footer-logo-container {
            padding-right: 20px;
            align-self: flex-end;
            opacity: 0.85;

            .footer-logo {
                width: 200px;
                filter: drop-shadow(0 0 1px white);
            }
        }
    }

    @media screen and (max-width: 800px) {
        .footer-content {
            padding: 3rem 1.5rem;

            .footer-logo-container {
                .footer-logo {
                    width: 100px;
                }
            }
        }
    }
}

/* ── Main content typography ── */

main {
    a {
        color: var(--link-blue);
        transition: color 0.15s;

        &:hover {
            color: var(--link-blue-hover);
        }
    }

    h1 {
        font-size: 2.1rem;
        font-weight: 700;
        color: var(--heading-blue);
        line-height: 1.2;
        margin-top: 0;
        margin-bottom: 0.6em;
        letter-spacing: -0.01em;
    }

    h2 {
        font-size: 1.45rem;
        font-weight: 600;
        color: var(--heading-blue);
        line-height: 1.3;
        margin-top: 1.5em;
        margin-bottom: 0.8em;
        padding-bottom: 0.4em;
        border-bottom: 2px solid rgba(0, 105, 179, 0.2);
    }

    h3 {
        font-size: 1.15rem;
        font-weight: 600;
        color: var(--heading-blue);
        line-height: 1.35;
        margin-top: 1.75em;
        margin-bottom: 0.5em;
    }

    h4 {
        font-size: 1rem;
        font-weight: 600;
        color: var(--heading-blue);
        margin-top: 1.5em;
        margin-bottom: 0.4em;
    }

    p {
        margin: 0 0 1em 0;
    }

    ul,
    ol {
        padding-left: 1.5em;
        margin-bottom: 1em;

        li {
            margin-bottom: 0.35em;
            line-height: 1.6;
        }
    }
}

/* ── Rich text (TipTap) content blocks ── */

.page-content {
    max-width: 80ch;
    margin-inline: auto;

    p {
        line-height: 1.75;
    }
}

/* ── Section backgrounds ── */

.section-back {
    &:first-of-type {
        padding-top: 7rem;
        margin-top: -7rem;
        min-height: 60vh;
    }
}

.section-back-blue {
    background-color: #e8f4fc;
    background: linear-gradient(to left, transparent 0, white 50%, transparent 100%),
        linear-gradient(to top, #8edffc 0px, #e8f4fc 200px, #e8f4fc 100%),
        #e8f4fc;

    &:first-of-type {
        background: linear-gradient(to left, transparent 0, white 50%, transparent 100%),
            linear-gradient(to bottom, white 0px, transparent 7rem, transparent 100%),
            linear-gradient(to top, #8edffc 0px, #e8f4fc 200px, #e8f4fc 100%),
            #e8f4fc;
    }
}

.section-back-orange {
    background-color: #fff6ee;
    background: linear-gradient(to left, transparent 0, white 50%, transparent 100%),
        linear-gradient(to top, #ffd0a8 0px, #fff6ee 200px, #fff6ee 100%),
        #fff6ee;

    &:first-of-type {
        background: linear-gradient(to left, transparent 0, white 50%, transparent 100%),
            linear-gradient(to bottom, white 0px, transparent 7rem, transparent 100%),
            linear-gradient(to top, #ffd0a8 0px, #fff6ee 200px, #fff6ee 100%),
            #fff6ee;
    }
}

.top-section {
    max-width: var(--wide-content-inner-width);
    margin: 0 auto;
    padding: 3em 1.5em 5em 1.5em;
    box-sizing: border-box;
}

/* -- Index --*/

.index-layout {

    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1em;

    .index-left {
        flex: 1 1 490px;
        max-width: 100%;
        box-sizing: border-box;

        h1 {
            text-wrap: balance;
        }
    }

    .index-right {
        padding: 3em 1em 1em 1em;
        max-width: 100%;
        box-sizing: border-box;
        flex: 1 1 calc(450px + 2em);
        display: flex;
        align-items: center;
        justify-content: center;

        img {
            width: 450px;
            max-width: 100%;
        }
    }
}

/* ── Organizer / sponsor logo grids ── */

.organizer-logos,
.sponsor-logos {
    display: flex;
    margin: 2em 0;
    flex-wrap: wrap;
    justify-content: center;

    .logo-wrapper,
    .logo-wrapper-main {
        text-decoration: none;
        color: var(--logo-caption-color-decent);
        transition: color 0.15s;

        &:hover {
            border-color: var(--border-color-hover);

            figure figcaption {
                color: var(--logo-caption-color-hover);
                text-decoration: underline;
            }
        }
    }

    .logo-wrapper {
        background-color: white;
        width: 220px;
        height: 220px;
        display: block;
        border: 1px var(--border-color-decent) solid;
        border-radius: 10px;
        box-sizing: border-box;
        flex: 0 0 auto;
        transition: box-shadow 0.18s ease, border-color 0.18s ease;

        figure {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 1rem;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;

            div.logo-img-container {
                align-self: stretch;
                flex: 1;
                display: flex;
                justify-content: center;
                align-items: center;

                img {
                    max-width: 100%;
                    max-height: 100%;
                }
            }

            figcaption {
                text-align: center;
                font-size: 0.82rem;
                color: var(--logo-caption-color-decent);
                text-wrap: balance;
            }
        }

        &:hover {
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
            border-color: #aaa;
        }

        &.larger {
            max-width: 100%;
            aspect-ratio: 1 / 1;
            width: 420px;
            height: auto;

            figure {
                div.logo-img-container {
                    padding: 1em;
                    position: relative;
                    top: -1em;
                }
            }
        }
    }

    .logo-wrapper-main {
        figure {

            margin-inline: 0;

            img {
                width: 970px;
                max-width: 100%;
                border-radius: 8px;
                border: 1px var(--border-color-decent) solid;
                transition: border-color 0.15s, box-shadow 0.15s;
            }

            figcaption {
                padding: 0.75ex 0;
                text-align: center;
                font-size: 0.9rem;
            }
        }

        &:hover {
            figure img {
                border-color: #888;
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
            }
        }
    }
}

.organizer-logos {
    gap: 1.5em;
    margin: 1em 0;

    @media screen and (max-width: 1000px) {
        gap: 1em;
        margin: 1.5em 0;
    }
}

.sponsor-logos {
    gap: 1em;
}

/* ── Venue photo gallery ── */

.venue-photos {
    margin-top: 4em;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;

    .photo {
        width: 482px;
        max-width: 100%;
        aspect-ratio: 482 / 321;
        object-fit: cover;
        border-radius: 8px;
        border: 1px solid #cdcdcd;
        background-color: #e0e0e0;
    }
}

/* ── Embedded map ── */

.embed-map {
    width: 100%;
    aspect-ratio: 2;
    padding: 0 3em;
    margin-top: 3em;
    box-sizing: border-box;

    iframe {
        border-radius: 10px;
        width: 100%;
        height: 100%;
        display: block;
    }
}

/* ── Visitor info list (social page) ── */

.visitor-info-list {
    list-style: none;
    padding: 0;
    margin: 1.5em 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.6em;

    li {
        background: rgba(255, 255, 255, 0.65);
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 8px;
        padding: 0.6em 1em;
        font-size: 0.93rem;
        backdrop-filter: blur(4px);
        margin-bottom: 0;
    }
}

/* -- Registration -- */

.page-registration {
    .page-content p {
        max-width: 70ch;
        text-wrap: balance;
    }
}

/* ── Archive list ── */

.archive-list {
    list-style: none;
    padding: 0;
    margin: 1.5em 0;

    li {
        margin: 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.07);

        &:first-child {
            border-top: 1px solid rgba(0, 0, 0, 0.07);
        }

        a {
            display: block;
            padding: 0.7em 0.25em;
            font-weight: 500;
            text-decoration: none;
            color: var(--link-blue);
            transition: color 0.15s;

            &:hover {
                color: var(--link-blue-hover);
            }
        }
    }
}

@media screen and (max-width: 600px) {
    .embed-map {
        padding: 0 0;
        aspect-ratio: 1.2;
    }

    main {
        h1 {
            font-size: 1.6rem;
        }

        h2 {
            font-size: 1.25rem;
        }
    }
}

@keyframes gradient-shift {
    0% {
        background-position: 0 0;
    }

    50% {
        background-position: 1000px 0;
    }

    100% {
        background-position: 0 0;
    }
}
