:root {
    color-scheme: light;
    --bg: #eef2ea;
    --panel: #ffffff;
    --ink: #17301f;
    --muted: #57705f;
    --accent: #0f6b3f;
    --accent-2: #d9a441;
    --line: #d9e2d7;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Georgia, "Times New Roman", serif;
    background: radial-gradient(circle at top, #f8fbf6 0%, var(--bg) 55%, #dfe8d8 100%);
    color: var(--ink);
    max-width: 100vw;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
}

/* Removed conflicting .topbar row layout. Only column layout below is active. */
.brand.stylized-title {
    font-family: 'Pinyon Script', script;
    font-size: clamp(5rem, 5vw, 9rem);
    color: #f6f2e8;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.01em;
    text-shadow: 0 2px 10px rgba(0,0,0,.35);
    padding: 20px 40px;
    background: none;
    box-shadow: none;
    display: block;
    border-radius: 0.3em;
    transition: color 0.2s;
    text-align: center;
}
.brand.stylized-title::first-letter {
    font-size: 1.08em;
}

/* Brand domain and divider */
.brand-domain {
    margin-top: 10px;
    text-align: center;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    letter-spacing: .28em;
    color: rgba(245,241,232,.85);
}

.brand-divider {
    display: block;
    width: 160px;
    max-width: 60vw;
    margin: 0 auto 8px auto;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(245,241,232,0.9), transparent);
    opacity: 0.95;
    border: none;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.nav a {
    color: #f7fff7;
    opacity: 0.92;
}

.shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.panel {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(22, 52, 31, 0.08);
    padding: 1.5rem;
}

/* Header: center title, domain, menu below right */
/* HEADER LAYOUT */
.topbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 2.5rem 0.5rem 1.5rem; /* extra right padding for nav */
    background: linear-gradient(135deg, #0f6b3f, #11442d);
    color: white;
    box-shadow: 0 10px 25px rgba(18, 40, 26, 0.18);
    min-height: 170px;
    position: relative;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
}
 .brand-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* keep brand items toward the top of the header */
    padding-top: 1.25rem;
    width: auto; /* shrink-wrap so it doesn't cover the full header */
    margin: 0 auto;
    position: relative;
    z-index: 1; /* keep below nav so links remain clickable */
}

/* Nav menu absolutely positioned at bottom right of header */
.topbar .nav {
    position: absolute;
    right: 0.8rem; /* keep a small inset from the right edge */
    bottom: 0.9rem;
    display: flex;
    margin: 0;
    z-index: 999; /* ensure nav is on top and clickable */
    justify-content: flex-end;
    align-items: center;
    width: auto;
    box-sizing: border-box;
}
@media (max-width: 600px) {
    .topbar .nav {
        position: static;
        width: 100%;
        justify-content: center;
        align-items: center;
        margin-top: 0.5rem;
    }
}

@media (max-width: 900px) {
    .event-message {
        flex-direction: column;
    }

    .event-flag {
        width: 70px;
        height: 50px;
    }
    .brand-domain {
        margin-top: 10px;
        margin-bottom: 0.5rem;
    }
    .brand-block {
        margin-bottom: 0.5rem;
    }

    /* Mobile: stack content into a single column and show inline flag
       centered under the first paragraph (hide right-column flag). */
    .event-grid {
        display: grid;
        grid-template-columns: 1fr; /* single column so inline flag sits below text */
        gap: 0.6rem;
        align-items: start;
    }

    .event-flag {
        display: none !important; /* hide right-column flag on mobile */
    }

    .event-flag-inline {
        display: block !important; /* show inline flag under paragraph */
        margin-top: 0.6rem;
    }

    .event-flag-inline img {
        width: 64px;
        height: auto;
    }

    .card {
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 18px;
        padding: 1rem;
    }

    /* Tighter event content on small screens */
    .event-content {
        padding: 1.1rem 1rem 1.2rem 1rem;
        font-size: 1.02em;
    }

    .event-content h1 {
        font-size: 1.4em;
        margin-bottom: 0.2em;
    }

    /* Ensure nav stays absolutely positioned at bottom right on mobile too */
    .topbar .nav {
        position: absolute;
        right: 2.2rem;
        bottom: 0.7rem;
        display: flex;
        justify-content: flex-end;
        align-items: flex-end;
        margin: 0;
        z-index: 2;
    }
}

input, select, textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    margin-bottom: 0.2rem;
    background: #fff;
}

textarea {
    font-size: 1.08em;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: border 0.18s;
}
.nav a:hover, .nav a:focus {
    border-bottom: 2px solid #d9a441;
    opacity: 1;
}

.button {
    display: inline-block;
    border: 0;
    border-radius: 999px;
    padding: 0.85rem 1.25rem;
    background: linear-gradient(135deg, var(--accent), #0c4c2e);
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.button.secondary {
    background: linear-gradient(135deg, #8d9f89, #637163);
}

.validation-summary-errors,
.field-validation-error {
    color: #a11d1d;
}

.success {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: #e7f7ea;
    border: 1px solid #b8dfc0;
    color: #1f5531;
}

/* Event content HTML visual polish */
.event-content {
    background: rgba(255,255,255,0.98);
    border-radius: 24px;
    box-shadow: 0 4px 18px rgba(22, 52, 31, 0.07);
    padding: 2.2rem 2rem 2.2rem 2rem;
    margin-bottom: 2.2rem;
    font-size: 1.13em;
}
.event-content h1 {
    font-size: 2.2em;
    color: var(--accent);
    margin-bottom: 0.2em;
    margin-top: 0.2em;
    letter-spacing: 0.01em;
}
.event-content h2 {
    font-size: 1.3em;
    color: var(--muted);
    margin-bottom: 0.5em;
    margin-top: 0.1em;
    letter-spacing: 0.01em;
}
.event-content ul {
    margin: 1.2em 0 1.2em 1.2em;
    padding-left: 1.2em;
}
.event-content li {
    margin-bottom: 0.5em;
    font-size: 1.07em;
}
.event-content table {
    margin-bottom: 1.2em;
}
.event-content img {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(22, 52, 31, 0.10);
}

/* Responsive layout for event content: grid on desktop, stacked on small screens */
.event-grid {
    display: grid;
    grid-template-columns: 1fr; /* single column layout for text then inline flag */
    gap: 0.9rem;
    align-items: start;
}
.event-text {
    min-width: 0; /* allow long text to wrap inside grid */
}
/* Inline flag (used for all viewports) */
.event-flag-inline {
    display: block;
    text-align: center;
    margin-top: 0.8rem;
}
.event-flag-inline img {
    width: 84px;
    height: auto;
    display: inline-block;
}

/* Make the inline flag slightly smaller on narrow screens */
@media (max-width: 900px) {
    .event-flag-inline img {
        width: 64px;
    }
}

/* Guest list table styles */
.guest-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.8rem;
}
.guest-table th,
.guest-table td {
    border: 1px solid var(--line);
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.guest-table thead th {
    background: linear-gradient(180deg, rgba(240,245,240,0.9), rgba(230,240,230,0.9));
    font-weight: 700;
}