/* ==========================================================================
   Design System — CSS Custom Properties
   Neutral grey/charcoal base (to sit well with the logo's black-and-white
   line art) with one warm, travel-postcard accent colour.
   ========================================================================== */
:root {
    /* Brand */
    --primary:        #b5562a;   /* terracotta — links, buttons, active states */
    --primary-dark:   #8f431f;
    --accent:         #d9a441;   /* warm gold — category tags, section labels */

    /* Neutrals (warm-tinted, not cold blue-grey) */
    --bg-base:        #f7f5f2;
    --bg-surface:     #ffffff;
    --border-light:   #e0ddd7;
    --text-base:      #2b2b2b;
    --text-muted:     #6b6b6b;

    /* Status */
    --success:        #16a34a;
    --success-bg:     #dcfce7;
    --error:          #dc2626;
    --error-bg:       #fee2e2;

    /* Typography */
    --font-heading:   'Outfit', sans-serif;
    --font-body:      'Inter', sans-serif;

    /* Spacing scale */
    --radius:         8px;
    --radius-lg:      12px;
    --shadow:         0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text-base);
    background: var(--bg-base);
    line-height: 1.6;
}
h1, h2, h3, h4 { font-family: var(--font-heading); margin: 0 0 0.5em; }
a { color: var(--primary); }
img { max-width: 100%; display: block; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg-surface); color: var(--text-base); border-color: var(--border-light); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--error); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.9rem; }
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--bg-surface);
}
.form-control:focus { outline: none; border-color: var(--primary); }
.form-control::file-selector-button,
.form-control::-webkit-file-upload-button {
    padding: 6px 14px;
    margin-right: 12px;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    background: transparent;
    color: var(--primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.form-control::file-selector-button:hover,
.form-control::-webkit-file-upload-button:hover {
    background: var(--primary);
    color: #fff;
}

.password-field-wrapper { position: relative; }
.password-field-wrapper .form-control { padding-right: 42px; }
.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: none;
    border: none;
    line-height: 0;
    color: var(--text-muted);
    cursor: pointer;
}
.password-toggle-btn:hover { color: var(--text-base); }
.password-toggle-btn svg { width: 18px; height: 18px; }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
}
.card-title { font-size: 1.15rem; margin-bottom: 8px; }
.card-content { color: var(--text-muted); }

/* ── Headings / labels ────────────────────────────────────────────────── */
.page-title { font-size: 2rem; margin-bottom: 24px; }
.section-title { font-size: 1.6rem; margin-bottom: 12px; }
.section-label { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; color: var(--accent); font-weight: 700; }

.section-header-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 12px; }
.section-header-row .section-title { margin-bottom: 0; }
@media (min-width: 640px) { .section-header-row { flex-direction: row; justify-content: space-between; align-items: baseline; } }

/* ── Alerts ───────────────────────────────────────────────────────────── */
.success-msg, .error-msg {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 0.95rem;
}
.success-msg { background: var(--success-bg); color: var(--success); }
.error-msg { background: var(--error-bg); color: var(--error); }

/* ── Header / nav ─────────────────────────────────────────────────────── */
.main-header { background: var(--bg-surface); border-bottom: 1px solid var(--border-light); position: sticky; top: 0; z-index: 200; }
.header-container { display: flex; align-items: center; justify-content: space-between; height: 132px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-img { height: 112px; width: auto; }
.logo-text { font-family: var(--font-heading); font-weight: 700; font-size: 1.2rem; color: var(--text-base); }
.main-nav { display: flex; align-items: center; gap: 24px; }
.nav-links { display: flex; list-style: none; gap: 20px; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--text-base); font-weight: 500; }
.nav-links a:hover { color: var(--primary); }
.auth-links { display: flex; gap: 10px; align-items: center; }

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text-base); transition: transform .25s, opacity .25s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 767px) {
    .hamburger { display: flex; }
    .main-nav { display: none; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0; background: var(--bg-surface); border-bottom: 1px solid var(--border-light); padding: 16px; z-index: 100; }
    .main-nav.open { display: flex; }
    .nav-links { flex-direction: column; gap: 0; }
    .auth-links { flex-direction: column; gap: 8px; margin-top: 16px; }
}

/* ── Content / footer ─────────────────────────────────────────────────── */
.main-content { min-height: 60vh; padding: 32px 0; }

.subscribe-band { background: var(--text-base); color: #fff; padding: 32px 0; }
.subscribe-inner { display: flex; flex-direction: column; gap: 20px; align-items: center; text-align: center; }
.subscribe-inner h3 { color: #fff; margin-bottom: 4px; }
.subscribe-inner .text-muted { color: rgba(255,255,255,0.65); }
.subscribe-form { display: flex; gap: 10px; width: 100%; max-width: 420px; flex-wrap: wrap; }
.subscribe-form .form-control { flex: 1; min-width: 200px; }
@media (min-width: 768px) {
    .subscribe-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

.main-footer { background: #1f1f1f; color: #fff; padding: 32px 0; }
.footer-container { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: #fff; opacity: 0.85; text-decoration: none; }
.footer-copy { opacity: 0.7; font-size: 0.85rem; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-base); }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-light); white-space: nowrap; }
th { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }

/* ── Auth pages ───────────────────────────────────────────────────────── */
.auth-container {
    max-width: 420px;
    margin: 60px auto;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 36px;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero-section {
    text-align: center;
    padding: 48px 20px 32px;
}
.hero-section .page-title { margin-bottom: 16px; }
.hero-section p { max-width: 640px; margin: 0 auto 24px; color: var(--text-muted); font-size: 1.1rem; }

/* ── Category tags / badges ──────────────────────────────────────────── */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    background: rgba(217, 164, 65, 0.16);
    color: #8a6415;
}
.tag:hover { background: var(--accent); color: #fff; }
.tag-year {
    background: rgba(181, 86, 42, 0.1);
    color: var(--primary-dark);
}
.tag-year:hover { background: var(--primary); color: #fff; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 28px; padding: 16px; background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.filter-bar .filter-label { font-weight: 600; font-size: 0.85rem; color: var(--text-muted); margin-right: 4px; }
.filter-bar a.tag.active, .filter-bar a.tag-year.active { background: var(--primary); color: #fff; }

/* ── Blog post cards / list ──────────────────────────────────────────── */
.post-grid { display: grid; grid-template-columns: 1fr; gap: 28px; margin: 24px 0; }
@media (min-width: 768px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
.post-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.post-card-image { width: 100%; height: 200px; object-fit: cover; background: var(--border-light); }
.post-card-body { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.post-card-title { font-size: 1.25rem; margin-bottom: 8px; }
.post-card-title a { color: var(--text-base); text-decoration: none; }
.post-card-title a:hover { color: var(--primary); }
.post-card-meta { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 10px; }
.post-card-excerpt { color: var(--text-muted); flex-grow: 1; margin-bottom: 14px; }

.pagination { display: flex; gap: 8px; justify-content: center; margin: 32px 0; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--border-light); text-decoration: none; color: var(--text-base); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Single post ──────────────────────────────────────────────────────── */
.post-header { margin-bottom: 24px; }
.post-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius-lg); margin-bottom: 24px; }
.post-content { font-size: 1.05rem; line-height: 1.8; }
.post-content img { border-radius: var(--radius); margin: 20px 0; }
.post-content h1, .post-content h2, .post-content h3 { margin-top: 1.4em; }

/* ── Gallery ──────────────────────────────────────────────────────────── */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 24px 0; }
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }
.gallery-item { position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer; background: var(--border-light); aspect-ratio: 1 / 1; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.gallery-item:hover img { transform: scale(1.05); }

.lightbox-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85);
    display: none; align-items: center; justify-content: center;
    z-index: 999; padding: 24px; flex-direction: column;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img { max-width: 90vw; max-height: 75vh; border-radius: var(--radius); }
.lightbox-caption { color: #fff; margin-top: 16px; text-align: center; max-width: 640px; }
.lightbox-caption a { color: var(--accent); }
.lightbox-close { position: absolute; top: 20px; right: 28px; color: #fff; font-size: 2rem; background: none; border: none; cursor: pointer; line-height: 1; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.15); color: #fff; border: none; font-size: 1.6rem; padding: 12px 16px; cursor: pointer; border-radius: var(--radius); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ── Comments ─────────────────────────────────────────────────────────── */
.comments-section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border-light); }
.comment-list { list-style: none; padding: 0; margin: 20px 0; }
.comment-item { background: var(--bg-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.comment-author { font-weight: 700; margin-bottom: 4px; }
.comment-date { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }
.comment-form { background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px; margin-top: 20px; }
.honeypot-field { position: absolute; left: -9999px; opacity: 0; height: 0; }

/* ── Admin nav ────────────────────────────────────────────────────────── */
.admin-nav-section { text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.06em; color: var(--text-muted); margin: 20px 0 8px; font-weight: 700; }
.admin-nav-link { display: inline-block; margin: 4px 12px 4px 0; padding: 8px 14px; background: var(--bg-surface); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--text-base); font-weight: 500; font-size: 0.9rem; }
.admin-nav-link:hover { background: var(--primary); color: #fff; }

/* ── Admin detail panels / status badges ──────────────────────────────── */
.detail-panel { background: var(--bg-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px; margin-bottom: 24px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; text-transform: capitalize; }
.badge-draft, .badge-pending { background: #fef3c7; color: #92400e; }
.badge-published, .badge-approved { background: var(--success-bg); color: var(--success); }
.badge-rejected { background: var(--error-bg); color: var(--error); }

.thumb-preview { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius); }
