:root {
    --color-bg: #fbfaf8;
    --color-surface: #ffffff;
    --color-text: #333333;
    --color-muted: #767b8a;
    --color-heading: #2c3244;
    --color-accent: #2f6fed;
    --color-accent-dark: #1f4fbd;
    --color-danger: #d64545;
    --color-border: #e7e5e0;
    --font-heading: Georgia, 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --radius: 14px;
    --shadow: 0 4px 24px rgba(44, 50, 68, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
}

img { max-width: 100%; display: block; }

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(251, 250, 248, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--color-border);
}

.header__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.header__logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-heading);
    text-decoration: none;
    white-space: nowrap;
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav__link {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav__link:hover { color: var(--color-accent); }

.nav__link--accent {
    color: #fff;
    background: var(--color-accent);
    padding: 8px 16px;
    border-radius: 999px;
}

.nav__link--accent:hover { background: var(--color-accent-dark); color: #fff; }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--color-heading);
    border-radius: 2px;
}

/* ===== Hero ===== */
.hero {
    padding: 64px 0 40px;
    text-align: center;
    background: linear-gradient(180deg, #eef2fb 0%, var(--color-bg) 100%);
}

.hero__avatar {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 28px;
    border: 5px solid #fff;
    box-shadow: var(--shadow);
    background: #dfe3ee;
}

.hero__name {
    font-family: var(--font-heading);
    font-size: 2.4rem;
    color: var(--color-heading);
    margin: 0 0 18px;
}

.hero__dates {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--color-muted);
    font-size: 1.1rem;
}

.hero__dates-sep { color: var(--color-accent); }

.hero__years {
    display: block;
    width: 100%;
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ===== Quote ===== */
.quote { padding: 0 0 56px; }

.quote__box {
    max-width: 700px;
    margin: 0 auto;
    background: var(--color-heading);
    color: #fff;
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
}

.quote__icon { color: var(--color-accent); margin-bottom: 12px; }

.quote__text {
    font-size: 1.25rem;
    font-family: var(--font-heading);
    font-style: italic;
    margin: 0 0 14px;
    white-space: pre-line;
}

.quote__author { color: #b7bdd4; font-size: 0.9rem; }

/* ===== Section shared ===== */
.section { padding: 64px 0; }

.section:nth-of-type(even) { background: var(--color-surface); }

.section__title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--color-heading);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: center;
    margin: 0 0 40px;
}

.section__subtitle {
    text-align: center;
    color: var(--color-muted);
    max-width: 620px;
    margin: -20px auto 40px;
}

.section__empty {
    text-align: center;
    color: var(--color-muted);
    font-style: italic;
}

/* ===== Biography ===== */
.bio-block {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 28px;
}

.bio-block h3 {
    font-family: var(--font-heading);
    color: var(--color-heading);
    margin-top: 0;
}

.bio-block__text p { margin-bottom: 0; white-space: pre-line; }

.bio-summary {
    max-width: 700px;
    margin: 40px auto 0;
    text-align: center;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--color-heading);
    border-top: 2px solid var(--color-accent);
    padding-top: 24px;
}

/* ===== Gallery ===== */
.gallery__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.gallery__item {
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.gallery__item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.gallery__item:hover img { transform: scale(1.06); }

/* ===== Videos ===== */
.videos__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.videos__item {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: #000;
}

.videos__item video { width: 100%; height: 100%; object-fit: contain; }

/* ===== Memories ===== */
.memories__list {
    display: grid;
    gap: 18px;
}

.memory-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
}

.memory-card__header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--color-muted);
}

.memory-card__author { font-weight: 600; color: var(--color-heading); }

.memory-card__text { margin: 0 0 16px; white-space: pre-line; }
.memory-card__text:last-child { margin-bottom: 0; }

.memory-card__media {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 10px;
}

/* ===== Place ===== */
.place__box {
    max-width: 640px;
    margin: 0 auto;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}

.place__row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
}

.place__row:last-child { border-bottom: none; }

.place__label { color: var(--color-muted); }

.place__value { text-align: right; font-weight: 500; }

.place__row--links { align-items: center; }

.place__links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.place__map-link {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 999px;
    background: #eef2fb;
    color: var(--color-accent-dark);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.place__map-link:hover { background: var(--color-accent); color: #fff; }

/* ===== Share / submission form ===== */
.share__box {
    max-width: 560px;
    margin: 0 auto;
}

.form { display: grid; gap: 18px; }

.form__group { display: grid; gap: 6px; }

.form__group label { font-weight: 600; color: var(--color-heading); font-size: 0.9rem; }

.form__hint { font-size: 0.82rem; color: var(--color-muted); }

.form input[type="text"],
.form textarea,
.form select {
    font: inherit;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    color: var(--color-text);
}

.form input[type="file"] {
    font: inherit;
}

.form textarea { resize: vertical; min-height: 110px; }

.form input:focus,
.form textarea:focus,
.form select:focus {
    outline: none;
    border-color: var(--color-accent);
}

.btn {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: var(--color-accent);
    color: #fff;
}

.btn:hover { background: var(--color-accent-dark); }

.btn--ghost {
    background: transparent;
    color: var(--color-heading);
    border: 1px solid var(--color-border);
}

.btn--ghost:hover { background: var(--color-surface); }

.btn--danger { background: var(--color-danger); }
.btn--danger:hover { background: #b93333; }

.btn--small { padding: 8px 16px; font-size: 0.85rem; }

.alert {
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 0.9rem;
    margin-bottom: 18px;
}

.alert--success { background: #e5f6ea; color: #1f7a3d; }
.alert--error { background: #fbe7e7; color: #a83232; }

/* ===== Footer ===== */
.footer {
    padding: 32px 0;
    text-align: center;
    color: var(--color-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--color-border);
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(20, 22, 30, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 40px;
}

.lightbox.is-open { display: flex; }

.lightbox__img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.lightbox__close {
    position: absolute;
    top: 20px;
    right: 28px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.2rem;
    line-height: 1;
    cursor: pointer;
}

/* ===== Admin ===== */
.admin-bar {
    background: var(--color-heading);
    color: #fff;
}

.admin-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    max-width: 1100px;
}

.admin-bar__links { display: flex; gap: 18px; align-items: center; }

.admin-bar a { color: #fff; text-decoration: none; font-size: 0.9rem; }
.admin-bar a:hover { opacity: 0.8; }

.admin-bar__logout {
    background: none;
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
}

.admin-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.admin-shell h1 {
    font-family: var(--font-heading);
    color: var(--color-heading);
}

.admin-shell h2 {
    font-family: var(--font-heading);
    color: var(--color-heading);
    margin-top: 48px;
}

.admin-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 16px;
}

.admin-card__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.admin-card__meta {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 8px;
}

.admin-card__actions { display: flex; gap: 8px; flex-shrink: 0; }

.admin-card__media {
    max-width: 260px;
    border-radius: 8px;
    margin-top: 10px;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge--public { background: #eef2fb; color: var(--color-accent-dark); }
.badge--admin { background: #fdf0dc; color: #a5670d; }

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
}

.login-card {
    width: 100%;
    max-width: 360px;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px 32px;
}

.login-card h1 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    text-align: center;
    margin-top: 0;
}

.content-form fieldset {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    padding: 18px 20px;
}

.content-form legend {
    font-family: var(--font-heading);
    color: var(--color-heading);
    padding: 0 6px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .nav-toggle { display: flex; }

    .nav {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 8px 20px 16px;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .nav.is-open {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav__link { padding: 10px 0; width: 100%; }
    .nav__link--accent { margin-top: 8px; text-align: center; }

    .gallery__grid { grid-template-columns: repeat(2, 1fr); }
    .hero__name { font-size: 1.9rem; }
    .admin-card__row { flex-direction: column; }
}
