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

:root {
    --bg: #f9f9f9;
    --surface: #ffffff;
    --text: #23272b;
    --muted: #6b7280;
    --accent: #2c7be5;
    --accent-dark: #1c5fbf;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

/* ===== Header ===== */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 48px 0 36px;
    text-align: center;
}

.site-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.site-desc {
    margin-top: 10px;
    color: var(--muted);
    font-size: 1.05rem;
}

/* ===== Filters ===== */
.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 36px 0;
}

.filter-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 9px 20px;
    border-radius: 999px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ===== Gallery grid ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 60px;
}

.gallery-item {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

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

.gallery-item figcaption {
    padding: 12px 14px;
    font-size: 0.95rem;
    color: var(--text);
}

.gallery-item.hidden {
    display: none;
}

.empty-msg {
    text-align: center;
    color: var(--muted);
    margin: 60px 0;
    font-size: 1.1rem;
}

/* ===== Contact ===== */
.contact {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    margin-bottom: 60px;
}

.contact h2 {
    margin-bottom: 10px;
}

.contact a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.contact a:hover {
    text-decoration: underline;
}

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

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lightbox.open {
    display: flex;
}

.lb-content {
    max-width: 90vw;
    max-height: 88vh;
    text-align: center;
}

.lb-content img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    object-fit: contain;
}

.lb-caption {
    color: #fff;
    margin-top: 14px;
    font-size: 1.05rem;
}

.lb-close,
.lb-prev,
.lb-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
    user-select: none;
}

.lb-close {
    top: 20px;
    right: 24px;
    width: 46px;
    height: 46px;
    font-size: 30px;
    line-height: 1;
}

.lb-prev,
.lb-next {
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    font-size: 24px;
}

.lb-prev { left: 20px; }
.lb-next { right: 20px; }

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 680px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .site-title { font-size: 1.8rem; }
    .gallery-item img { height: 200px; }
}

@media (max-width: 420px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .lb-prev, .lb-next { width: 44px; height: 44px; }
}


/* ===================== Admin panel ===================== */
.admin-body {
    background: #f4f6f8;
}

.admin-topbar {
    background: #23272b;
    color: #fff;
    padding: 14px 0;
}

.admin-topbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-topbar .brand {
    font-weight: 700;
    font-size: 1.1rem;
}

.admin-nav {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-nav a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
}

.admin-nav a:hover,
.admin-nav a.active {
    color: #fff;
}

.admin-main {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 20px;
}

.admin-main h1 {
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.card h2 {
    font-size: 1.15rem;
    margin-bottom: 16px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat .num {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat .label {
    color: var(--muted);
    margin-top: 4px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}

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

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
}

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

.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

table.data {
    width: 100%;
    border-collapse: collapse;
}

table.data th,
table.data td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 0.92rem;
}

table.data th {
    color: var(--muted);
    font-weight: 600;
}

table.data img.thumb {
    width: 70px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
}

.dash-links {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* Login page */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 36px;
    width: 100%;
    max-width: 380px;
}

.login-box h1 {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 24px;
}

.login-box .btn { width: 100%; }
