/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-bg: #F7F5F2;
    --color-surface: #ffffff;
    --color-text: #1C1917;
    --color-text-muted: #78716C;
    --color-primary: #2A7F7F;
    --color-primary-hover: #1F6060;
    --color-border: #E7E0D8;
    --color-danger: #dc2626;
    --color-success: #16a34a;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    --max-width: 1020px;
    --content-width: 720px;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: rgba(42,127,127,0.4); }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* === Header === */
.site-header { border-bottom: 1px solid var(--color-border); padding: 1rem 0; }
.site-header .container { display: flex; justify-content: space-between; align-items: center; }
.site-logo { font-size: 1.25rem; font-weight: 700; color: var(--color-text); font-family: var(--font-serif); }
.site-logo:hover { text-decoration: none; }
.site-nav a { color: var(--color-text-muted); margin-left: 1.5rem; font-size: 0.9rem; }
.site-nav a.active { color: var(--color-primary); font-weight: 600; }

/* === Footer === */
.site-footer { border-top: 1px solid var(--color-border); padding: 2rem 0; margin-top: 4rem; text-align: center; color: var(--color-text-muted); font-size: 0.85rem; }

/* === Main Content === */
main.container { padding-top: 2rem; padding-bottom: 2rem; }

/* === Page Titles === */
.page-title { font-size: 1.75rem; margin-bottom: 2rem; }
.tag-highlight { color: var(--color-primary); }

/* === Post Cards === */
.post-list { display: flex; flex-direction: column; gap: 2.5rem; }
.post-card { background: var(--color-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; }
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.post-card-image img { width: 100%; height: 240px; object-fit: cover; opacity: 0; transition: opacity 0.3s; }
.post-card-image img.loaded { opacity: 1; }
.post-card-body { padding: 1.5rem; }
.post-card-title { font-size: 1.25rem; margin-bottom: 0.5rem; }
.post-card-title a { color: var(--color-text); }
.post-card-excerpt { color: var(--color-text-muted); font-size: 0.95rem; margin-bottom: 1rem; }
.post-card-meta { display: flex; align-items: center; gap: 1rem; font-size: 0.8rem; color: var(--color-text-muted); }
.post-card-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* === Tags === */
.tag { display: inline-block; background: var(--color-bg); border: 1px solid var(--color-border); padding: 0.15rem 0.5rem; border-radius: 1rem; font-size: 0.75rem; color: var(--color-text-muted); }
.tag:hover { text-decoration: none; border-color: var(--color-primary); color: var(--color-primary); }

/* === Single Post === */
.post-single { max-width: var(--content-width); margin: 0 auto; }
.post-header { margin-bottom: 2rem; }
.post-title { font-size: 2.25rem; font-family: var(--font-serif); line-height: 1.3; margin-bottom: 0.5rem; }
.post-date { color: var(--color-text-muted); font-size: 0.9rem; }
.post-cover { margin-bottom: 2rem; border-radius: var(--radius); overflow: hidden; }
.post-tags { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* === Comments === */
.comments-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--color-border); }
.comments-heading { font-size: 1.3rem; margin-bottom: 1.5rem; }
.comments-empty { color: var(--color-text-muted); font-style: italic; margin-bottom: 2rem; }
.comments-list { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 2rem; }
.comment { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.comment-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.comment-author { font-weight: 600; font-size: 0.95rem; }
.comment-location { color: var(--color-text-muted); font-size: 0.8rem; }
.comment-location::before { content: "\00b7"; margin-right: 0.25rem; }
.comment-time { color: var(--color-text-muted); font-size: 0.8rem; margin-left: auto; }
.comment-body { font-size: 0.95rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.comment-form { display: flex; flex-direction: column; gap: 0.75rem; }
.comment-form-fields { display: flex; flex-direction: column; gap: 0.75rem; }
.comment-input { padding: 0.6rem 0.8rem; border: 1px solid var(--color-border); border-radius: var(--radius); font-family: var(--font-sans); font-size: 0.9rem; width: 100%; max-width: 320px; }
.comment-input:focus, .comment-textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(42, 127, 127, 0.15); }
.comment-textarea { padding: 0.6rem 0.8rem; border: 1px solid var(--color-border); border-radius: var(--radius); font-family: var(--font-sans); font-size: 0.9rem; min-height: 100px; resize: vertical; width: 100%; }
.comment-form .btn { align-self: flex-start; }

/* === Prose (post content) === */
.prose { font-family: var(--font-serif); font-size: 1.1rem; line-height: 1.8; }
.prose h2 { font-family: var(--font-sans); font-size: 1.5rem; margin: 2rem 0 0.75rem; }
.prose h3 { font-family: var(--font-sans); font-size: 1.25rem; margin: 1.75rem 0 0.5rem; }
.prose p { margin-bottom: 0.15rem; }
.prose p:empty, .prose p:has(> br:only-child) { margin-bottom: 0.75rem; }
.prose ul, .prose ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.prose blockquote { border-left: 3px solid var(--color-primary); padding-left: 1rem; margin: 1.5rem 0; font-style: italic; color: var(--color-text-muted); }
.prose img { border-radius: var(--radius); margin: 1.5rem 0; }
.prose pre { background: #1e1e1e; color: #d4d4d4; padding: 1rem; border-radius: var(--radius); overflow-x: auto; font-size: 0.9rem; margin: 1.5rem 0; }
.prose code { background: var(--color-bg); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.9em; }
.prose pre code { background: none; padding: 0; }
.prose a { color: var(--color-primary); text-decoration: underline; }

/* === Photo Essay === */
.photo-essay-hero { position: relative; height: 70vh; min-height: 400px; overflow: hidden; margin: -2rem -1.5rem 2rem; }
.photo-essay-hero img { width: 100%; height: 100%; object-fit: cover; }
.photo-essay-hero-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 3rem 2rem 2rem; background: linear-gradient(transparent, rgba(0,0,0,0.7)); color: white; }
.photo-essay-hero-overlay .post-title { color: white; }
.photo-essay-hero-overlay .post-date { color: rgba(255,255,255,0.8); }
.photo-essay-strip { display: flex; flex-direction: column; gap: 2rem; margin-top: 3rem; }
.photo-essay-figure img { border-radius: var(--radius); }
.photo-essay-figure figcaption { text-align: center; color: var(--color-text-muted); font-size: 0.9rem; margin-top: 0.5rem; font-style: italic; }

/* === Gallery === */
.gallery-intro { margin-bottom: 2rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.gallery-item img { border-radius: var(--radius); width: 100%; height: 250px; object-fit: cover; cursor: pointer; transition: transform 0.2s; }
.gallery-item img:hover { transform: scale(1.02); }
.gallery-item figcaption { text-align: center; color: var(--color-text-muted); font-size: 0.85rem; margin-top: 0.4rem; }

/* === Pagination === */
.pagination { display: flex; justify-content: center; gap: 1rem; margin-top: 3rem; }

/* === Buttons === */
.btn { display: inline-block; padding: 0.5rem 1rem; border-radius: var(--radius); border: 1px solid transparent; font-size: 0.9rem; cursor: pointer; text-align: center; transition: all 0.15s; font-family: var(--font-sans); background: var(--color-surface); }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-outline { border-color: var(--color-border); color: var(--color-text); }
.btn-outline:hover { border-color: var(--color-text-muted); }
.btn-danger { background: var(--color-danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* === Flash Messages === */
.flash { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.flash-error { background: #fef2f2; color: var(--color-danger); border: 1px solid #fecaca; }
.flash-success { background: #f0fdf4; color: var(--color-success); border: 1px solid #bbf7d0; }

/* === Badge === */
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 1rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-published { background: #d1fae5; color: #065f46; }

/* === Empty State === */
.empty-state { text-align: center; color: var(--color-text-muted); padding: 3rem 1rem; }

/* === Login === */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--color-bg); }
.login-card { background: var(--color-surface); padding: 2.5rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 380px; text-align: center; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.login-subtitle { color: var(--color-text-muted); margin-bottom: 1.5rem; font-size: 0.9rem; }

/* === Forms === */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--color-text); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--color-border);
    border-radius: var(--radius); font-size: 0.9rem; font-family: var(--font-sans);
    background: var(--color-surface); transition: border-color 0.15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(42,127,127,0.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group-wide { grid-column: 1; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* === Admin Layout === */
.admin-body { background: #f3f4f6; }
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }

.admin-sidebar { background: #1e293b; color: white; padding: 1.5rem 0; }
.sidebar-brand { padding: 0 1.25rem 1.5rem; }
.sidebar-brand a { color: white; font-weight: 700; font-size: 1.1rem; }
.sidebar-brand a:hover { text-decoration: none; }
.sidebar-nav { display: flex; flex-direction: column; }
.sidebar-link { display: block; padding: 0.6rem 1.25rem; color: #94a3b8; font-size: 0.9rem; transition: all 0.15s; border: none; background: none; text-align: left; width: 100%; cursor: pointer; font-family: var(--font-sans); }
.sidebar-link:hover { background: #334155; color: white; text-decoration: none; }
.sidebar-nav hr { border: none; border-top: 1px solid #334155; margin: 0.5rem 0; }
.logout-btn { color: #94a3b8; }

.admin-main { overflow-y: auto; }
.admin-header { padding: 1.5rem 2rem 0; }
.admin-header h1 { font-size: 1.5rem; }
.admin-content { padding: 1.5rem 2rem; }

/* === Admin Toolbar === */
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }

/* === Admin Table === */
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--color-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th, .admin-table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
.admin-table th { font-weight: 600; color: var(--color-text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.admin-table .actions { display: flex; gap: 0.4rem; }

/* === Dashboard === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--color-surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); text-align: center; }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--color-primary); }
.stat-label { color: var(--color-text-muted); font-size: 0.85rem; margin-top: 0.25rem; }
.dashboard-actions { display: flex; gap: 0.75rem; margin-top: 2rem; }

/* === Views Chart === */
.chart-section { background: var(--color-surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.chart-header h2 { font-size: 1.1rem; font-weight: 600; margin: 0; }
.chart-timeframe { display: flex; gap: 0.25rem; }
.chart-timeframe .btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; border: 1px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius); cursor: pointer; color: var(--color-text-muted); font-family: var(--font-sans); transition: all 0.15s; }
.chart-timeframe .btn-sm:hover { border-color: var(--color-primary); color: var(--color-primary); }
.chart-timeframe .btn-sm.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.chart-container { height: 300px; }

/* === Dashboard Panels === */
.dashboard-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1.5rem; }
.dashboard-panel { background: var(--color-surface); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.dashboard-panel-wide { margin-top: 1.5rem; }
.panel-heading { font-size: 1rem; font-weight: 600; margin: 0 0 1rem; }
.panel-empty { color: var(--color-text-muted); font-size: 0.85rem; font-style: italic; }
.panel-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.panel-table th { text-align: left; color: var(--color-text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--color-border); }
.panel-table td { padding: 0.5rem; border-bottom: 1px solid var(--color-border); }
.panel-table td:last-child, .panel-table th:last-child { text-align: right; }
.panel-table a { color: var(--color-text); }
.panel-table a:hover { color: var(--color-primary); }
.recent-comments-list { display: flex; flex-direction: column; gap: 0.75rem; }
.recent-comment { padding: 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius); }
.recent-comment-header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.85rem; margin-bottom: 0.35rem; }
.recent-comment-meta { color: var(--color-text-muted); }
.recent-comment-meta a { color: var(--color-primary); }
.recent-comment-header .btn { margin-left: auto; }
.recent-comment-body { font-size: 0.85rem; color: var(--color-text-muted); margin: 0; line-height: 1.5; }
.btn-danger { background: var(--color-danger); color: white; border: none; border-radius: var(--radius); cursor: pointer; font-size: 0.75rem; padding: 0.2rem 0.5rem; }
.btn-danger:hover { opacity: 0.85; }
@media (max-width: 768px) { .dashboard-panels { grid-template-columns: 1fr; } }

/* === Media === */
.upload-form { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.upload-form input[type="file"] { font-size: 0.85rem; }
.upload-form input[type="text"] { width: 200px; padding: 0.4rem 0.6rem; border: 1px solid var(--color-border); border-radius: var(--radius); font-size: 0.85rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.media-card { background: var(--color-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.media-thumb img { width: 100%; height: 150px; object-fit: cover; }
.media-info { padding: 0.75rem; }
.media-name { font-size: 0.8rem; color: var(--color-text-muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 0.5rem; }
.media-actions { display: flex; gap: 0.4rem; }

/* === Post Form === */
.post-form #editor { height: 400px; background: white; border-radius: 0 0 var(--radius) var(--radius); }
.post-form .ql-toolbar { border-radius: var(--radius) var(--radius) 0 0; }
.post-media-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0; }
.post-media-item .thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
.post-media-item .position-input { width: 60px; }

/* === Media Picker Modal === */
.media-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
}
.media-modal {
    background: var(--color-surface); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); width: 90%; max-width: 720px;
    max-height: 80vh; display: flex; flex-direction: column;
}
.media-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--color-border);
}
.media-modal-header h2 { font-size: 1.1rem; }
.media-modal-close {
    background: none; border: none; font-size: 1.5rem; cursor: pointer;
    color: var(--color-text-muted); line-height: 1;
}
.media-modal-close:hover { color: var(--color-text); }
.media-modal-body {
    padding: 1.25rem; overflow-y: auto; flex: 1;
}
.media-modal-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem;
}
.media-picker-card {
    border-radius: var(--radius); overflow: hidden; cursor: pointer;
    border: 2px solid transparent; transition: border-color 0.15s, transform 0.15s;
}
.media-picker-card:hover {
    border-color: var(--color-primary); transform: scale(1.03);
}
.media-picker-card img {
    width: 100%; height: 120px; object-fit: cover; display: block;
}

/* === Reading Time === */
.reading-time { color: var(--color-text-muted); font-size: 0.8rem; }
.post-meta-line { display: flex; align-items: center; gap: 0.75rem; }
.post-meta-line .reading-time { font-size: 0.9rem; }

/* === Back to Posts === */
.back-to-posts { display: inline-block; color: var(--color-text-muted); font-size: 0.85rem; margin-bottom: 1rem; }
.back-to-posts:hover { color: var(--color-primary); text-decoration: none; }

/* === Scroll to Top === */
.scroll-to-top {
    position: fixed; bottom: 2rem; right: 2rem; width: 40px; height: 40px;
    border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-surface);
    box-shadow: var(--shadow); cursor: pointer; font-size: 1.1rem; color: var(--color-text-muted);
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
    display: flex; align-items: center; justify-content: center; z-index: 100;
}
.scroll-to-top.visible { opacity: 1; visibility: visible; }
.scroll-to-top:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* === Active Sidebar Link === */
.sidebar-link.active { background: #334155; color: white; border-left: 3px solid var(--color-primary); padding-left: calc(1.25rem - 3px); }

/* === Flash Auto-Dismiss === */
.flash { transition: opacity 0.5s, transform 0.5s; }
.flash.flash-dismiss { opacity: 0; transform: translateY(-10px); }

/* === Word Count === */
.word-count { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.4rem; text-align: right; }

/* === Posts Search === */
.posts-search { padding: 0.4rem 0.75rem; border: 1px solid var(--color-border); border-radius: var(--radius); font-size: 0.85rem; width: 220px; font-family: var(--font-sans); }
.posts-search:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(42,127,127,0.15); }

/* === Sidebar Toggle (hamburger) === */
.sidebar-toggle { display: none; }

/* === Sidebar Backdrop === */
.sidebar-backdrop {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 999;
}

/* === Page Listing (sidebar + content grid) === */
.page-listing { display: grid; grid-template-columns: 230px 1fr; gap: 2rem; }
.listing-content { min-width: 0; }

/* === Public Sidebar === */
.sidebar { position: sticky; top: 2rem; align-self: start; }
.sidebar-search { margin-bottom: 1.5rem; }
.sidebar-search-input {
    width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--color-border);
    border-radius: var(--radius); font-size: 0.9rem; font-family: var(--font-sans);
    background: var(--color-surface); transition: border-color 0.15s;
}
.sidebar-search-input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(42,127,127,0.15); }
.sidebar-heading { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: 0.75rem; }
.sidebar-tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sidebar-tag {
    display: inline-flex; align-items: center; gap: 0.3rem;
    background: var(--color-bg); border: 1px solid var(--color-border);
    padding: 0.2rem 0.6rem; border-radius: 1rem; font-size: 0.8rem;
    color: var(--color-text-muted); transition: all 0.15s;
}
.sidebar-tag:hover { text-decoration: none; border-color: var(--color-primary); color: var(--color-primary); }
.sidebar-tag-active { background: var(--color-primary); border-color: var(--color-primary); color: white; }
.sidebar-tag-active:hover { color: white; }
.sidebar-tag-count { font-size: 0.7rem; opacity: 0.7; }

/* === Grain Texture Overlay === */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* === Scroll Animations === */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll { opacity: 1; transform: none; transition: none; }
}

/* === Responsive === */
@media (max-width: 768px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; width: 220px; z-index: 1000;
        transform: translateX(-100%); transition: transform 0.25s ease;
    }
    .admin-sidebar.sidebar-open { transform: translateX(0); }
    .admin-header { display: flex; align-items: center; gap: 0.75rem; }
    .sidebar-toggle {
        display: flex; flex-direction: column; justify-content: center; gap: 5px;
        background: none; border: none; cursor: pointer; padding: 4px;
    }
    .sidebar-toggle span {
        display: block; width: 22px; height: 2px; background: var(--color-text); border-radius: 1px;
    }
    .page-listing { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .form-row { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .post-title { font-size: 1.75rem; }
    .photo-essay-hero { height: 50vh; min-height: 300px; }
}
