/* =========================================
   Memorial Benjamin - Stylesheet
   Sober, modern, professional
   ========================================= */

:root {
    --bg: #ffffff;
    --bg-alt: #f8f8f7;
    --bg-card: #ffffff;
    --text: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --border: #e0e0e0;
    --border-light: #eeeeee;
    --accent: #2c2c2c;
    --accent-hover: #444444;
    --accent-soft: #f0f0f0;
    --green: #2d6a4f;
    --green-light: #edf7f0;
    --red: #9b2c2c;
    --red-light: #fef2f2;
    --amber: #92400e;
    --amber-light: #fffbeb;
    --purple: #5b21b6;

    --cat-chorale: #6d28d9;
    --cat-travail: #1d4ed8;
    --cat-ecole: #047857;
    --cat-voile: #0e7490;
    --cat-automobile: #b45309;
    --cat-amis: #be123c;
    --cat-autre: #4b5563;

    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
    --transition: 0.15s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.7; }

/* ---- Layout ---- */
.container { max-width: 1060px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 460px; }
.container-md { max-width: 680px; }
.section { padding: 3.5rem 0; }

/* ---- Navigation ---- */
.main-nav {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.nav-brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1.15;
}
.nav-brand-name {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}
.nav-brand-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.125rem;
}
.nav-link {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all var(--transition);
}
.nav-link:hover {
    color: var(--text);
    background: var(--accent-soft);
    opacity: 1;
}
.nav-btn-share {
    background: var(--accent) !important;
    color: #fff !important;
    font-weight: 500 !important;
    margin-left: 0.25rem;
}
.nav-btn-share:hover {
    background: var(--accent-hover) !important;
    opacity: 1 !important;
}
.nav-user { position: relative; cursor: pointer; }
.nav-user-name {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}
.nav-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 170px;
    padding: 0.375rem;
    z-index: 200;
}
.nav-dropdown::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}
.nav-user:hover .nav-dropdown,
.nav-user.open .nav-dropdown { display: block; }
.nav-dropdown a {
    display: block;
    padding: 0.45rem 0.7rem;
    border-radius: 6px;
    font-size: 0.825rem;
    color: var(--text-secondary);
}
.nav-dropdown a:hover { background: var(--accent-soft); color: var(--text); opacity: 1; }
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--text);
    border-radius: 1px;
}

/* ---- Flash ---- */
.flash { padding: 0.75rem 0; font-size: 0.85rem; }
.flash-success { background: var(--green-light); color: var(--green); border-bottom: 1px solid #c6f6d5; }
.flash-error { background: var(--red-light); color: var(--red); border-bottom: 1px solid #fecaca; }
.flash-warning { background: var(--amber-light); color: var(--amber); border-bottom: 1px solid #fde68a; }

/* ---- Hero ---- */
.hero {
    position: relative;
    background: url('../images/benjamin_portrait.jpg') center center / cover no-repeat;
    color: #fff;
    padding: 6rem 0;
    text-align: center;
    min-height: 480px;
    display: flex;
    align-items: center;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.65) 100%);
}
.hero-content { position: relative; z-index: 1; }
.hero-title {
    font-family: var(--font-serif);
    font-size: 3.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.125rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero-subtitle {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 400;
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 1.25rem;
}
.hero-divider {
    width: 40px;
    height: 1px;
    background: rgba(255,255,255,0.3);
    margin: 0 auto 1.5rem;
}
.hero-text {
    font-size: 1rem;
    line-height: 1.8;
    opacity: 0.85;
    max-width: 520px;
    margin: 0 auto 2rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.25rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { opacity: 0.85; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; opacity: 1; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--accent-soft); color: var(--text); opacity: 1; }
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,0.5); }
.hero .btn-outline:hover { background: rgba(255,255,255,0.15); color: #fff; }
.btn-lg { padding: 0.7rem 1.75rem; font-size: 0.9rem; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.78rem; }
.btn-xs { padding: 0.2rem 0.55rem; font-size: 0.72rem; }
.btn-full { width: 100%; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { opacity: 0.85; color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: 0.85; color: #fff; }

/* ---- Stats ---- */
.stats-section {
    padding: 2.5rem 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border-light);
}
.stats-grid { display: flex; justify-content: center; gap: 4rem; }
.stat-card { text-align: center; }
.stat-number {
    display: block;
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Section Headers ---- */
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}
.section-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}
.section-action { text-align: center; margin-top: 2rem; }
.page-header { margin-bottom: 2rem; }
.page-title {
    font-family: var(--font-serif);
    font-size: 1.85rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.35rem;
}
.page-subtitle { color: var(--text-secondary); font-size: 0.9rem; }

/* ---- Memory Cards ---- */
.memories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}
.memory-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.memory-card:hover { border-color: #ccc; box-shadow: var(--shadow); }
a.memory-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
a.memory-card-link .memory-card-title { color: var(--text); }
.memory-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}
.memory-category {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.cat-chorale { background: #ede9fe; color: var(--cat-chorale); }
.cat-travail { background: #dbeafe; color: var(--cat-travail); }
.cat-ecole { background: #d1fae5; color: var(--cat-ecole); }
.cat-voile { background: #cffafe; color: var(--cat-voile); }
.cat-automobile { background: #fef3c7; color: var(--cat-automobile); }
.cat-amis { background: #ffe4e6; color: var(--cat-amis); }
.cat-autre { background: #f3f4f6; color: var(--cat-autre); }

.memory-date { font-size: 0.75rem; color: var(--text-muted); }
.memory-card-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    line-height: 1.35;
}
.memory-card-title a { color: var(--text); }
.memory-card-title a:hover { opacity: 0.7; }
.memory-card-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 0.85rem;
}
.memory-card-with-thumb {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.memory-card-thumb {
    flex-shrink: 0;
    width: 120px;
    height: 100px;
    border-radius: var(--radius);
    overflow: hidden;
}
.memory-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.memory-card-body {
    flex: 1;
    min-width: 0;
}
.memory-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-light);
}

/* ---- Memory Full Page ---- */
.memory-full {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}
.memory-full-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}
.memory-full-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    letter-spacing: -0.015em;
}
.memory-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}
.memory-meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.825rem;
    color: var(--text-secondary);
}
.memory-meta-item svg { opacity: 0.5; }
.memory-how-met {
    background: var(--bg-alt);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.75rem;
    border-left: 3px solid var(--border);
}
.memory-how-met h3 {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
}
.memory-how-met p { font-size: 0.9rem; color: var(--text-secondary); }
.memory-story { font-size: 0.95rem; line-height: 1.85; margin-bottom: 1.75rem; }
.memory-photos { margin-top: 1.75rem; }
.memory-photos h3 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}
.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    display: block;
}
.gallery-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.03); }
.memory-actions {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}
.memory-nav { margin-top: 1.5rem; }

/* ---- Explore Tabs ---- */
.explore-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.tab {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition);
}
.tab:hover { color: var(--text); opacity: 1; }
.tab.active { color: var(--text); border-bottom-color: var(--text); }

/* ---- Timeline ---- */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}
.timeline-year { position: relative; margin: 1.75rem 0 0.75rem; }
.timeline-year span {
    display: inline-block;
    background: var(--text);
    color: #fff;
    padding: 0.15rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-sans);
    position: relative;
    left: -0.4rem;
}
.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-dot {
    position: absolute;
    left: -1.5rem;
    top: 0.6rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid var(--bg);
}
.cat-bg-chorale { background: var(--cat-chorale) !important; }
.cat-bg-travail { background: var(--cat-travail) !important; }
.cat-bg-ecole { background: var(--cat-ecole) !important; }
.cat-bg-voile { background: var(--cat-voile) !important; }
.cat-bg-automobile { background: var(--cat-automobile) !important; }
.cat-bg-amis { background: var(--cat-amis) !important; }
.cat-bg-autre { background: var(--cat-autre) !important; }

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.timeline-content.has-thumbnail {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.timeline-thumbnail {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: var(--radius);
    overflow: hidden;
}
.timeline-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.timeline-text {
    flex: 1;
    min-width: 0;
}
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}
.timeline-content h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    margin-bottom: 0.35rem;
}
a.timeline-item-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
a.timeline-item-link .timeline-content {
    transition: border-color var(--transition), box-shadow var(--transition);
}
a.timeline-item-link:hover .timeline-content {
    border-color: #ccc;
    box-shadow: var(--shadow);
}
.timeline-content p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.65; }
.timeline-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---- Categories Grid ---- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}
.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.25rem;
    text-align: center;
    transition: all var(--transition);
    text-decoration: none;
    border-top: 3px solid transparent;
}
.category-card:hover { box-shadow: var(--shadow); opacity: 1; border-color: var(--border); }
.cat-border-chorale { border-top-color: var(--cat-chorale); }
.cat-border-travail { border-top-color: var(--cat-travail); }
.cat-border-ecole { border-top-color: var(--cat-ecole); }
.cat-border-voile { border-top-color: var(--cat-voile); }
.cat-border-automobile { border-top-color: var(--cat-automobile); }
.cat-border-amis { border-top-color: var(--cat-amis); }
.cat-border-autre { border-top-color: var(--cat-autre); }

.category-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: #fff;
}
.category-card h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.15rem;
}
.category-count { font-size: 0.75rem; color: var(--text-muted); }
.category-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.category-detail-header h2 { font-family: var(--font-serif); font-size: 1.3rem; }

/* ---- Map ---- */
.explore-map, .life-map { border: 1px solid var(--border); border-radius: var(--radius-lg); }
.map-stats { margin-bottom: 1rem; }
.map-stat { font-size: 0.825rem; color: var(--text-secondary); }
.map-popup { font-family: var(--font-sans); font-size: 0.8rem; line-height: 1.5; }
.map-popup strong { font-size: 0.85rem; }
.map-popup a { color: var(--accent); font-size: 0.78rem; }
.map-popup hr { border: none; border-top: 1px solid var(--border-light); }
.map-legend {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 0.6rem 0.85rem;
    font-size: 0.75rem;
    box-shadow: var(--shadow);
    line-height: 1.7;
}
.map-legend strong {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.legend-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

/* ---- Gallery ---- */
.gallery-filters { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-bottom: 1.75rem; }
.filter-btn {
    padding: 0.3rem 0.85rem;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    opacity: 1;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}
.gallery-grid-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    display: block;
}
.gallery-grid-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.gallery-grid-item:hover img { transform: scale(1.03); }
.gallery-grid-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
    padding: 1.5rem 0.75rem 0.75rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.gallery-grid-item:hover .gallery-grid-overlay { opacity: 1; }
.gallery-grid-title { display: block; color: #fff; font-size: 0.8rem; font-weight: 500; }
.gallery-grid-meta { display: block; color: rgba(255,255,255,0.6); font-size: 0.7rem; }

/* ---- Home Photo Grid ---- */
.home-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.home-photo-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    display: block;
}
.home-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.home-photo-item:hover img {
    transform: scale(1.05);
}
.home-photo-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 2rem 0.75rem 0.75rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.home-photo-item:hover .home-photo-overlay {
    opacity: 1;
}
.home-photo-title {
    display: block;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
}
.home-photo-category {
    display: block;
    color: rgba(255,255,255,0.65);
    font-size: 0.75rem;
    margin-top: 0.15rem;
}
.home-photo-grid-blurred .home-photo-item img {
    filter: blur(12px);
    transform: scale(1.1);
}
.home-photo-grid-blurred .home-photo-item {
    pointer-events: none;
}
.home-photo-grid-blurred .home-photo-overlay {
    display: none;
}
.home-photo-login-hint {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.home-photo-login-hint p {
    margin-bottom: 0.75rem;
}
@media (max-width: 768px) {
    .home-photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .timeline-content.has-thumbnail {
        flex-direction: column;
    }
    .timeline-thumbnail {
        width: 100%;
        height: 160px;
    }
    .memory-card-with-thumb {
        flex-direction: column;
    }
    .memory-card-thumb {
        width: 100%;
        height: 160px;
    }
}
@media (max-width: 480px) {
    .home-photo-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* ---- CTA ---- */
.cta-section { background: var(--bg-alt); border-top: 1px solid var(--border-light); }
.cta-card {
    text-align: center;
    padding: 2.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.cta-card h2 { font-family: var(--font-serif); font-size: 1.4rem; margin-bottom: 0.5rem; }
.cta-card p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
    font-size: 0.9rem;
}

/* ---- Auth ---- */
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
}
.auth-title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 0.3rem;
}
.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.75rem;
}
.auth-switch {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.auth-switch a { font-weight: 500; text-decoration: underline; }

/* ---- Forms ---- */
.form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label { font-size: 0.825rem; font-weight: 500; color: var(--text); }
.required { color: var(--red); }
.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text);
    background: var(--bg);
    transition: border-color var(--transition);
    width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-actions { text-align: center; padding-top: 0.75rem; }
.form-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.6rem; }
.form-input-disabled { background: var(--bg-alt); color: var(--text-muted); cursor: not-allowed; }

/* ---- File Upload ---- */
.file-upload {
    position: relative;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-alt);
}
.file-upload:hover, .file-upload.dragover { border-color: var(--accent); }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; font-size: 0; }
.file-upload-content { color: var(--text-muted); }
.file-upload-content svg { margin: 0 auto 0.5rem; opacity: 0.3; }
.file-upload-content p { font-size: 0.85rem; margin-bottom: 0.15rem; }
.file-upload-content small { font-size: 0.75rem; color: var(--text-muted); }
.upload-warning {
    background: var(--amber-light);
    color: var(--amber);
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    line-height: 1.55;
    margin-bottom: 0.5rem;
}
.upload-warning strong { font-weight: 600; }
.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.375rem;
    margin-top: 0.375rem;
}
.photo-preview-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
}
.existing-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}
.existing-photo img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
}

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--accent-soft);
    color: var(--text-secondary);
}
.badge-approved { background: var(--green-light); color: var(--green); }
.badge-pending { background: var(--amber-light); color: var(--amber); }
.badge-admin { background: #ede9fe; color: var(--purple); }

/* ---- My Memories ---- */
.my-memories-list { display: flex; flex-direction: column; gap: 0.6rem; }
.my-memory-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.my-memory-info h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}
.my-memory-item-clickable {
    position: relative;
    transition: border-color var(--transition), box-shadow var(--transition);
    cursor: pointer;
}
.my-memory-item-clickable:hover {
    border-color: #ccc;
    box-shadow: var(--shadow);
}
.my-memory-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.my-memory-actions {
    position: relative;
    z-index: 2;
}
.my-memory-info h3 { color: var(--text); }
.my-memory-meta {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---- Admin ---- */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.85rem;
    margin-bottom: 2rem;
}
.admin-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}
.admin-stat-highlight { border-color: #fbbf24; background: var(--amber-light); }
.admin-stat-number {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}
.admin-stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.admin-nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.admin-nav-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-decoration: none;
    transition: all var(--transition);
}
.admin-nav-card:hover { box-shadow: var(--shadow); border-color: #ccc; opacity: 1; }
.admin-nav-card h3 { font-family: var(--font-serif); font-size: 1.1rem; color: var(--text); margin-bottom: 0.3rem; }
.admin-nav-card p { font-size: 0.825rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.admin-table-wrapper { overflow-x: auto; }
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    font-size: 0.85rem;
}
.admin-table th {
    background: var(--bg-alt);
    padding: 0.6rem 0.85rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.admin-table td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border-light);
}
.admin-table tr:last-child td { border-bottom: none; }
.row-pending { background: var(--amber-light); }
.admin-actions { display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; }
.text-muted { color: var(--text-muted); font-size: 0.75rem; }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}
.empty-state p { margin-bottom: 1.25rem; font-size: 0.9rem; }

/* ---- Footer ---- */
.site-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    text-align: center;
}
.footer-text {
    font-size: 0.825rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}
.footer-sub { font-size: 0.75rem; color: var(--text-muted); }

/* ---- Lightbox ---- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.lightbox-overlay.active { opacity: 1; }
.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0; right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem;
        flex-direction: column;
        box-shadow: var(--shadow-lg);
    }
    .nav-links.open { display: flex; }
    .nav-link { padding: 0.6rem 0.75rem; }
    .nav-user { width: 100%; }
    .nav-dropdown { position: static; box-shadow: none; border: none; padding-left: 0.75rem; }
    .hero { padding: 3.5rem 0; min-height: 360px; }
    .hero-title { font-size: 2.25rem; }
    .hero-subtitle { font-size: 1rem; }
    .hero-actions { flex-direction: column; align-items: center; }
    .stats-grid { gap: 2rem; }
    .stat-number { font-size: 2rem; }
    .memories-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .memory-full { padding: 1.25rem; }
    .memory-full-title { font-size: 1.5rem; }
    .memory-meta { flex-direction: column; gap: 0.35rem; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .my-memory-item { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
    .page-title { font-size: 1.5rem; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.85rem; }
    .categories-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .photo-gallery { grid-template-columns: repeat(2, 1fr); }
}
