* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --text-dark: #1a1a1a;
    --text-muted: #4a4a4a;
    --text-on-dark: #f5f5f0;
    --accent: #8b6914;
    --accent-soft: #c9a227;
    --bg-cream: #faf9f6;
    --overlay: rgba(0, 0, 0, 0.45);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-cream);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(180deg, #faf7f2 0%, #f5f1ea 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

nav {
    padding: 1rem 0;
}

nav .container.nav-inner,
nav .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    display: inline-block;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 0.25rem;
    min-height: 44px;
    line-height: 1.4;
    box-sizing: border-box;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Homepage tile wall */
.tile-wall-wrap {
    min-height: 100vh;
    padding: 0;
    position: relative;
}

.tile-wall-loading {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-cream);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tile-wall-loading.tile-wall-loading-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.tile-wall-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: tile-wall-spin 0.8s linear infinite;
}

@keyframes tile-wall-spin {
    to { transform: rotate(360deg); }
}

.tile-wall-loading-text {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.tile-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, 200px);
    gap: 0;
    justify-content: center;
    padding: 0;
}

.tile {
    display: block;
    width: 200px;
    height: 200px;
    overflow: hidden;
    position: relative;
    transition: width 0.25s ease, height 0.25s ease, z-index 0s;
    z-index: 1;
    cursor: pointer;
}

.tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    vertical-align: middle;
}

/* Desktop: horizontal slideshow, center image larger */
@media (min-width: 769px) {
    .tile-wall-wrap {
        min-height: 80vh;
        overflow: hidden;
    }

    .tile-wall {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        gap: 16px;
        padding: 2rem calc(50vw - 140px);
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        min-height: 80vh;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tile-wall::-webkit-scrollbar {
        display: none;
    }

    .tile-wall .tile {
        flex: 0 0 auto;
        width: 280px;
        height: 340px;
        scroll-snap-align: center;
        scroll-snap-stop: always;
        transition: transform 0.35s ease, box-shadow 0.35s ease;
        border-radius: 8px;
        overflow: hidden;
    }

    .tile-wall .tile.tile-center {
        transform: scale(1.22);
        z-index: 2;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    }

    .tile-wall .tile img {
        border-radius: 8px;
    }
}

/* Overlay: copy of image shown in center when a tile is clicked (tile stays in place) */
.tile-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.tile-overlay img {
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    display: block;
    border: 10px solid #000;
    box-shadow: var(--shadow);
    pointer-events: none;
}

.tile-wall-fallback {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Hero – photo banner + title */
.hero {
    position: relative;
    min-height: 0;
    max-height: 200px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: #fff;
}

.hero-bg-wrap {
    position: absolute;
    inset: 0;
}

.hero-banner-wrap {
    position: absolute;
    inset: 0;
}

.hero-banner-wrap img {
    width: 100%;
    height: 100%;
    /* Match build-hero-banner.js output: desktop 3656×180, mobile 3584×280 */
    aspect-ratio: 3656 / 180;
    object-fit: cover;
    object-position: center 50%;
    opacity: 0.78;
    display: block;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.15) 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 1rem 24px;
}

/*
 * Hero title font options (swap the <link> in index.html and font-family below):
 *
 * 1. Cormorant Garamond (current) – refined serif, editorial
 *    Link: already loaded
 *    font-family: 'Fraunces', serif;
 *
 * 2. Playfair Display – strong classic serif, magazine-style
 *    Link: ...family=Playfair+Display:wght@400;600;700&display=swap
 *    font-family: 'Playfair Display', serif;
 *
 * 3. Libre Baskerville – traditional book serif, readable
 *    Link: ...family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap
 *    font-family: 'Libre Baskerville', serif;
 *
 * 4. Lora – warm, slightly rounded serif
 *    Link: ...family=Lora:ital,wght@0,400;0,600;0,700;1,400&display=swap
 *    font-family: 'Lora', serif;
 *
 * 5. Cinzel – Roman / all-caps feel, dramatic
 *    Link: ...family=Cinzel:wght@400;600;700&display=swap
 *    font-family: 'Cinzel', serif;
 *
 * 6. Fraunces – soft variable serif, distinctive
 *    Link: ...family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,400&display=swap
 *    font-family: 'Fraunces', serif;
 *
 * 7. Spectral – screen-optimized serif, elegant
 *    Link: ...family=Spectral:ital,wght@0,400;0,600;0,700;1,400&display=swap
 *    font-family: 'Spectral', serif;
 *
 * 8. Outfit – geometric sans, clean and modern (different vibe)
 *    Link: ...family=Outfit:wght@400;600;700&display=swap
 *    font-family: 'Outfit', sans-serif;
 */
.hero-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.75rem, 7vw, 4.8rem);
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    letter-spacing: 0.07em;
    text-shadow:
        0 0 1px rgba(255, 255, 255, 1),
        0 1px 3px rgba(255, 255, 255, 0.95),
        0 2px 12px rgba(0, 0, 0, 0.15),
        0 0 2px rgba(0, 0, 0, 0.08);
}

/* About – image + text */
.about {
    padding: 5rem 0;
    background: var(--bg-cream);
}

.about-layout {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-image {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-height: 380px;
}

.about-text h2 {
    font-family: 'Fraunces', serif;
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 600;
}

.about-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.75;
}

/* Gallery */
.gallery {
    padding: 5rem 0;
    background: #fff;
}

.gallery h2 {
    font-family: 'Fraunces', serif;
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.gallery-intro {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    aspect-ratio: 4/3;
}

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

/* Contact */
.contact {
    padding: 4rem 0;
    background: var(--bg-cream);
}

.contact h2 {
    font-family: 'Fraunces', serif;
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.contact p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* Footer */
footer {
    background: var(--text-dark);
    color: var(--text-on-dark);
    padding: 2rem 0;
    font-size: 0.9rem;
}

footer a {
    color: var(--accent-soft);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem 2rem;
}

.footer-text {
    color: var(--text-on-dark);
}

.legal-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent-soft);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.legal-link:hover,
.legal-link:focus-visible {
    text-decoration: underline;
}

/* Legal / privacy modal */
.legal-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.legal-modal-backdrop.is-open {
    display: flex;
}

.legal-modal-dialog {
    background: #ffffff;
    color: var(--text-dark);
    max-width: 720px;
    max-height: 80vh;
    width: 90vw;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 1.75rem 1.5rem;
    overflow-y: auto;
}

.legal-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.legal-modal-title {
    font-family: 'Fraunces', serif;
    font-size: 1.4rem;
}

.legal-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.legal-modal-close:hover,
.legal-modal-close:focus-visible {
    color: var(--text-dark);
}

.legal-modal-body {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.legal-modal-body h3 {
    font-size: 1.05rem;
    margin-top: 1.25rem;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--text-dark);
}

.legal-modal-body p,
.legal-modal-body ul {
    margin-bottom: 0.5rem;
}

.legal-modal-body ul {
    padding-left: 1.2rem;
}

.legal-modal-body li {
    margin-bottom: 0.25rem;
}

@media (max-width: 600px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .legal-modal-dialog {
        width: 94vw;
        max-height: 85vh;
        padding: 1.25rem 1rem;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .about-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-image {
        max-height: 280px;
    }

    .about-image img {
        max-height: none;
    }

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

@media (max-width: 768px) {
    header {
        top: 0;
    }

    nav .container {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .nav-links {
        flex-direction: column;
        gap: 0;
    }

    .nav-links a {
        padding: 0.75rem 0.5rem;
        min-height: 48px;
    }

    .hero {
        min-height: 0;
        height: 140px;
        max-height: 160px;
    }

    .hero-banner-wrap img {
        aspect-ratio: 3584 / 280; /* mobile banner from build-hero-banner.js */
    }

    .hero-title {
        font-size: 1.5rem;
    }

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

    section {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-title {
        font-size: 1.35rem;
    }

    .about-layout,
    .gallery,
    .contact {
        padding-left: 16px;
        padding-right: 16px;
    }
}
