* {
    box-sizing: border-box;
}

:root {
    --paper: #efebe2;
}
html, body {
    background-color: #f4ece1 !important;
}

html {
    scroll-behavior: smooth;
    background-color: #ECEBE9 !important; 
}

body {
    margin: 0;
    background: #ECEBE9;
    color: #111;
    font-family: "DM Sans", Arial, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
}

.container {
    width: min(calc(100% - 48px), 1240px);
    margin: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(247, 243, 235, .94);
    border-bottom: 1px solid rgba(17, 17, 17, .14);
    backdrop-filter: blur(14px);
}

.navbar {
    width: min(calc(100% - 48px), 1240px);
    min-height: 76px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: #111;
    color: #fff;
    font-family: "Instrument Serif", Georgia, serif;
    font-size: 23px;
}

.brand-text {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.brand-text strong {
    font-size: 14px;
    letter-spacing: .12em;
}

.brand-text small {
    color: #7b1e2b;
    font-size: 11px;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-menu > a {
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.nav-menu > a:not(.nav-register) {
    color: #4f493f;
}

.nav-menu > a:not(.nav-register):hover,
.nav-menu > a:not(.nav-register).active {
    color: #7b1e2b;
}

.nav-register {
    min-height: 42px;
    padding: 0 17px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #111;
    color: #fff;
    transition: all 0.3s ease-in-out;
}

.nav-register:hover {
    background: #7b1e2b;
    transform: translateY(-3px); 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-toggle {
    display: none;
    background: 0;
    border: 0;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 1px;
    background: #111;
    margin: 5px;
}

.events-hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(17, 17, 17, .14);
}

.events-grid {
    position: absolute;
    inset: 0;
    opacity: .5;
    background-image: linear-gradient(rgba(17, 17, 17, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(17, 17, 17, .045) 1px, transparent 1px);
    background-size: 70px 70px;
    mask-image: radial-gradient(circle at 72% 45%, black, transparent 68%);
}

.events-hero .container {
    position: relative;
}

.section-kicker {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    color: #756d61;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .15em;
}

.events-hero h1 {
    max-width: 850px;
    margin: 0 0 25px;
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(4rem, 8vw, 8rem);
    font-weight: 400;
    line-height: .84;
    letter-spacing: -.045em;
}

.events-hero h1 em {
    color: #7b1e2b;
}

.events-hero p {
    max-width: 600px;
    margin: 0;
    color: #5c5344;
    font-size: 17px;
}

.events-list {
    padding: 100px 0 130px;
}

.event-detail {
    display: grid;
    grid-template-columns: .85fr 1.15fr;
    gap: 90px;
    align-items: center;
    min-height: 570px;
    padding: 90px 0;
    border-bottom: 1px solid rgba(17, 17, 17, .14);
}

.event-detail.reverse {
    grid-template-columns: 1.15fr .85fr;
}

.reverse .event-info {
    order: 2;
}

.reverse .event-media {
    order: 1;
}

.event-number {
    color: #7b1e2b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .15em;
    margin-bottom: 22px;
}

.event-kicker,
.media-label {
    color: #756d61;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .15em;
}

.event-kicker {
    margin-bottom: 12px;
}

.event-info h2 {
    margin: 0 0 20px;
    font-family: "Instrument Serif", Georgia, serif;
    font-size: clamp(3.2rem, 5vw, 5.8rem);
    font-weight: 400;
    line-height: .9;
    letter-spacing: -.04em;
}

.event-info > p {
    max-width: 520px;
    margin: 0 0 35px;
    color: #5c5344;
    font-size: 17px;
}

.submission {
    padding-left: 18px;
    margin-bottom: 35px;
    border-left: 2px solid #7b1e2b;
    display: flex;
    flex-direction: column;
}

.submission span {
    color: #756d61;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .14em;
}

.submission strong {
    font-size: 15px;
}

.event-link {
    display: inline-flex;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.event-link:hover {
    color: #7b1e2b;
}

.event-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 26px;
}

.guidelines-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 20px;
    background: #7b1e2b;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-decoration: none;
    border: 1px solid #7b1e2b;
    transition: all .3s ease-in-out;
}

.guidelines-link:hover {
    background: #5c1620;
    border-color: #5c1620;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

.guidelines-link span {
    font-size: 13px;
}

.event-media {
    min-height: 430px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.media-label {
    margin-bottom: 12px;
}

.slideshow {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #ddd;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.035);
    transition: opacity .8s ease, transform 1.1s ease;
}

.slide.active {
    opacity: 1;
    transform: scale(1);
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slideshow button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: 1px solid #fff;
    background: rgba(17, 17, 17, .58);
    color: #fff;
    cursor: pointer;
}

.slideshow .prev {
    left: 18px;
}

.slideshow .next {
    right: 18px;
}

.dots {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
}

.dots button {
    position: static;
    width: 7px;
    height: 7px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid #fff;
    background: transparent;
    transform: none;
}

.dots button.active {
    background: #fff;
}

.pdf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pdf-card {
    min-height: 150px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid rgba(17, 17, 17, .14);
    background: rgba(255, 255, 255, .55);
    text-decoration: none;
}

.pdf-card:hover {
    background: #fff;
    border-color: #7b1e2b;
    transform: translateY(-3px);
}

.pdf-card b {
    color: #7b1e2b;
    font-size: 10px;
}

.pdf-card strong {
    font-size: 13px;
}

.pdf-card small {
    color: #756d61;
    font-size: 10px;
}

.symbolic {
    border: 1px solid rgba(17, 17, 17, .14);
    padding: 50px;
    background: linear-gradient(135deg, rgba(123, 30, 43, .07), transparent);
}

.symbols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(360px, 80%);
    margin: auto;
}

.symbols span {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid rgba(17, 17, 17, .14);
    font-family: "Instrument Serif", Georgia, serif;
    font-size: 60px;
    color: #7b1e2b;
}

.symbolic small {
    margin: 25px auto 0;
    color: #756d61;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .15em;
}

.sudoku {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: min(360px, 80%);
    margin: auto;
    border: 2px solid #111;
}

.sudoku span {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 1px solid rgba(17, 17, 17, .14);
    font-family: "Instrument Serif", Georgia, serif;
    font-size: 28px;
}

.footer {
    padding: 25px 0;
    background: #111;
    color: #fff;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 25px;
    font-size: 10px;
}

.footer a {
    text-decoration: none;
}

.footer a:hover {
    color: #7b1e2b;
}

/* --- Media Queries --- */

@media (max-width: 900px) {
    /* --- KEEPING YOUR EXISTING NAV STYLES --- */
    .nav-menu {
        display: flex; /* Keep it flex so the internal layout stays ready */
        position: absolute;
        top: 76px;
        left: 0;
        right: 0;
        padding: 20px 24px;
        background: #f7f3eb;
        border-bottom: 1px solid rgba(17, 17, 17, .14);
        flex-direction: column;
        align-items: stretch;
        z-index: 99;

        /* The Animation Magic */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-15px); /* Starts slightly shifted up */
        transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    }
    
    .nav-menu.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0); /* Slides down into its natural place */
    }
    
    .nav-toggle {
        display: block;
    }
    
    /* --- NEW REORDERED MOBILE EVENT LAYOUT --- */
    .event-detail, 
    .event-detail.reverse {
        display: flex;
        flex-direction: column;
        gap: 25px; 
        padding: 70px 0; /* Kept your original mobile padding */
    }

    .event-info {
        display: contents; 
    }

    .event-info > .event-number,
    .event-info > .event-kicker,
    .event-info > h2,
    .event-info > p {
        order: 1;
        margin-bottom: 0; 
    }

    .event-media {
        order: 2;
        width: 80%; 
        margin: 20px auto; 
        min-height: auto;
    }

    .event-info > .media-label,
    .event-info > .pdf-grid {
        order: 3;
        width: 100%;
    }

    .event-info > .submission,
    .event-info > .event-actions {
        order: 4;
        margin-top: 15px;
    }
}

@media(max-width: 600px) {
    .container,
    .navbar {
        width: calc(100% - 32px);
    }
    
    .events-hero {
        min-height: 430px;
    }
    
    .events-hero h1 {
        font-size: clamp(3.5rem, 16vw, 5rem);
    }
    
    .events-list {
        padding: 55px 0 80px;
    }
    
    .event-info h2 {
        font-size: clamp(3rem, 15vw, 4.5rem);
    }
    
    .event-info > p {
        font-size: 15px;
    }
    
    .event-actions {
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }
    
    .slideshow {
        aspect-ratio: 1;
    }
    
    .pdf-grid {
        grid-template-columns: 1fr;
    }
    
    .symbolic {
        min-height: 350px;
        padding: 25px;
    }
    
    .symbols,
    .sudoku {
        width: 100%;
    }
    
    .footer-bottom {
        flex-direction: column;
    }
}
