/* ---------- Base / tokens ---------- */
:root {
    --ink: #1a1a1a;
    --ink-soft: #555;
    --paper: #ffffff;
    --paper-dim: #f4f3f1;
    --line: #ddd;
    --accent: #8a8a6a; /* muted olive, nodding to the venue's greens without copying anything */
    --danger: #a33;
    --radius: 6px;
    font-size: 16px;

    /* Photo grid column counts — change these to adjust density. */
    --grid-cols-mobile: 3;
    --grid-cols-tablet: 4;
    --grid-cols-desktop: 5;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
}

h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; margin: 0 0 0.4em; }

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.sr-only {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
    gap: 10px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-logo-large { height: 120px; margin: 0 auto; }
.brand-title { font-family: 'Playfair Display', serif; font-size: 1.1rem; color: var(--ink-soft); }

.site-nav { display: flex; gap: 16px; font-size: 0.95rem; }

.site-main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }

.site-footer {
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.85rem;
    padding: 24px 16px 40px;
}

/* ---------- Gate / login ---------- */
.gate-card {
    max-width: 360px;
    margin: 10vh auto 0;
    text-align: center;
    padding: 32px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.gate-sub { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 1.4em; }
.gate-form { display: flex; flex-direction: column; gap: 12px; }

/* ---------- Forms / buttons ---------- */
input[type="text"], input[type="password"], input[type="date"], input[type="time"],
input[type="number"], select, input[type="file"] {
    font-family: inherit;
    font-size: 1rem;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    width: 100%;
}

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .optional { font-weight: 400; color: var(--ink-soft); font-size: 0.85em; }
.field-hint { color: var(--ink-soft); font-size: 0.85rem; margin: 6px 0 0; }

.btn {
    display: inline-block;
    font-family: inherit;
    font-size: 1rem;
    padding: 10px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
}
.btn:hover { background: var(--paper-dim); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { opacity: 0.85; }
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: 5px 10px; font-size: 0.85rem; }
.btn-approve { border-color: #2f7a3d; color: #2f7a3d; }
.btn-reject, .btn-delete { border-color: var(--danger); color: var(--danger); }

.form-error { color: var(--danger); font-size: 0.9rem; }
.notice { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 0.95rem; }
.notice-success { background: #eef6ec; border: 1px solid #cfe6c8; }
.notice-error { background: #fbecec; border: 1px solid #f0c9c9; }

/* ---------- Gallery toolbar / filters ---------- */
.gallery-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.event-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.85rem;
    color: var(--ink-soft);
    white-space: nowrap;
}
.chip-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-upload-cta { white-space: nowrap; }

.page-title { margin-bottom: 0.3em; }
.page-sub { color: var(--ink-soft); margin-top: 0; margin-bottom: 24px; }
.section-title { margin-top: 40px; }

.empty-state { color: var(--ink-soft); text-align: center; padding: 60px 20px; }

/* ---------- Highlights (featured overview photos/videos) ---------- */
.highlights-section { margin-bottom: 32px; }
.highlights-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}
.highlights-title::before { content: '★'; color: var(--accent); }
.highlights-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 75%;
    margin: 0 auto;
}
@media (min-width: 700px) { .highlights-grid { grid-template-columns: repeat(2, 1fr); } }
.highlight-item {
    aspect-ratio: 16/9;
    border-radius: var(--radius);
}
.highlight-item .video-badge { font-size: 0.8rem; padding: 4px 12px; }

/* ---------- Photo grid ---------- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols-mobile), 1fr);
    gap: 6px;
}
@media (min-width: 600px) { .photo-grid { grid-template-columns: repeat(var(--grid-cols-tablet), 1fr); gap: 8px; } }
@media (min-width: 900px) { .photo-grid { grid-template-columns: repeat(var(--grid-cols-desktop), 1fr); } }

.grid-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border: none;
    padding: 0;
    background: var(--paper-dim);
    cursor: pointer;
    overflow: hidden;
    border-radius: 3px;
}
.grid-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid-item .no-preview {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: var(--ink-soft); font-size: 0.75rem; text-align: center; padding: 6px;
}
.video-badge {
    position: absolute; bottom: 6px; left: 6px;
    background: rgba(0,0,0,0.65); color: #fff;
    border-radius: 999px; padding: 3px 9px;
    display: flex; align-items: center; gap: 4px;
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,0.92);
    display: flex; align-items: center; justify-content: center;
    z-index: 100; padding: 20px;
}
.lightbox[hidden] { display: none; }
.lightbox-body { max-width: 100%; max-height: 100%; text-align: center; }
.lightbox-body img, .lightbox-body video {
    max-width: 100%; max-height: 78vh; border-radius: 4px;
}
.lightbox-close {
    position: absolute; top: 12px; right: 16px;
    background: none; border: none; color: #fff;
    font-size: 2rem; cursor: pointer; line-height: 1;
}
.lightbox-meta { color: #eee; margin-top: 14px; }
.lightbox-event { display: block; font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase; color: #bbb; margin-bottom: 4px; }
.lightbox-caption { margin: 0; font-size: 1rem; }

/* ---------- Upload page ---------- */
.upload-form { max-width: 520px; }
.preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin: 12px 0 20px;
}
.preview-item {
    position: relative;
    aspect-ratio: 1/1;
    border-radius: 4px;
    overflow: hidden;
    background: var(--paper-dim);
    font-size: 0.65rem;
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview-video-badge { display: flex; align-items: center; justify-content: center; height: 70%; font-size: 1.5rem; }
.preview-name {
    display: block; padding: 2px 4px; color: var(--ink-soft);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.upload-progress { color: var(--ink-soft); font-size: 0.9rem; margin-top: 10px; text-align: center; }

/* ---------- Responsive niceties ---------- */
@media (max-width: 480px) {
    .site-main { padding: 16px 12px 50px; }
    .gallery-toolbar { flex-direction: column; align-items: stretch; }
}
