:root {
    --gold: #a69064;
    --gold-dark: #8f7a4e;
    --gold-soft: #c9b98e;
    --box-bg: rgba(250, 246, 238, 0.78);
    --box-bg-strong: rgba(250, 246, 238, 0.94);
    --box-border: rgba(166, 144, 100, 0.4);
    --ink: #3f382e;
    --ink-soft: #6f675c;
    --shadow: 0 12px 30px rgba(90, 74, 44, 0.22);
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--gold-dark);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background-color: #efe9dc;
    background-image: url("/img/background.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
}

.script {
    font-family: "silencerocken", "Brush Script MT", "Segoe Script", cursive;
    font-weight: 400;
    color: var(--gold);
    text-shadow: 4px 5px 14px rgba(244, 238, 226, 0.85);
}

a {
    color: var(--gold-dark);
    text-decoration: none;
}

.amp {
    color: var(--gold);
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1rem;
    background: rgba(250, 246, 238, 0.72);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(166, 144, 100, 0.3);
}

.brand {
    font-size: 1.5rem;
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: 0.02em;
    color: var(--ink);
}

.brand .amp {
    font-size: 1rem;
    position: relative;
    top: -0.15em;
    padding: 0 0.04em;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 38px;
    padding: 0 10px;
    margin-left: auto;
    background: rgba(250, 246, 238, 0.65);
    border: 1px solid rgba(166, 144, 100, 0.5);
    border-radius: 9px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    font-size: 0.92rem;
}

.site-nav a {
    color: var(--ink-soft);
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover {
    color: var(--gold);
    border-bottom-color: var(--gold-soft);
}

.site-nav a.nav-login,
.site-nav a.nav-logout {
    border: 1px solid rgba(166, 144, 100, 0.6);
    border-radius: 999px;
    padding: 0.3rem 0.95rem;
    background: rgba(250, 246, 238, 0.55);
}

.site-nav a.nav-login:hover,
.site-nav a.nav-logout:hover {
    border-color: var(--gold);
    background: rgba(166, 144, 100, 0.14);
}

/* ---------- Main ---------- */
.site-main {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2.5rem 1rem 4rem;
}

/* ---------- Hero ---------- */
.hero {
    text-align: center;
    padding: 4rem 0.25rem 2.5rem;
}

.hero-kicker {
    margin: 0;
    font-size: 0.85rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--gold-dark);
}

.hero-names {
    margin: 0.75rem 0 0;
    font-size: clamp(2.8rem, 8.5vw, 6rem);
    line-height: 1.3;
    white-space: nowrap;
}

.hero-family {
    margin: 0.1rem 0 0;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--gold-dark);
    font-family: Georgia, "Times New Roman", serif;
}

.hero-text {
    max-width: 42rem;
    margin: 1.75rem auto 0;
    color: var(--ink);
    font-size: 1.1rem;
}

/* ---------- Timeline ---------- */
.timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    max-width: 1080px;
    margin: 2.5rem auto 0;
}

.timeline-item {
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 18px rgba(90, 74, 44, 0.12);
}

.timeline-time {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.15rem;
    color: var(--gold);
}

.timeline-text {
    color: var(--ink);
    font-size: 0.95rem;
}

/* ---------- Section titles ---------- */
.section-title {
    font-size: clamp(2.2rem, 5vw, 3.2rem);
    text-align: center;
    margin: 0;
}

.section-sub {
    text-align: center;
    color: var(--ink-soft);
    margin: 0.5rem 0 2rem;
}

.welcome-galleries,
.contact {
    margin-top: 3.5rem;
}

/* ---------- Gallery cards ---------- */
.gallery-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    max-width: 1080px;
    margin: 0 auto;
}

.card {
    display: block;
    background: var(--box-bg-strong);
    color: var(--ink);
    border: 1px solid var(--box-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 38px rgba(90, 74, 44, 0.3);
}

.card-cover {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--box-bg);
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.card:hover .card-cover img {
    transform: scale(1.04);
}

.card-cover-locked {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f3ecdd, #e9dfc9);
    border-bottom: 1px solid var(--box-border);
}

.card-cover-locked .lock-text {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    color: var(--gold);
    font-size: 1rem;
    padding: 0 1rem;
    text-align: center;
}

.card-body {
    padding: 1.25rem 1.4rem 1.5rem;
}

.card-title {
    margin: 0 0 0.35rem;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    font-size: 1.5rem;
}

.card-body p {
    margin: 0 0 0.9rem;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.card-count {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}

.card-empty {
    filter: saturate(0.8);
}

/* ---------- Contact ---------- */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    max-width: 1080px;
    margin: 0 auto;
}

.contact-card {
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 18px rgba(90, 74, 44, 0.12);
}

.contact-card h3 {
    margin: 0 0 0.6rem;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    font-size: 1.25rem;
    color: var(--gold);
}

.contact-card p {
    margin: 0.25rem 0;
    color: var(--ink);
}

.contact-card a {
    color: var(--gold-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.contact-card a:hover {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Gallery page ---------- */
.gallery-head {
    text-align: center;
    max-width: 44rem;
    margin: 0 auto 2.5rem;
    padding-top: 1rem;
}

.gallery-head .script {
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    margin: 0;
}

.gallery-desc {
    color: var(--ink);
    margin: 0.75rem 0;
}

.gallery-count {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold-dark);
}

/* ---------- Image wall: CSS-grid masonry, row-major ---------- */
.wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    grid-auto-rows: 8px;
    gap: 12px;
}

.wall-item {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(145deg, #f5efe2, #ece2cd);
    border: 1px solid var(--box-border);
    box-shadow: 0 4px 14px rgba(90, 74, 44, 0.14);
    cursor: zoom-in;
    /* grid-row-end: span N set by masonry.js */
    grid-row-end: span 34;
}

.wall-ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: rgba(143, 122, 78, 0.75);
    text-align: center;
    word-break: break-word;
}

.wall-item img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.45s ease, transform 0.35s ease;
}

.wall-item.loaded img {
    opacity: 1;
}

.wall-item.loaded .wall-ph {
    opacity: 0;
    transition: opacity 0.45s ease;
}

.wall-item:hover img {
    transform: scale(1.02);
}

/* ---------- Mobile navigation ---------- */

@media (max-width: 720px) {
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
        padding: 0.6rem 1.25rem 1rem;
        background: rgba(250, 246, 238, 0.97);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--box-border);
        box-shadow: 0 14px 30px rgba(58, 49, 34, 0.12);
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        font-size: 1rem;
        padding: 0.55rem 0.4rem;
    }
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 9, 6, 0.94);
    padding: 3rem 4rem;
}

.lightbox[hidden] {
    display: none;
}

.lb-img {
    max-width: 100%;
    max-height: 84vh;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lb-btn {
    position: absolute;
    background: rgba(245, 239, 228, 0.14);
    color: #f5efe4;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-btn:hover {
    background: rgba(245, 239, 228, 0.3);
}

.lb-close {
    top: 1.1rem;
    right: 1.1rem;
}

.lb-prev {
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
}

.lb-next {
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
}

.lb-caption {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(245, 239, 228, 0.78);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

/* ---------- Login ---------- */
.login {
    display: flex;
    justify-content: center;
    padding: 4rem 1rem;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--box-bg-strong);
    color: var(--ink);
    border: 1px solid var(--box-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem 2.5rem 2.75rem;
    text-align: center;
}

.login-box h1 {
    margin: 0 0 1rem;
    color: var(--gold);
    font-size: 2.6rem;
    text-shadow: none;
}

.login-sub {
    margin: 0 0 1.75rem;
    color: var(--ink-soft);
    font-size: 0.98rem;
}

.login-error {
    background: #f7e3e3;
    border: 1px solid #d9a3a3;
    color: #8c2f2f;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    margin: 0 0 1.25rem;
    font-size: 0.92rem;
}

.login-label {
    display: block;
    text-align: left;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: 0.4rem;
}

.login-box input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #d8cdb8;
    border-radius: 8px;
    background: #fffdf9;
    color: var(--ink);
    margin-bottom: 1.25rem;
}

.login-box input[type="password"]:focus {
    outline: 2px solid var(--gold);
    border-color: transparent;
}

.login-btn {
    width: 100%;
}

/* ---------- Buttons / empty state ---------- */
.btn {
    display: inline-block;
    padding: 0.65rem 1.7rem;
    border-radius: 999px;
    border: none;
    background: var(--gold);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #937044;
    color: #fff;
}

.empty {
    text-align: center;
    max-width: 34rem;
    margin: 4rem auto;
    background: var(--box-bg);
    border: 1px solid var(--box-border);
    border-radius: var(--radius);
    padding: 2rem;
    color: var(--ink-soft);
}

.empty h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
    font-size: 2rem;
    color: var(--ink);
}

.empty-path {
    font-size: 0.85rem;
}

.empty-path code {
    background: rgba(255, 253, 249, 0.8);
    border: 1px solid var(--box-border);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    word-break: break-all;
}

.empty .btn {
    margin-top: 1.5rem;
}

/* ---------- Footer ---------- */
.site-footer {
    text-align: center;
    padding: 2.5rem 1rem 3rem;
    color: var(--ink-soft);
    border-top: 1px solid var(--box-border);
    background: rgba(250, 246, 238, 0.62);
    backdrop-filter: blur(6px);
}

.site-footer p {
    margin: 0.2rem 0;
}

.site-footer a {
    color: var(--gold-dark);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-brand {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    color: var(--ink);
}

.footer-credit {
    font-size: 0.8rem;
    opacity: 0.9;
}

@media (max-width: 640px) {
    .hero {
        padding: 3rem 0.25rem 2rem;
    }

    .lightbox {
        padding: 2.5rem 0.75rem;
    }

    .lb-prev { left: 0.4rem; }
    .lb-next { right: 0.4rem; }

    .wall {
        grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    }
}

@media (max-width: 420px) {
    .hero-names {
        font-size: 2.1rem;
    }
}
