@font-face {
    font-family: 'Staatliches';
    src: url('../fonts/Staatliches/Staatliches-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat/static/Montserrat-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-background: #1f2d3d;
    --color-text: #f2e2c4;
    --color-accent: #c96;
    --color-footer-text: #bbb;
    --color-footer-border: #444;
    --color-subtle-border: #777;
    --color-card-background: #2b3e50;
    --color-header-border: #c96;
    --color-invert-bg: #333333;

    --font-body: 'Arial', 'Montserrat', sans-serif;
    --font-fallback: 'Arial', 'Montserrat', sans-serif;
    --font-display: 'Staatliches', sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--color-background);
    color: var(--color-text);
}

header {
    background: url('../images/title-banner-final-transparent.png') no-repeat center;
    background-size: contain;
    width: 100%;
    height: 217px;
}

section {
    max-width: 900px;
    margin: 0 auto;
    font-family: var(--font-fallback);
    padding-left: 5vw;
    padding-right: 5vw;
    box-sizing: border-box;
}

h2 {
    font-family: var(--font-display);
    font-size: 2em;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--color-header-border);
    padding-bottom: 5px;
    margin-top: 40px;
    color: var(--color-text);
}

a {
    color: var(--color-text);
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 20px;
    font-size: 0.9em;
    color: var(--color-footer-text);
    border-top: 1px solid var(--color-footer-border);
    margin-top: 40px;
}

/* Places styles (refactored from inline) */
.places-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.place-card {
    background-color: var(--color-card-background);
    padding: 10px;
    border-radius: 8px;
    max-width: 250px;
    text-align: center;
}

.place-card img {
    width: 100%;
    border-radius: 4px;
    display: block;
}

.place-card h3 {
    margin: 10px 0 5px 0;
    font-family: var(--font-display);
}

.place-card p {
    font-size: 0.9em;
    margin: 0 0 8px 0;
}

.btn {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 0.9em;
}

.btn-accent {
    background-color: var(--color-accent);
    color: var(--color-background);
}

.btn-join-email {
    display: inline-block;
    background-color: var(--color-accent);
    color: var(--color-background);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
}

.copy-email-link {
    cursor: pointer;
    position: relative;
}

.calendar-dark-mode {
    /* Set the width to match the iframe's width (800px) */
    max-width: 800px;
    width: 100%;
    /* This is the magic for centering: 0 for top/bottom margin, auto for left/right */
    margin: 0 auto;
}

/* Keep the iframe dark mode CSS from before */
.calendar-dark-mode iframe {
    filter: invert(90%) hue-rotate(180deg) brightness(75%);
    -webkit-filter: invert(90%) hue-rotate(180deg) brightness(75%);
    background-color: var(--color-invert-bg);
    border: solid 1px var(--color-subtle-border);
    width: 100%;
    max-width: 800px;
}


/** EVENTS **/
/* Default: Single column grid for desktop */
#events-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.event-card {
    background-color: var(--color-card-background);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--color-subtle-border);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.event-card-text {
    flex: 1;
    font-size: 1.1em;
}

.event-card-text h3 {
    font-family: var(--font-display);
    margin-top: 0;
}

.event-date-posted {
    font-size: 0.8em;
    color: var(--color-subtle-border);
    margin-top: 10px;
    font-style: italic;
}

.event-card-image {
    flex-shrink: 0;
}

.event-card img {
    width: auto;
    border-radius: 4px;
    max-width: 200px;
    max-height: 160px;
    height: auto;
    cursor: pointer;
    transition: opacity 0.2s;
    display: block;
    object-fit: contain;
}

.event-card img:hover {
    opacity: 0.8;
}

/* Image Modal Overlay */
.image-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
}

.image-modal-container {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    cursor: default;
}

.responsive-map-image {
    /* Ensures the image never exceeds the width of its parent container */
    max-width: 100%; 
    /* Maintains the image's aspect ratio */
    height: auto; 
    /* Optional: Improves the appearance of the link */
    display: block; 
    /* Match other site images with slightly rounded corners */
    border-radius: 4px;
}

/* Responsive breakpoints - organized from largest to smallest */
/* Tablet and below: Stacked layout (text above image) */
@media (max-width: 768px) {
    .event-card {
        flex-direction: column;
    }

    .event-card-text {
        font-size: 1em;
    }

    .event-card-image {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .event-card img {
        max-width: 100%;
        max-height: none;
        width: auto;
        margin: 10px auto 0;
    }

    .calendar-dark-mode {
        width: 100%;
        margin: 0 auto;
        min-height: 600px;
    }

    .calendar-dark-mode iframe {
        width: 100% !important;
        height: 600px !important;
    }
}

/* Mobile: Smaller header, smaller calendar */
@media (max-width: 600px) {
    header {
        height: auto;
        aspect-ratio: 914 / 217;
    }

    .calendar-dark-mode {
        min-height: 500px;
    }

    .calendar-dark-mode iframe {
        height: 500px !important;
    }
}