:root {
    --bg: #eef4f7;
    --surface: #f8fbfc;
    --surface-strong: #ffffff;
    --ink: #182733;
    --muted: #627383;
    --line: #d4e0e7;
    --green: #2f7893;
    --green-dark: #17384f;
    --blue: #245f8d;
    --rust: #b9703f;
    --shadow: 0 22px 60px rgba(24, 39, 51, .13);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.5;
}

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

a:hover {
    text-decoration: underline;
}

.site-header {
    background: var(--green-dark);
    color: #fff;
}

.hero {
    min-height: 330px;
    display: flex;
    align-items: flex-end;
    padding: 42px min(6vw, 72px);
    background-image: linear-gradient(90deg, rgba(16, 38, 30, .88), rgba(16, 38, 30, .34) 46%, rgba(16, 38, 30, .08)), url("images/header_big.jpg");
    background-position: center 58%;
    background-size: cover;
    background-repeat: no-repeat;
}

.hero-copy {
    max-width: 680px;
}

.hero h1 {
    margin: 6px 0 8px;
    font-size: clamp(42px, 6vw, 76px);
    line-height: .98;
    letter-spacing: 0;
}

.hero p {
    max-width: 560px;
    margin: 0;
    font-size: 18px;
}

.event-date {
    margin: -4px 0 14px;
    color: var(--green-dark);
    font-size: 22px;
    font-weight: 800;
}

.eyebrow {
    display: inline-block;
    color: var(--rust);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.site-header .eyebrow {
    color: #ffd99d;
}

.main-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    padding: 12px min(6vw, 72px);
    background: rgba(14, 39, 58, .28);
}

.main-nav a {
    flex: 0 0 auto;
    color: #fff;
    padding: 9px 12px;
    border-radius: 6px;
    font-weight: 700;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, .14);
    text-decoration: none;
}

.main-nav .nav-danger {
    color: #ffd0c3;
}

.page-shell {
    width: min(1180px, calc(100% - 28px));
    margin: 28px auto 44px;
}

.surface,
.login-panel,
.stat-card,
.gallery-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.surface {
    padding: clamp(20px, 4vw, 34px);
    margin-bottom: 24px;
}

h2,
h3 {
    margin: 0 0 14px;
    line-height: 1.15;
}

h2 {
    font-size: clamp(28px, 4vw, 44px);
}

h3 {
    font-size: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 22px;
    align-items: start;
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.compact-form {
    grid-template-columns: 1fr;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--ink);
    background: var(--surface-strong);
    font: inherit;
}

input:focus {
    outline: 3px solid rgba(47, 107, 79, .18);
    border-color: var(--green);
}

.form-actions {
    display: flex;
    align-items: end;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
}

.primary-button {
    color: #fff;
    background: var(--green);
}

.secondary-button {
    color: var(--green-dark);
    background: #e5f0f5;
}

.stats-column {
    display: grid;
    gap: 12px;
}

.stat-card {
    padding: 18px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.stat-card strong {
    font-size: 34px;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.people-list {
    display: grid;
    gap: 10px;
}

.person-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.person-row span {
    display: block;
    color: var(--muted);
}

.count-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.count-pills span,
.assignment-chip {
    border-radius: 999px;
    background: #e6f1f6;
    color: var(--green-dark);
    padding: 7px 10px;
    font-weight: 800;
}

.task-form {
    display: grid;
    gap: 18px;
}

.task-note {
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.task-item {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
}

.task-heading p {
    margin: -6px 0 14px;
    color: var(--muted);
}

.assignment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.assignment-chip {
    display: inline-flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.delete-assignment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #ffffff;
    background: var(--rust);
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
}

.delete-assignment:hover {
    background: #8f4d2f;
    text-decoration: none;
}

.prose p {
    color: var(--muted);
}

.info-grid,
.shopping-grid,
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.shopping-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-grid article,
.shopping-grid article,
.address-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-strong);
}

.address-card {
    display: grid;
    gap: 4px;
    margin: 16px 0 20px;
}

.map-frame {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.map-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.gallery-card {
    overflow: hidden;
}

.gallery-trigger {
    display: block;
}

.gallery-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.gallery-card div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
}

.modal-open {
    overflow: hidden;
}

.gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 22px;
}

.gallery-modal.is-open {
    display: flex;
}

.gallery-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(238, 244, 247, .78);
    backdrop-filter: blur(16px) saturate(1.08);
}

.gallery-modal-dialog {
    position: relative;
    z-index: 1;
    width: 70vw;
    height: 70vh;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 54px;
    align-items: center;
    gap: 14px;
}

.gallery-modal-figure {
    width: 100%;
    height: 100%;
    margin: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px;
    justify-items: center;
    align-items: center;
}

.gallery-modal-figure img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 30px 80px rgba(24, 39, 51, .22);
    background: #ffffff;
    object-fit: contain;
}

.gallery-modal-figure figcaption {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--green-dark);
    background: rgba(255, 255, 255, .82);
    font-weight: 800;
}

.gallery-modal-close,
.gallery-modal-nav {
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(23, 56, 79, .86);
    cursor: pointer;
    box-shadow: 0 16px 40px rgba(24, 39, 51, .16);
}

.gallery-modal-close:hover,
.gallery-modal-nav:hover {
    background: var(--blue);
}

.gallery-modal-close {
    position: absolute;
    top: -14px;
    right: -4px;
    width: 42px;
    height: 42px;
    font-size: 28px;
    line-height: 1;
}

.gallery-modal-nav {
    width: 54px;
    height: 54px;
    font-size: 42px;
    line-height: 1;
}

.login-shell {
    min-height: 55vh;
    display: grid;
    place-items: center;
}

.login-panel {
    width: min(520px, 100%);
    padding: clamp(24px, 5vw, 40px);
}

.validation-summary {
    grid-column: 1 / -1;
    color: var(--rust);
    font-weight: 700;
}

.site-footer {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding: 26px;
    color: var(--muted);
}

@media (max-width: 820px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .person-row,
    .section-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .shopping-grid {
        grid-template-columns: 1fr;
    }

    .gallery-modal-dialog {
        width: 70vw;
        height: 70vh;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 8px;
    }

    .gallery-modal-nav {
        width: 44px;
        height: 44px;
        font-size: 34px;
    }
}

@media (max-width: 520px) {
    .hero {
        min-height: 260px;
        padding: 30px 16px;
        background-position: center 56%;
    }

    .main-nav {
        justify-content: flex-start;
        padding: 10px 14px;
    }

    .stats-column {
        grid-template-columns: 1fr;
    }

    .gallery-modal {
        padding: 14px;
    }

    .gallery-modal-dialog {
        width: 70vw;
        height: 70vh;
        grid-template-columns: 1fr;
    }

    .gallery-modal-prev,
    .gallery-modal-next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }

    .gallery-modal-prev {
        left: 4px;
    }

    .gallery-modal-next {
        right: 4px;
    }
}
