:root {
    --bg: #0f0d0b;
    --bg-soft: #17140f;
    --bg-card: #1d1812;
    --bg-card-hover: #241e15;
    --gold: #d4af37;
    --gold-light: #e8c96a;
    --red: #a83232;
    --red-bright: #c04a3e;
    --orange: #e8833a;
    --text: #ece4d5;
    --muted: #a89d8c;
    --border: #3a3124;
    --border-light: #4d4232;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);

    --font-serif: Georgia, 'Times New Roman', 'PT Serif', Times, serif;
    --font-display: 'Palatino Linotype', 'Book Antiqua', Georgia, serif;

    --radius: 8px;
    --header-h: 64px;

    --transition: .22s cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background:
        radial-gradient(1200px 600px at 50% -200px, rgba(212, 175, 55, .06), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: var(--font-serif);
    line-height: 1.6;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }
a { color: var(--gold-light); }
a:hover { color: var(--gold); }

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

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(23, 20, 15, .9);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--gold);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-h);
    gap: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--text);
    text-decoration: none;
}
.brand-cross {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 26px;
    color: var(--gold);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: linear-gradient(180deg, #241e15, #17140f);
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .12);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-family: var(--font-display); font-size: 19px; letter-spacing: .4px; color: var(--text); }
.brand-text em { color: var(--muted); font-size: 12px; font-style: normal; letter-spacing: .3px; }

.auth-nav { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.auth-nav a { color: var(--gold); text-decoration: none; font-size: 15px; white-space: nowrap; }
.auth-nav a:hover { color: var(--gold-light); }
.auth-nav .inline { display: inline; }
.link-btn {
    background: none; border: none; color: var(--gold); cursor: pointer;
    font-family: inherit; font-size: 15px; padding: 0;
}
.link-btn:hover { color: var(--gold-light); }
.user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
    background: var(--bg-card); color: var(--gold); text-decoration: none;
    font-size: 14px;
}
.user-chip:hover { border-color: var(--gold); }
.lang-switch {
    display: inline-flex; align-items: center;
    gap: 2px; border: 1px solid var(--gold); border-radius: 999px;
    padding: 2px; background: transparent;
}
.lang-switch a {
    display: inline-flex; align-items: center;
    padding: 3px 8px; border-radius: 999px;
    color: var(--gold); font-weight: 700; letter-spacing: 0.03em;
    font-size: 12px; text-decoration: none; line-height: 1.2;
}
.lang-switch a:hover { color: var(--gold-light); }
.lang-switch a.active { background: var(--gold); color: #14100c; }

/* mobile nav toggle (hamburger) */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px; height: 44px;
    background: none; border: 1px solid var(--border); border-radius: 8px;
    cursor: pointer; padding: 0 10px;
}
.nav-toggle span {
    display: block; height: 2px; width: 100%;
    background: var(--gold); border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Main nav ---------- */
.main-nav {
    background: #0a0806;
    border-bottom: 1px solid var(--border);
}
.main-nav ul {
    display: flex; flex-wrap: wrap; list-style: none;
    margin: 0; padding: 0;
}
.main-nav a {
    display: block; padding: 12px 16px;
    color: var(--text); text-decoration: none; font-size: 16px;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--gold); background: rgba(212, 175, 55, .05); }
.main-nav a.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ---------- Content ---------- */
.main-content { padding-top: 28px; padding-bottom: 70px; min-height: 62vh; }

/* ---------- Cards / articles ---------- */
.card {
    background: linear-gradient(180deg, var(--bg-card), #18130d);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
.card h1 { font-family: var(--font-display); font-size: 24px; color: var(--text); margin: 0 0 14px; letter-spacing: .3px; }
.card h2 { font-family: var(--font-display); font-size: 20px; color: var(--gold); margin: 22px 0 12px; }
.card h3 { font-family: var(--font-display); font-size: 16px; color: var(--gold); margin: 18px 0 10px; }
.card .meta { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

/* prose (article content incl legacy HTML) */
.prose {
    font-size: 14px;
    max-width: 68ch;
}
.card .prose { margin-inline: auto; }
/* Center article-body text on the public site; not on admin cards where headings stay left-aligned. */
body:not(.admin) .card > p, body:not(.admin) .card > ul, body:not(.admin) .card > ol { max-width: 68ch; margin-inline: auto; }
.prose h2, .prose h3 { color: var(--gold); font-family: var(--font-display); }
.prose p { margin: 14px 0; }
.prose img { border-radius: 6px; margin: 12px 0; }
.prose a { color: var(--gold-light); }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin: 6px 0; }
.prose table {
    border-collapse: collapse; width: 100%;
    display: block; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 14px 0;
}
.prose table td, .prose table th {
    border: 1px solid var(--border);
    padding: 8px 10px;
    vertical-align: top;
    font-size: 15px;
}
.prose blockquote {
    margin: 16px 0; padding: 6px 18px;
    border-left: 3px solid var(--gold);
    color: var(--muted);
}
.prose hr { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

/* article link */
.article-link { color: var(--gold); text-decoration: none; }
.article-link:hover { color: var(--gold-light); }
a.card { text-decoration: none; color: var(--text); transition: transform var(--transition), border-color var(--transition), background var(--transition); }
a.card:hover { transform: translateY(-3px); border-color: var(--gold); background: var(--bg-card-hover); }

/* article title list (category page) */
.article-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 68ch;
}
.article-list li {
    margin: 8px 0;
}
.article-list li::before {
    content: "–\00a0\00a0";
    color: var(--muted);
}

/* per-user new/read indicators */
.badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
}
.badge-new { background: var(--red-bright); color: #fff; }
.badge-comments { background: var(--orange); color: #fff; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* ---------- Galleries ---------- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.photo-grid a {
    position: relative; display: block;
    border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
    background: var(--bg-card);
}
.photo-grid img { width: 100%; height: 170px; object-fit: cover; display: block; transition: transform .25s; }
.photo-grid a:hover img { transform: scale(1.06); }
.photo-grid a:hover { border-color: var(--gold); }

.video-thumb { border-radius: 6px; overflow: hidden; margin-bottom: 12px; position: relative; }
.video-thumb img { width: 100%; height: 190px; object-fit: cover; display: block; }
.video-card { text-align: center; }
.video-frame { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: 6px; overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Comments ---------- */
.comments { margin-top: 30px; }
#comments, #comment-form { scroll-margin-top: 84px; }
.comments h3 {
    color: var(--gold); border-bottom: 1px solid var(--border);
    padding-bottom: 8px; font-family: var(--font-display); font-size: 20px;
}
.comment {
    border-left: 3px solid var(--gold);
    background: var(--bg-soft);
    padding: 14px 18px;
    margin-bottom: 14px;
    border-radius: 0 6px 6px 0;
}
.comment .c-meta { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.comment .c-user { color: var(--gold); font-weight: bold; }
.comment-form textarea {
    width: 100%; background: #0d0b09; color: var(--text);
    border: 1px solid var(--border); border-radius: 6px; padding: 12px;
    font-family: inherit; font-size: 15px; min-height: 100px; resize: vertical;
}
.comment-form textarea:focus { outline: none; border-color: var(--gold); }
.comment-form { margin-top: 22px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 14px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; background: #0d0b09; color: var(--text);
    border: 1px solid var(--border); border-radius: 6px;
    padding: 11px 12px; font-family: inherit; font-size: 15px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .12);
}
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-group label.checkbox-label { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 0; }
.form-group label.checkbox-label input[type="checkbox"] { width: auto; margin: 0; }

.btn {
    display: inline-block;
    background: linear-gradient(180deg, var(--gold), #b18f26);
    color: #1a1400; border: none; padding: 11px 26px; cursor: pointer;
    border-radius: 6px; font-size: 15px; font-weight: bold; font-family: inherit;
    text-decoration: none; text-align: center;
    transition: filter var(--transition), transform var(--transition);
}
.btn:hover { filter: brightness(1.08); color: #1a1400; }
.btn:active { transform: translateY(1px); }
.btn-secondary {
    background: transparent; color: var(--gold-light);
    border: 1px solid var(--border-light); font-weight: normal;
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: linear-gradient(180deg, var(--red-bright), #8a2b22); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ---------- Admin inline actions (on public pages) ---------- */
.article-actions {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    padding-bottom: 14px; margin-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.article-actions form.inline { display: inline-flex; }

.comment-actions {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.comment-edit { position: relative; }
.comment-edit summary {
    list-style: none; cursor: pointer; user-select: none;
}
.comment-edit summary::-webkit-details-marker { display: none; }
.comment-edit .comment-edit-form {
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: 6px; padding: 14px;
    margin-top: 12px;
}
.comment-actions .inline { display: inline-flex; }

/* ---------- Alerts ---------- */
.alert {
    background: #222c22; border: 1px solid #3f6d3f; color: #cbefcb;
    padding: 12px 18px; border-radius: 6px; margin-bottom: 20px;
}
.alert-error { background: #2e1d1a; border-color: var(--red); color: #f0c4bb; }
.alert-error ul { margin: 0; padding-left: 18px; }
.alert-warning { background: #2e271a; border-color: #6d5a2c; color: #efdca9; }

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .92);
    display: none; align-items: center; justify-content: center;
    z-index: 999; cursor: zoom-out; padding: 20px;
}
.lightbox.open { display: flex; animation: fade .2s; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.lightbox .lb-close {
    position: absolute; top: 16px; right: 22px;
    color: #fff; font-size: 34px; cursor: pointer; line-height: 1;
    opacity: .8;
}
.lightbox .lb-close:hover { opacity: 1; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; justify-content: center; }
.pagination a, .pagination .page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: 6px;
    color: var(--text); text-decoration: none; background: var(--bg-card);
    font-size: 14px;
}
.pagination a:hover { border-color: var(--gold); color: var(--gold); }
.pagination .page-link.active { background: var(--gold); color: #1a1400; font-weight: bold; border-color: var(--gold); }
.pagination .page-link.disabled { opacity: .4; pointer-events: none; }

/* ---------- Auth ---------- */
.auth-box { max-width: 420px; margin: 40px auto; }

/* ---------- Footer ---------- */
.site-footer {
    background: #0a0806; border-top: 2px solid var(--gold);
    padding: 30px 0; text-align: center; color: var(--muted);
}
.site-footer a { color: var(--gold); text-decoration: none; }
.site-footer a:hover { color: var(--gold-light); }
.site-footer .motto { color: var(--gold); font-style: italic; margin-top: 8px; letter-spacing: .5px; }

/* ---------- Helpers ---------- */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 20px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.breadcrumbs a { color: var(--gold-light); text-decoration: none; }
.breadcrumbs a:hover { color: var(--gold); }
.breadcrumbs .sep { opacity: .5; }

/* ---------- Accessibility ---------- */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    body { font-size: 14px; }
    .card { padding: 18px 18px; }

    /* keep section buttons always visible on small screens */
    .nav-toggle { display: none; }
    .main-nav { display: block; }
    .main-nav ul { flex-direction: row; flex-wrap: wrap; padding: 4px 0; }
    .main-nav a { padding: 10px 14px; font-size: 15px; }

    .auth-nav { gap: 8px; }
    .auth-nav a { font-size: 14px; }
    .user-chip { padding: 5px 10px; font-size: 13px; }
    .brand-text strong { font-size: 16px; }
    .header-inner { gap: 10px; }

    .form-row { flex-direction: column; gap: 0; }
    .card h1 { font-size: 20px; }
    .card h2 { font-size: 18px; }
    .photo-grid img { height: 150px; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .grid-2, .grid-3 { gap: 16px; }
}

@media (max-width: 480px) {
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
    .photo-grid img { height: 120px; }
    .brand-text em { display: none; }
    .card .prose table { font-size: 14px; }
}

.table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--gold); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.table tr:hover td { background: var(--bg-card-hover); }
.table form { margin: 0; }
