:root {
    color-scheme: light;

    --cream: #fbf3df;
    --cream-dark: #f1e3c5;
    --maroon: #541f27;
    --red: #7b2936;
    --gold: #9c762f;
    --gold-light: #e4c78c;
    --ink: #482d1e;
    --muted: #75614b;
    --line: #cbb581;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    line-height: 1.65;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 5px;
}

[hidden] {
    display: none !important;
}

/* HEADER */

.masthead {
    max-width: 1200px;
    margin: auto;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border-bottom: 3px solid var(--maroon);
}

.masthead a {
    text-decoration: none;
}

.monogram {
    color: var(--maroon);
    font-size: 27px;
    letter-spacing: .13em;
}

.monogram span {
    color: var(--gold);
    font-style: italic;
}

.home-link {
    font: 14px/1.5 Arial, sans-serif;
}

.home-link:hover {
    text-decoration: underline;
}

/* PAGE INTRO */

main {
    max-width: 1120px;
    margin: auto;
    padding: 48px 26px 65px;
}

.intro {
    max-width: 700px;
    margin: 0 auto 32px;
    text-align: center;
}

.eyebrow {
    color: var(--gold);
    font: 11px/1.8 Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: .19em;
}

h1,
h2,
h3 {
    color: var(--maroon);
}

h1 {
    margin: 12px 0;
    font-size: clamp(38px, 6vw, 62px);
    font-weight: 400;
    line-height: 1.15;
}

.intro > p:last-child {
    color: var(--muted);
}

.intro-ornament {
    color: var(--gold);
    font-size: 22px;
    letter-spacing: .12em;
}

/* EVENT BUTTONS */

.event-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 34px;
}

.event-tabs button {
    min-height: 46px;
    padding: 11px 18px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--maroon);
    font: 14px/1.5 Arial, sans-serif;
    cursor: pointer;
}

.event-tabs button:hover {
    background: var(--cream-dark);
}

.event-tabs button[aria-pressed="true"] {
    background: var(--maroon);
    border-color: var(--maroon);
    color: #fff3da;
}

/* SELECTED EVENT NOTE */

.event-intro {
    max-width: 720px;
    margin: 0 auto 32px;
    text-align: center;
}

.event-intro h2 {
    margin: 8px 0 12px;
    font-size: clamp(29px, 4vw, 39px);
    line-height: 1.25;
    font-weight: 400;
}

.event-intro > p:last-child {
    margin-top: 0;
    color: var(--muted);
}

/* ADAPTIVE PHOTO FRAME */

.photo-frame {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border: 3px solid var(--maroon);
    outline: 1px solid var(--gold);
    outline-offset: 7px;
    background: var(--cream-dark);
    box-shadow: 0 18px 50px #482d1e16;
}

/* Portrait photos use a narrower frame. */
.photo-frame.is-portrait {
    max-width: 540px;
}

.frame-heading {
    position: relative;
    padding: 24px 18px 22px;
    background: var(--maroon);
    text-align: center;
    border-bottom: 3px double var(--gold-light);
}

.frame-ornament {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 16px;
    background: var(--cream);
    color: var(--gold);
    font-size: 26px;
}

.hashtag {
    margin: 0;
    color: #fff2d5;
    font-size: clamp(34px, 5vw, 48px);
    font-style: italic;
    line-height: 1.3;
}

.frame-tagline {
    margin: 7px 0 0;
    color: var(--gold-light);
    font: 10px/1.7 Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: .18em;
}

.frame-body {
    padding: 22px;
}

.slideshow-stage {
    position: relative;
    width: 100%;
    aspect-ratio: var(--photo-ratio, 4 / 3);
    overflow: hidden;
    background: #eadcbb;
    border: 1px solid var(--gold);
}

.slide {
    position: absolute;
    inset: 0;
    margin: 0;
    width: 100%;
    height: 100%;
}

.slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #eadcbb;
}

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 30px;
    text-align: center;
    background:
        radial-gradient(
            ellipse at center,
            #fff9e9 0%,
            #eedfbd 100%
        );
}

.placeholder-ornament {
    color: var(--gold);
    font-size: 65px;
    line-height: 1;
}

.placeholder h3 {
    margin: 22px 0 12px;
    font-size: clamp(25px, 4vw, 38px);
    font-weight: 400;
    line-height: 1.25;
}

.placeholder p {
    max-width: 380px;
    margin: 0;
    color: var(--muted);
}

.placeholder-album-link {
    margin-top: 22px;
    padding: 11px 20px;
    background: var(--maroon);
    color: #fff2d5;
    text-decoration: none;
    font: 14px/1.5 Arial, sans-serif;
}

.photo-caption {
    min-height: 28px;
    margin: 18px 0 12px;
    color: var(--maroon);
    text-align: center;
}

.slideshow-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.slideshow-controls button {
    min-width: 44px;
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid var(--maroon);
    background: var(--maroon);
    color: #fff2d5;
    font: 14px/1.5 Arial, sans-serif;
    cursor: pointer;
}

.slideshow-controls button:hover:not(:disabled) {
    background: var(--red);
}

.slideshow-controls button:disabled {
    opacity: .4;
    cursor: default;
}

.photo-counter {
    min-width: 70px;
    color: var(--muted);
    text-align: center;
    font: 12px/1.5 Arial, sans-serif;
}

/* ALBUM CARDS */

.albums-section {
    margin: 55px auto 0;
    text-align: center;
}

.albums-section > h2,
.gallery-section > h2 {
    margin: 8px 0 24px;
    font-size: 34px;
    font-weight: 400;
    line-height: 1.25;
}

.album-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    text-align: left;
}

.album-card {
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 28px;
    border: 1px solid var(--line);
    border-top: 4px solid var(--maroon);
    background: #fff8e8;
    box-shadow: 0 8px 24px #482d1e08;
}

.album-card .eyebrow {
    margin: 0 0 8px;
}

.album-card h3 {
    margin: 0 0 12px;
    font-size: 29px;
    line-height: 1.2;
    font-weight: 400;
}

.album-card-note {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 16px;
}

.album-link {
    display: block;
    margin-top: auto;
    padding: 13px 18px;
    background: var(--maroon);
    color: #fff2d5;
    text-align: center;
    text-decoration: none;
    font: 14px/1.6 Arial, sans-serif;
}

.album-link:hover {
    background: var(--red);
}

.album-cards.single-album {
    grid-template-columns: minmax(0, 1fr);
    max-width: 650px;
    margin: auto;
}

/* THUMBNAIL GALLERY */

.gallery-section {
    margin: 48px auto 0;
    text-align: center;
}

.gallery-hint {
    color: var(--muted);
    font-size: 15px;
}

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

.thumbnail {
    display: block;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--cream-dark);
    cursor: pointer;
}

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

/* CLOSING AND FOOTER */

.closing {
    margin: 46px auto 0;
    text-align: center;
}

.closing p {
    margin: 10px 0;
}

.couple-signature {
    color: var(--maroon);
    font-style: italic;
    font-size: 22px;
}

footer {
    padding: 30px 24px;
    background: var(--maroon);
    color: #fff2d5;
    text-align: center;
    border-top: 3px double var(--gold-light);
}

footer p {
    margin: 8px 0;
}

.footer-monogram {
    font-size: 29px;
    letter-spacing: .13em;
}

.footer-monogram span {
    color: var(--gold-light);
    font-style: italic;
}

.footer-date {
    color: var(--gold-light);
    font: 12px/1.6 Arial, sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
}

/* ENLARGED PHOTO */

dialog {
    max-width: 95vw;
    max-height: 95vh;
    padding: 16px;
    border: 1px solid var(--gold);
    background: var(--cream);
    color: var(--ink);
}

dialog::backdrop {
    background: #18090ce6;
}

.close-photo {
    display: block;
    margin: 0 0 12px auto;
    min-height: 44px;
    padding: 9px 15px;
    border: 1px solid var(--maroon);
    background: var(--maroon);
    color: #fff2d5;
    font: 14px/1.5 Arial, sans-serif;
    cursor: pointer;
}

dialog img {
    display: block;
    max-width: 85vw;
    max-height: 72vh;
    object-fit: contain;
}

dialog p {
    margin: 12px 0 0;
    text-align: center;
}

/* ACCESSIBILITY */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.noscript-message {
    padding: 20px;
    text-align: center;
    border: 1px solid var(--line);
}

/* MOBILE */

@media (max-width: 650px) {
    main {
        padding: 34px 22px 45px;
    }

    .masthead {
        padding: 17px 22px;
    }

    .event-tabs {
        gap: 8px;
    }

    .event-tabs button {
        padding: 10px 12px;
        font-size: 13px;
    }

    .frame-body {
        padding: 13px;
    }

    /*
     * No fixed mobile aspect ratio:
     * JavaScript sets the actual photo proportions.
     */
    .slideshow-stage {
        aspect-ratio: var(--photo-ratio, 4 / 3);
    }

    .placeholder {
        padding: 20px;
    }

    .placeholder p {
        font-size: 15px;
    }

    .album-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .album-card {
        padding: 24px;
    }

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

    .slideshow-controls {
        gap: 8px;
    }
}