@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600&family=Lato:wght@300;400;700&display=swap");

:root {
    --primary-color: #1D2433;
    --secondary-color: #59745F;
    --accent-color: #d3af37;
    --thirdary-color: #ffffe4;

    --text-color: #2b3040;
    --font-heading: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --font-body: "Lato", "Helvetica Neue", Arial, sans-serif;
    --max-width: 900px;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
    font-family: var(--font-body);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-color);
}

html {
    background-color: var(--thirdary-color);
}

/* Header */
header {
    background-color: var(--primary-color);
    color: var(--thirdary-color);
    text-align: center;
    padding: 2rem 1rem 0;
    border-bottom: 3px solid var(--accent-color);
}

h1 {
    margin: 0 0 1.25rem;
    font-family: var(--font-heading);
    font-size: clamp(2rem, 6vw, 3.25rem);
    font-weight: 600;
    letter-spacing: 0.08em;
}

/* Navigation */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1.5rem;
}

nav a {
    display: block;
    padding: 0.75rem 0.25rem;
    color: var(--thirdary-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border-bottom: 3px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

nav a:hover,
nav a:focus-visible {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Hero image: runs edge to edge across the page */
section > img,
header > img {
    display: block;
    height: clamp(280px, 55vh, 600px);
    object-fit: cover;
    object-position: center;
}

/* Hero inside the main section: breaks out of the centered column */
section > img {
    width: 100vw;
    max-width: none;
    margin: -2.5rem 0 2.5rem calc(50% - 50vw);
}

/* Hero inside the header: stretches past the header padding */
header > img {
    width: calc(100% + 2rem);
    max-width: none;
    margin: 0 -1rem 1.5rem;
}

/* Main content */
section {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.25rem 3rem;
    text-align: center;
}

section > p {
    max-width: 38rem;
    margin: 0 auto 1.5rem;
    font-size: 1.15rem;
    font-weight: 300;
}

h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    line-height: 1.2;
}

h3 {
    margin: 2rem 0 0.5rem;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--secondary-color);
}

h4 {
    margin: 0.25rem 0;
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 0.03em;
}

/* Invitation */
.invite {
    max-width: 600px;
    margin: 0 auto;
}

.invite img {
    display: block;
    width: 100%;
    height: auto;
    margin-top: -7rem;
}

/* Photo gallery (engagement and guest photo pages) */
.gallery-page {
    max-width: 1200px;
}

.gallery-page > h2 {
    margin: 0 0 2rem;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.gallery-page > h3 {
    margin: 0 0 1rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.gallery-page > a {
    text-decoration: none;
    display: inline-block;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-color);
}

.gallery {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.gallery li {
    overflow: hidden;
    border-radius: 4px;
    background-color: #e8e6d4;
    box-shadow: 0 4px 12px rgba(29, 36, 51, 0.15);
}

.gallery li > a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.gallery li > a:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: -3px;
}

.gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery video {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: var(--primary-color);
    object-fit: contain;
}

.gallery-item-caption {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.95rem;
}

.gallery-item-caption p {
    margin: 0;
}

.gallery-item-caption small {
    color: #626775;
}

.delete-upload-button {
    margin-top: 0.5rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.upload-panel {
    max-width: 38rem;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    border: 1px solid rgba(29, 36, 51, 0.15);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.45);
    text-align: left;
}

.upload-panel label {
    display: block;
    margin-top: 0.75rem;
    font-weight: 700;
}

.upload-panel label:first-child {
    margin-top: 0;
}

.upload-panel label span,
.upload-help {
    font-size: 0.9rem;
    font-weight: 400;
    color: #626775;
}

.upload-panel input[type="text"] {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.7rem;
    border: 1px solid #a8a99b;
    border-radius: 3px;
    font: inherit;
}

.upload-help,
.upload-status,
.gallery-status {
    margin: 0.5rem 0 0;
}

.gallery-status {
    text-align: center;
}

.upload-status:not(:empty) {
    padding-top: 0.5rem;
    font-weight: 700;
}

.gallery-toolbar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.gallery-toolbar .filter-button {
    margin: 0;
    padding: 0.5rem 1rem;
}

.gallery-toolbar .filter-button.is-active {
    background-color: var(--primary-color);
}

.gallery video + .gallery-item-caption {
    padding-top: 0.25rem;
}

.gallery li:hover img {
    transform: scale(1.05);
}

.lightbox {
    width: min(96vw, 1100px);
    max-width: none;
    max-height: 94vh;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    background: var(--primary-color);
    color: var(--thirdary-color);
}

.lightbox::backdrop {
    background: rgba(0, 0, 0, 0.88);
}

.lightbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.lightbox-counter {
    margin: 0;
}

.lightbox button {
    flex: 0 0 auto;
    margin: 0;
}

.lightbox-close {
    padding: 0.5rem 1rem;
}

.lightbox-content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.lightbox-content figure {
    min-width: 0;
    margin: 0;
    text-align: center;
}

.lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: calc(94vh - 7rem);
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

.lightbox-content figcaption {
    margin-top: 0.5rem;
}

.lightbox-arrow {
    min-width: 3rem;
    min-height: 3rem;
    padding: 0.5rem;
    font-size: 1.25rem;
}

@media (max-width: 600px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

/* Buttons */
button {
    margin-top: 1rem;
    padding: 0.7rem 1.75rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--thirdary-color);
    background-color: var(--secondary-color);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button:hover,
button:focus-visible {
    background-color: var(--primary-color);
}

/* Footer */
footer {
    padding: 1.5rem 1rem;
    background-color: var(--primary-color);
    color: var(--thirdary-color);
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

footer p {
    margin: 0;
}

/* Focus styles for keyboard users */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

/* Small screens */
@media (max-width: 600px) {
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0;
    }

    section {
        padding-top: 1.5rem;
    }

    section > img {
        margin-top: -1.5rem;
        margin-bottom: 1.5rem;
        height: clamp(220px, 40vh, 360px);
    }

    .lightbox {
        width: 100vw;
        max-height: 100vh;
        padding: 0.5rem;
        border: 0;
        border-radius: 0;
    }

    .lightbox-content {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.25rem;
    }

    .lightbox-content img {
        max-height: calc(100vh - 8rem);
    }

    .lightbox-arrow {
        min-width: 2.5rem;
        min-height: 2.5rem;
    }
}
/* RSVP forms */
.rsvp-page > h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.rsvp-form fieldset {
    margin: 1.25rem 0 0;
    padding: 0;
    border: 0;
}

.rsvp-form legend {
    padding: 0;
    font-weight: 700;
}

.rsvp-form .choice-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.rsvp-form .choice-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rsvp-form .choice-row label {
    margin: 0;
    padding: 0.75rem 0.5rem;
    border: 1px solid #a8a99b;
    border-radius: 3px;
    background: #fff;
    text-align: center;
    font-weight: 400;
    cursor: pointer;
}

.rsvp-form .choice-row input:checked + label {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
    color: var(--thirdary-color);
}

.rsvp-form .choice-row input:focus-visible + label {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.upload-panel input[type="number"] {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.7rem;
    border: 1px solid #a8a99b;
    border-radius: 3px;
    font: inherit;
}

.rsvp-form #party-fields {
    margin-top: 1.25rem;
}

.rsvp-form button[type="submit"] {
    width: 100%;
    margin-top: 1.5rem;
}

.rsvp-form button:disabled {
    opacity: 0.6;
    cursor: default;
}

.rsvp-thanks {
    margin: 0;
    padding: 1rem 0;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--primary-color);
}

nav a[aria-current="page"] {
    border-bottom-color: var(--accent-color);
}

/* Honeypot: off-screen, not display:none, so bots still fill it */
.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Prevent iOS zoom on focus */
@media (max-width: 600px) {
    .upload-panel input[type="text"],
    .upload-panel input[type="number"] {
        font-size: 16px;
    }

    .upload-panel {
        padding: 1.1rem;
    }
}

.static-notice {
    max-width: 38rem;
    margin: 1rem auto;
    padding: 1.5rem;
    border: 1px solid rgba(29, 36, 51, 0.15);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.45);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Registry */
.registry-page {
    max-width: 960px;
    padding-top: 3.5rem;
}

.registry-eyebrow {
    margin: 0 auto 0.25rem;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--accent-color);
}

.registry-page > h2 {
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 3.75rem);
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.03em;
}

.registry-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1rem auto 1.5rem;
}

.registry-ornament span {
    width: 4.5rem;
    height: 1px;
    background: var(--accent-color);
}

.registry-ornament i {
    width: 0.5rem;
    height: 0.5rem;
    background: var(--accent-color);
    transform: rotate(45deg);
}

.registry-page > .registry-intro {
    max-width: 34rem;
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
    font-weight: 400;
    line-height: 1.5;
}

.registry-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.registry-card {
    --brand: var(--accent-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 2.25rem 1.5rem 2rem;
    border: 1px solid rgba(29, 36, 51, 0.12);
    border-top: 5px solid var(--brand);
    border-radius: 4px;
    background: #fffef4;
    box-shadow: 0 6px 20px rgba(29, 36, 51, 0.1);
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.registry-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(29, 36, 51, 0.18);
}

.registry-card:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

.registry-amazon { --brand: #ff9900; }
.registry-venmo { --brand: #008cff; }

.registry-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 3.4rem;
    font-family: var(--font-body);
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--primary-color);
}

.registry-venmo .registry-brand {
    font-size: 2.4rem;
    font-style: italic;
    font-weight: 700;
    color: #008cff;
}

.registry-amazon .registry-brand::after {
    content: "";
    display: block;
    width: 2.6rem;
    height: 0.35rem;
    margin: 0.1rem auto 0;
    border-bottom: 3px solid #ff9900;
    border-radius: 0 0 50% 50%;
}

.registry-card-title {
    font-family: var(--font-heading);
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--primary-color);
}

.registry-card-text {
    flex: 1;
    font-weight: 300;
}

.registry-handle {
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    background: rgba(0, 140, 255, 0.1);
    font-weight: 700;
    color: #0070cc;
    overflow-wrap: anywhere;
}

.registry-card-action {
    margin-top: 0.4rem;
    padding: 0.85rem 2rem;
    border-radius: 3px;
    background: var(--secondary-color);
    color: var(--thirdary-color);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: background-color 0.2s ease;
}

.registry-venmo .registry-card-action {
    background: #008cff;
    color: #fff;
}

.registry-amazon .registry-card-action {
    background: #ff9900;
    color: #1d2433;
}

.registry-card:hover .registry-card-action {
    background: var(--primary-color);
    color: var(--thirdary-color);
}

/* Featured gifts */
.featured-gifts {
    margin-top: 3.5rem;
}

.featured-gifts h3 {
    margin: 0 0 1.5rem;
    font-weight: 400;
    font-style: italic;
}

.featured-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}

.featured-list li {
    overflow: hidden;
    border: 1px solid rgba(29, 36, 51, 0.12);
    border-radius: 4px;
    background: #fffef4;
    box-shadow: 0 4px 12px rgba(29, 36, 51, 0.1);
}

.featured-list a {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.featured-list a:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: -3px;
}

.featured-list img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #fff;
}

.featured-name {
    padding: 0.75rem 0.75rem 0.15rem;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.25;
}

.featured-note {
    padding: 0 0.75rem 0.85rem;
    font-size: 0.85rem;
    color: #626775;
}

@media (max-width: 600px) {
    .registry-page {
        padding-top: 2.5rem;
    }

    .registry-card {
        padding: 1.75rem 1.25rem 1.5rem;
    }

    .registry-card-action {
        width: 100%;
        text-align: center;
        padding: 1rem;
    }

    .featured-list {
        grid-template-columns: repeat(2, 1fr);
    }
}
