:root {
    --ink: #1f1812;
    --muted: #75665a;
    --paper: #fff7ec;
    --soft: #ead7bf;
    --sage: #7a6d54;
    --sage-dark: #3f3629;
    --rose: #9b5f38;
    --amber: #c98645;
    --line: rgba(31, 24, 18, 0.14);
    --shadow: 0 24px 70px rgba(58, 35, 17, 0.2);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header {
    position: fixed;
    z-index: 10;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px clamp(18px, 4vw, 56px);
    color: #fff;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0));
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.nav {
    display: flex;
    gap: clamp(14px, 3vw, 26px);
    font-size: 13px;
    font-weight: 750;
}

.hero {
    position: relative;
    min-height: 92svh;
    display: grid;
    align-items: end;
    padding: 110px clamp(20px, 6vw, 86px) 58px;
    color: #fff;
    overflow: hidden;
}

.hero-media {
    position: absolute;
    inset: 0;
    transform: scale(1.02);
}

.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.32) 44%, rgba(0, 0, 0, 0.16)),
        linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.52));
}

.hero-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
}

.hero-content {
    position: relative;
    width: min(780px, 100%);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--rose);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #ffe8df;
}

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(44px, 8vw, 92px);
    line-height: 0.96;
    font-weight: 500;
}

h1 span {
    display: block;
    font-size: 0.46em;
    line-height: 1.2;
}

h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(30px, 4.2vw, 54px);
    line-height: 1.08;
    font-weight: 500;
}

h3 {
    margin: 18px 0 8px;
    font-size: 19px;
    line-height: 1.2;
}

.hero-copy {
    max-width: 560px;
    margin: 22px 0 0;
    font-size: clamp(16px, 1.8vw, 20px);
}

.hero-actions,
.stack-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 800;
    text-align: center;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.primary {
    color: #fff;
    background: #4b3b29;
}

.secondary {
    color: var(--ink);
    background: #fff;
    border-color: var(--line);
}

.glass {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.58);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.full {
    width: 100%;
}

.quick-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
}

.quick-info article {
    min-height: 136px;
    padding: clamp(22px, 4vw, 34px);
    background: #fff;
}

.quick-info span,
.detail-card p,
.route-section p,
.section-copy p,
.footer span {
    color: var(--muted);
}

.quick-info span {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.quick-info strong {
    display: block;
    font-size: clamp(19px, 2.4vw, 28px);
    line-height: 1.15;
}

.quick-info .ceremony-time {
    color: var(--sage-dark);
    font-size: clamp(25px, 3.4vw, 38px);
}

.time-range {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 16px;
    font-weight: 850;
}

.section,
.route-section {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    padding: clamp(56px, 9vw, 108px) 0;
}

.intro,
.rsvp-section,
.route-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
    gap: clamp(26px, 6vw, 72px);
    align-items: center;
}

.section-copy p {
    max-width: 610px;
    margin: 18px 0 0;
    font-size: 17px;
}

.ceremony-note {
    color: var(--ink);
}

.ceremony-note strong {
    color: var(--sage-dark);
}

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

.countdown div,
.detail-card,
.rsvp-form {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 46px rgba(60, 45, 32, 0.08);
}

.countdown div {
    min-height: 130px;
    padding: 22px;
}

.countdown strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(34px, 5.8vw, 56px);
    line-height: 1;
    color: var(--sage-dark);
}

.countdown span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 800;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding-top: 0;
}

.photo-story {
    display: grid;
    grid-template-columns: minmax(0, 0.74fr) minmax(320px, 1.26fr);
    gap: clamp(28px, 6vw, 76px);
    align-items: center;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: clamp(62px, 9vw, 112px) 0;
}

.photo-story-copy p {
    max-width: 520px;
    color: var(--muted);
    font-size: 17px;
}

.photo-story-copy h2 {
    font-size: clamp(28px, 3.5vw, 42px);
    line-height: 1.12;
}

.photo-mosaic {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 14px;
    align-items: stretch;
}

.photo-mosaic figure {
    margin: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 54px rgba(70, 47, 30, 0.14);
}

.photo-mosaic img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feature-photo {
    min-height: 520px;
    transform: rotate(-1.2deg);
}

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

.photo-grid figure {
    aspect-ratio: 3 / 4;
}

.photo-grid figure:nth-child(2) {
    transform: translateY(24px) rotate(1.1deg);
}

.photo-grid figure:nth-child(3) {
    transform: rotate(-0.8deg);
}

.detail-card {
    min-height: 230px;
    padding: 24px;
}

.detail-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    background: var(--amber);
    font-size: 13px;
    font-weight: 900;
}

.text-link {
    display: inline-flex;
    margin-top: 12px;
    color: var(--sage-dark);
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.route-section {
    width: 100%;
    padding-inline: max(20px, calc((100vw - 1120px) / 2));
    background: linear-gradient(135deg, #ead7bf, #f7ead9);
}

.map-preview {
    position: relative;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
    border-radius: 8px;
    color: #fff;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.map-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(36, 45, 38, 0.12), rgba(36, 45, 38, 0.82));
}

.map-preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.map-preview span {
    position: relative;
    z-index: 1;
    font-size: 15px;
    font-weight: 800;
}

.map-preview strong {
    position: relative;
    z-index: 1;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 500;
}

.rsvp-form {
    padding: clamp(20px, 4vw, 34px);
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 850;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 13px 14px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(97, 113, 98, 0.2);
    border-color: var(--sage);
}

.notice {
    margin-bottom: 16px;
    padding: 13px 14px;
    border-radius: 6px;
    font-weight: 750;
}

.success {
    color: #244a36;
    background: #e5f4ea;
}

.error {
    color: #783326;
    background: #fde8e2;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 28px clamp(20px, 6vw, 70px);
    color: var(--ink);
    background: #fff;
    border-top: 1px solid var(--line);
}

.footer p {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 24px;
}

.admin-body {
    background: #f6f0e8;
}

.admin-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 70px;
}

.admin-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.admin-top h1 {
    margin: 0;
    max-width: 720px;
    font-size: clamp(34px, 5vw, 58px);
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.admin-card,
.admin-stats article {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 46px rgba(60, 45, 32, 0.08);
}

.admin-card {
    margin-bottom: 18px;
    padding: clamp(18px, 3vw, 28px);
}

.login-card {
    width: min(440px, 100%);
}

.admin-card h2 {
    margin-bottom: 20px;
    font-size: clamp(25px, 3vw, 34px);
}

.admin-panel summary {
    cursor: pointer;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 600;
    line-height: 1.2;
}

.admin-panel summary::marker {
    color: var(--rose);
}

.admin-panel[open] summary {
    margin-bottom: 20px;
}

.admin-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.admin-card-heading h2 {
    margin: 0;
}

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

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.admin-stats article {
    padding: 20px;
}

.admin-stats span {
    display: block;
    color: var(--muted);
    font-weight: 800;
}

.admin-stats strong {
    display: block;
    margin-top: 8px;
    font-size: 34px;
    line-height: 1;
}

.admin-save {
    width: 100%;
    margin-bottom: 18px;
}

.admin-empty {
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.table-delete {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(120, 51, 38, 0.22);
    border-radius: 6px;
    color: #783326;
    background: #fde8e2;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.pagination a {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    font-weight: 850;
}

.pagination a.active {
    color: #fff;
    background: var(--sage-dark);
    border-color: var(--sage-dark);
}

.print-body {
    background: #fff;
}

.print-sheet {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.print-header {
    margin-bottom: 22px;
}

.print-header p {
    margin: 0 0 6px;
    color: var(--muted);
    font-weight: 850;
    text-transform: uppercase;
}

.print-header h1 {
    margin: 0;
    color: var(--ink);
    font-size: 36px;
}

.print-header span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.print-table {
    min-width: 0;
    font-size: 13px;
}

.print-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

@media print {
    .print-actions {
        display: none;
    }

    .print-sheet {
        width: 100%;
        padding: 0;
    }

    body {
        background: #fff;
    }

    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

@media (max-width: 860px) {
    .site-header {
        padding: 14px 18px;
        background: linear-gradient(180deg, rgba(35, 32, 29, 0.58), rgba(35, 32, 29, 0.18));
        backdrop-filter: blur(10px);
    }

    .nav {
        gap: 14px;
        font-size: 13px;
    }

    .hero {
        min-height: 88svh;
        padding: 96px 20px 42px;
    }

    .hero-media {
        transform: scale(1.01);
    }

    .hero-media img {
        object-position: center center;
    }

    .quick-info,
    .intro,
    .rsvp-section,
    .route-section,
    .details-grid,
    .photo-story,
    .photo-mosaic {
        grid-template-columns: 1fr;
    }

    .quick-info article {
        min-height: auto;
    }

    .details-grid {
        width: min(1120px, calc(100% - 40px));
        padding-bottom: 64px;
    }

    .photo-story {
        width: min(100% - 32px, 560px);
        padding-block: 50px;
        gap: 20px;
    }

    .photo-story-copy h2 {
        font-size: clamp(25px, 8vw, 34px);
    }

    .photo-story-copy p {
        font-size: 16px;
    }

    .feature-photo {
        min-height: auto;
        aspect-ratio: 4 / 5;
        transform: none;
    }

    .photo-mosaic {
        display: flex;
        gap: 12px;
        align-items: stretch;
        overflow-x: auto;
        margin-inline: -16px;
        padding: 2px 16px 14px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .photo-mosaic::-webkit-scrollbar {
        display: none;
    }

    .photo-mosaic > figure,
    .photo-grid figure {
        flex: 0 0 min(78vw, 360px);
        scroll-snap-align: center;
    }

    .photo-grid {
        display: contents;
    }

    .photo-grid figure {
        aspect-ratio: 4 / 5;
    }

    .photo-mosaic figure {
        border-radius: 10px;
        box-shadow: 0 14px 34px rgba(70, 47, 30, 0.16);
    }

    .photo-grid figure:nth-child(2),
    .photo-grid figure:nth-child(3) {
        transform: none;
    }

    .route-section {
        padding-block: 64px;
    }

    .map-preview {
        min-height: 280px;
    }

    .admin-top,
    .admin-actions,
    .admin-card-heading {
        display: grid;
    }

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

@media (max-width: 520px) {
    .brand {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        font-size: 13px;
    }

    .nav a {
        padding: 8px 0;
    }

    .hero-actions,
    .stack-actions {
        display: grid;
    }

    .button {
        width: 100%;
    }

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

    .countdown div {
        min-height: 112px;
        padding: 16px;
    }

    .footer {
        display: block;
    }
}
