/* =========================================================
   river-theme.css (v9.5 - Optimized)
   - Removed @import (Fonts are loaded via functions.php for speed)
   - Retains all v9.4 layout and style fixes
   ========================================================= */

/* REMOVED: @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP...'); */

:root {
    --bg: #faf8f4;
    --ink: #3b362f;
    --ink-soft: #5a4943;
    --ink-light: #6d655a;
    --rule: #dcd1c3;
    --accent-river: #c9642d;
    --accent: #e07a00;
    --accent-hover: #3b2411;
    --serif: "Noto Serif JP", serif;
    --sans: "Noto Sans JP", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --bg-tan: #f0e9dd; 
}

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

/* =========================================================
   1. HEADER & NAV (header moved to unified-header)
   ========================================================= */
.site-title { order: 1; flex-grow: 1; text-align: left; margin-left: 0; min-width: 0; }
.site-title a {
    color: #3b2411; text-decoration: none; font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 1.8rem); 
    font-family: var(--serif);
    letter-spacing: 0.02em; display: block; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.header-controls { order: 2; display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.nav-toggle {
    order: 3; display: block; appearance: none; border: 0; background: none;
    color: #3b2411; font-size: 26px; line-height: 1; cursor: pointer;
    padding: 8px; transition: all 0.3s ease; flex-shrink: 0; 
}
.nav-toggle:hover { color: var(--accent); transform: rotate(90deg); }
.script-selector { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: rgba(255, 255, 255, 0.8); border: 1px solid var(--accent); border-radius: 20px; }
.script-selector label { font-size: 0.8rem; color: #5a4943; font-weight: 600; }
.script-btn { appearance: none; border: 0; background: transparent; color: #5a4943; font-size: 0.8rem; padding: 4px 10px; border-radius: 12px; cursor: pointer; transition: all 0.3s ease; font-family: var(--sans); }
.script-btn.active { background: var(--accent); color: #fff; font-weight: 600; }
.script-btn:hover:not(.active) { background: rgba(224, 122, 0, 0.1); }
.script-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.skip-to-content { position: absolute; top: -100px; left: 1rem; background: var(--accent); color: white; padding: 0.5rem 1rem; text-decoration: none; z-index: 9999; font-weight: 600; }
.skip-to-content:focus { top: 1rem; }
.nav-overlay { position: fixed; inset: 0; background: rgba(27, 20, 18, 0.97); color: #f4f0e8; display: none; z-index: 999; overflow-y: auto; padding: 80px 40px 40px; }
.nav-overlay.open { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.nav-panel { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 40px; }
.nav-close { position: fixed; top: 20px; right: 30px; appearance: none; border: 0; background: rgba(224, 122, 0, 0.9); color: #fff; font-size: 32px; line-height: 1; cursor: pointer; padding: 8px 16px; border-radius: 8px; transition: all 0.3s ease; }
.nav-close:hover { background: var(--accent); transform: scale(1.1); }
.nav-section h3 { color: var(--accent); font-weight: 700; font-size: 1.4rem; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); font-family: var(--serif); }
.nav-section ul { list-style: none; padding: 0; margin: 0.5rem 0 1rem; }
.nav-section a { display: block; padding: 10px 0; color: #f4f0e8; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.08); transition: all 0.3s ease; font-size: 1rem; }
.nav-section a:hover { color: var(--accent); padding-left: 12px; border-color: var(--accent); }

/* =========================================================
   2. BODY LAYOUTS
   ========================================================= */
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); }

body.single-post, body.single, body.archive {
    min-height: 100vh; display: flex; flex-direction: column;
    overflow-y: auto; overflow-x: hidden;
}
.single-post-wrapper { flex-grow: 1; margin-bottom: 0; }

body.home, body.blog {
    height: auto; overflow-x: hidden; overflow-y: auto; white-space: normal;
    display: flex; flex-direction: column; min-height: 100vh;
}

/* =========================================================
   SINGLE PAGE ENHANCEMENTS v2.0
   Merge into river-theme.css section 3
   ========================================================= */

/* ========== HEADER ========== */
.pothi-header {
    padding: 2rem 3rem 1.5rem;
    border-bottom: 2px solid var(--rule); 
    max-width: 95vw; 
    margin: 0 auto; 
    background: var(--bg);
}

.page-title {
    font-family: var(--serif); 
    font-size: 1.6rem;
    margin: 0 0 .8rem 0;
    letter-spacing: .05em; 
    color: var(--ink);
    line-height: 1.4;
}

.page-meta { 
    color: var(--ink-light); 
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-meta .meta-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--accent);
    color: #fff;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ========== GRID ========== */
.pothi-grid {
    display: grid !important; 
    grid-template-columns: 3fr 1fr !important; 
    gap: 2rem !important;
    max-width: 95vw; 
    margin: 2rem auto;
    padding: 0 3rem; 
    box-sizing: border-box; 
    background: var(--bg);
}

.main-text { 
    font-size: 1.05rem; 
    line-height: 1.8; 
    color: var(--ink); 
    grid-column: 1;
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Drop cap for first paragraph */
.main-text > p:first-of-type::first-letter {
    font-family: var(--serif);
    font-size: 3.2rem;
    line-height: 0.9;
    float: left;
    margin: 0.1rem 0.15rem 0 0;
    color: var(--accent-river);
    font-weight: 600;
}

/* ========== HEADINGS (SMALLER, NO ORANGE) ========== */
.main-text h2 { 
    font-family: var(--serif); 
    font-weight: 700; 
    font-size: 1.3rem; 
    margin: 2.5rem 0 1rem; 
    padding-left: 1rem;
    border-left: 4px solid var(--accent-river);
    color: var(--ink);
}

.main-text h3 { 
    font-family: var(--serif); 
    font-weight: 600; 
    font-size: 1.1rem; 
    margin: 2rem 0 0.8rem; 
    color: var(--ink);
    padding-left: 0.8rem;
    border-left: 3px solid rgba(201, 100, 45, 0.5);
}

.main-text h4 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 1rem;
    margin: 1.5rem 0 0.6rem;
    color: var(--ink);
}

.main-text h5,
.main-text h6 {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 0.95rem;
    margin: 1.2rem 0 0.5rem;
    color: var(--ink-soft);
}

.main-text p { 
    margin-bottom: 1.5rem; 
}

.main-text p + p {
    text-indent: 1.2em;
}

.main-text ul, .main-text ol { 
    margin-bottom: 1.8rem; 
    padding-left: 2rem;
    line-height: 1.9;
}

.main-text li {
    margin-bottom: 0.6rem;
}

.main-text li::marker {
    color: var(--accent-river);
    font-weight: 600;
}
.main-text a { color: var(--accent-river); text-decoration: none; border-bottom: none; }
.main-text a:hover { text-decoration: underline; }
.main-text blockquote { 
    margin: 2rem 0; 
    padding: 1.2rem 1.5rem; 
    border-left: 4px solid var(--accent-river); 
    background: linear-gradient(to right, rgba(240, 233, 221, 0.5), rgba(240, 233, 221, 0.1));
    border-radius: 0 4px 4px 0;
    color: var(--ink-soft); 
    font-style: italic;
    position: relative;
}

.main-text blockquote::before {
    content: """;
    position: absolute;
    top: -0.3rem;
    left: 0.8rem;
    font-size: 3rem;
    color: rgba(201, 100, 45, 0.2);
    font-family: Georgia, serif;
    line-height: 1;
}

/* ========== COMMENTARY SIDEBAR ========== */
.commentary { 
    background: rgba(240, 233, 221, 0.3);
    border: 1px solid rgba(220, 209, 195, 0.6);
    border-radius: 8px;
    padding: 1.5rem;
    font-size: .9rem; 
    grid-column: 2;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.commentary::-webkit-scrollbar { width: 6px; }
.commentary::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.3); border-radius: 3px; }
.commentary::-webkit-scrollbar-thumb { background: var(--accent-river); border-radius: 3px; }

.comment-block { 
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-left: 2px solid rgba(201, 100, 45, 0.4);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.comment-block:hover {
    background: rgba(255, 255, 255, 0.8);
    border-left-color: var(--accent-river);
}

.comment-block:last-child { margin-bottom: 0; }

.comment-title { 
    font-family: var(--serif); 
    font-size: 0.9rem;
    margin: 0 0 .6rem 0;
    color: var(--ink);
    font-weight: 700;
}

.commentary a { 
    color: var(--ink); 
    text-decoration: none; 
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.commentary a:hover { 
    color: var(--accent-river);
    border-bottom-color: var(--accent-river);
}

.commentary ul, .commentary ol { margin: 0.5rem 0; padding-left: 1.2rem; }
.commentary li { margin-bottom: 0.4rem; line-height: 1.6; }

/* ========== BOTTOM NAVIGATION ========== */
.bottom-category-nav { 
    max-width: 95vw; 
    margin: 3rem auto 0; 
    padding: 2rem 3rem 3rem; 
    text-align: left; 
    border-top: 1px solid var(--rule);
}

.bottom-category-nav a { 
    font-family: var(--serif); 
    font-size: 0.95rem;
    font-weight: 600; 
    color: var(--accent-river);
    text-decoration: none; 
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease; 
}

.bottom-category-nav a::before {
    content: "←";
    font-weight: 700;
}

.bottom-category-nav a:hover { 
    color: var(--accent);
    text-decoration: underline;
    transform: translateX(-3px);
}

/* ========== MOBILE ========== */
@media (max-width: 800px) { 
    .pothi-header { padding: 1.5rem 1rem; max-width: 100%; }
    .page-title { font-size: 1.4rem; }
    
    .main-text {
        padding: 1.5rem 1rem;
    }
    
    .main-text > p:first-of-type::first-letter {
        font-size: 2.5rem;
    }
    
    .main-text p + p {
        text-indent: 0.8em;
    }
    
    .pothi-grid { 
        grid-template-columns: 1fr !important; 
        padding: 1.5rem 1rem;
        gap: 1.5rem !important;
        margin: 1.5rem auto;
        max-width: 100%; 
    }
    .commentary { 
        position: static; 
        top: auto; 
        max-height: none; 
        overflow-y: visible; 
        border-left: none;
        border-top: 2px solid var(--accent-river);
        padding: 1.5rem 1rem;
        margin-top: 2rem; 
        grid-column: 1;
        border-radius: 0;
    }
    .comment-block { padding: 0.8rem; }
    .bottom-category-nav { padding: 2rem 1rem; text-align: left; }
    .bottom-category-nav a { 
        font-size: 0.9rem;
    }
}

/* =========================================================
   SINGLE PAGE ENHANCEMENTS (Visual Update)
   ========================================================= */

/* Hero Image in Header */
.single-hero-image {
    margin-top: 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
    background: #fff;
}

.single-hero-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.single-hero-image:hover img {
    transform: scale(1.02);
}

.hero-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: rgba(255,255,255,0.9);
    padding: 2rem 1.5rem 1rem;
    font-size: 0.85rem;
    text-align: right;
}

/* Polished Meta Data */
.page-meta {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    color: var(--ink-light);
    font-size: 0.9rem;
    font-family: var(--sans);
}

.page-meta .icon {
    opacity: 0.6;
    margin-right: 4px;
}

.page-meta .sep {
    color: var(--rule);
    font-weight: 300;
}

.page-meta a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px dotted var(--ink-light);
    transition: all 0.2s;
}

.page-meta a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.meta-badge {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(224, 122, 0, 0.08);
    color: var(--accent);
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(224, 122, 0, 0.15);
}

/* Enhancing the Main Text readability */
.main-text {
    /* Existing styles + slightly more breathing room */
    padding: 2.5rem; 
}

/* Add a subtle visual divider between header and grid if no image */
.pothi-header:not(:has(.single-hero-image)) {
    border-bottom: 2px solid var(--rule);
}
.pothi-header:has(.single-hero-image) {
    border-bottom: none; /* Image acts as the divider */
    padding-bottom: 1rem;
}

/* Mobile Adjustments for Hero */
@media (max-width: 800px) {
    .single-hero-image {
        margin-top: 1.5rem;
        border-radius: 8px;
    }
    .main-text {
        padding: 1.5rem;
    }
}

/* =========================================================
   4. HOME LAYOUT (River)
   ========================================================= */
.river {
    display: grid; grid-template-columns: 1fr; grid-auto-flow: row;
    width: auto; height: auto; overflow-x: hidden; overflow-y: visible;
    flex-grow: 1; gap: 2.5rem; padding: 2.5rem; 
    padding-top: 2rem; /* FIXED: Reduced from 90px to remove gap */
    box-sizing: border-box;
}

.fragment {
    display: flex; flex-direction: column; background: transparent;
    padding-right: 0; border-right: none;
    border-bottom: 1px solid rgba(220, 209, 195, 0.6);
    box-sizing: border-box; height: auto; white-space: normal; overflow-y: visible;
    position: relative; gap: 1rem; 
}
.fragment:last-child { border-bottom: none; }
.fragment-title, .widget-title {
    font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin: 0;
    color: var(--ink); letter-spacing: 0.02em;
    position: sticky; top: 0; z-index: 10; padding-bottom: 12px; padding-top: 5px; margin-bottom: 0;
    background: rgba(250, 248, 244, 0.85); backdrop-filter: blur(5px); border-bottom: 1px solid var(--rule);
}

.hero-block {
    padding: 1.5rem; background: rgba(255, 255, 255, 0.7); 
    border: 1px solid var(--rule); border-radius: 8px; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); border-bottom: 2px solid var(--rule);
    margin-bottom: 1rem;
}
.hero-title { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; margin: .5rem 0 .7rem; line-height: 1.4; }
.hero-title a { color: var(--ink); text-decoration: none; }
.hero-category { font-size: 0.8rem; color: var(--ink-light); font-weight: 500; }
.hero-excerpt { margin-top: .7rem; font-size: 0.95rem; line-height: 1.65; color: var(--ink-soft); }
.hero-read {
    display: inline-block; margin-top: 1rem; color: var(--accent-river);
    font-size: 0.85rem; font-weight: 600; text-decoration: none;
    border-bottom: 1px solid rgba(201,100,45,0.4); transition: all 0.3s ease;
}

.article {
    padding: 1.4rem; border: 1px solid var(--rule); background: #fff;
    border-radius: 8px; transition: all 0.2s ease;
}
.article:hover {
    background: #fffbf7; border-color: var(--accent-river);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06); transform: translateY(-2px);
}
.article-title { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; margin: 0 0 .4rem; line-height: 1.45; }
.article-title a { color: var(--ink); text-decoration: none; }
.article-meta { font-size: 0.8rem; color: var(--ink-light); margin-bottom: .4rem; font-weight: 500; }
.article-ex { font-size: 0.92rem; margin-top: .4rem; color: var(--ink-soft); line-height: 1.6; }

.portal-list { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.portal-list-item {
    display: flex; align-items: baseline; gap: 10px; padding: 12px 4px;
    border-bottom: 1px solid rgba(0,0,0,0.05); text-decoration: none; color: var(--ink); transition: background 0.2s ease;
}
.portal-list-item:hover { background: rgba(255,255,255,0.5); color: var(--accent-river); }
.portal-list-item .meta-date { font-family: var(--sans); font-size: 0.75rem; color: var(--ink-light); white-space: nowrap; min-width: 40px; }
.portal-list-item .meta-title { font-family: var(--sans); font-size: 0.95rem; font-weight: 500; line-height: 1.5; }

.cat-accordion { margin-bottom: 0.5rem; border-bottom: 1px dashed var(--rule); }
.cat-accordion:last-child { border-bottom: none; }
.cat-root-label { font-size: 0.9rem; color: var(--ink); font-weight: 700; padding: 10px 0; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.cat-root-label::-webkit-details-marker { display: none; }
.cat-root-label .root-link { text-decoration: none; color: inherit; flex-grow: 1; transition: color 0.2s ease; }
.cat-root-label .root-link:hover { color: var(--accent-river); }
.acc-icon::after { content: '+'; font-weight: 300; font-size: 1.2rem; color: var(--ink-light); }
details[open] .acc-icon::after { content: '−'; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 1.5rem; padding-top: 0.5rem; }
.chip { display: inline-block; padding: 6px 12px; background: #fff; border: 1px solid rgba(201, 100, 45, 0.15); border-radius: 20px; color: var(--ink-soft); font-size: 0.85rem; font-weight: 500; text-decoration: none; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Archive Styles */
.archive-viewer { position: absolute; top: 70px; left: 0; right: 0; bottom: 0; display: flex; background: #fff; }
.archive-sidebar { width: 260px; background: var(--bg-tan); border-right: 1px solid var(--rule); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { padding: 12px 15px; border-bottom: 1px solid rgba(0,0,0,0.1); background: rgba(255,255,255,0.5); display: flex; justify-content: space-between; align-items: center; }
.sidebar-label { font-family: var(--serif); font-size: 1rem; font-weight: 700; margin: 0; color: var(--ink); }
.compact-title-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.compact-title-list li { border-bottom: 1px solid rgba(0,0,0,0.03); }
.compact-title-list .sidebar-link { display: block; padding: 10px 15px; text-decoration: none; color: var(--ink); font-size: 0.9rem; border-left: 3px solid transparent; transition: all 0.2s; }
.compact-title-list .sidebar-link:hover { background: #fff; border-left-color: var(--accent); color: var(--accent-hover); }
.archive-stream { flex: 1; overflow-y: auto; padding: 20px; background: #f4f2ef; }
.stream-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
.compact-card { background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: 15px; position: relative; transition: transform 0.2s ease; display: flex; flex-direction: column; justify-content: space-between; min-height: 120px; }
.compact-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: var(--accent); }
.card-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 700; margin: 0 0 10px 0; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-meta { font-size: 0.75rem; color: var(--ink-light); display: flex; gap: 8px; }
.card-link-overlay { position: absolute; inset: 0; z-index: 1; }

.site-footer { margin-top: 0; clear: both; text-align: center; }
.site-footer .copyright { margin: 1rem auto 1rem; max-width: 90%; color: var(--text-dark); }

/* =========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================= */
@media (min-width: 800px) { 
    body.home, body.blog {
        height: 100vh; overflow-x: auto; overflow-y: hidden; white-space: nowrap; display: block; flex-direction: row;
    }
    .river {
        grid-auto-flow: column; grid-template-columns: unset;
        grid-auto-columns: calc(50vw - 3.75rem); 
        grid-template-rows: 100%;
        padding: 3rem 2rem 2rem; 
        padding-top: 3rem; /* FIXED: Reduced from 100px */
        gap: 2.5rem; 
        height: 100vh; overflow-x: auto; overflow-y: hidden; width: 100%; min-height: auto;
    }
    .fragment {
        height: calc(100vh - 90px - 5rem); overflow-y: auto; padding-right: 1.5rem; border-right: 1px solid rgba(220, 209, 195, 0.6); border-bottom: none;
    }
    .fragment:last-child { border-right: none; }
}
@media (min-width: 1200px) {
    .river { 
        grid-auto-columns: 1fr; grid-template-rows: 100%; padding: 2.5rem; 
        padding-top: 2.5rem; /* FIXED: Reduced from 90px */
        gap: 2.5rem; 
    }
}
@media (max-width: 800px) { 
    /* Mobile Single Post */
    .pothi-header { 
        padding: 2rem 1.5rem 1.5rem; /* CHANGED: Was 5rem top padding */
        max-width: 100%; padding-left: 1rem; padding-right: 1rem; 
    }
    .page-title { font-size: 1.5rem; font-weight: 700; }
    .pothi-grid { grid-template-columns: 1fr !important; padding: 2rem 1rem; max-width: 100%; }
    .commentary { position: static; top: auto; max-height: none; overflow-y: visible; padding-left: 0; box-shadow: none; border-top: 2px solid var(--rule); padding-top: 1.5rem; margin-top: 2rem; grid-column: 1; }
    .bottom-category-nav { padding: 1.5rem 1rem; margin-bottom: 1rem; text-align: left; }
    .bottom-category-nav a { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 0.8rem; margin-left: 0; background: var(--accent); color: #fff; }

    /* Archive Mobile Override */
    .archive-viewer { position: static; display: block; height: auto; }
    .archive-sidebar { width: 100%; height: auto; border-right: none; border-bottom: 1px solid var(--rule); }
    .compact-title-list { display: none; } 
    .sidebar-header { background: var(--bg-tan); }
    .archive-stream { padding: 15px; }
}
@media (max-width: 768px) {
    .site-header { flex-direction: row; flex-wrap: nowrap; padding: 12px 16px; gap: 8px; }
    .nav-toggle { display: block; order: 3; margin: 0; padding-left: 8px; }
    .site-title { order: 1; flex-grow: 1; padding-left: 0; }
    .header-controls { order: 2; width: auto; margin-top: 0; }
    .script-selector { display: none; }
}

/* ... existing styles ... */

/* =========================================================
   6. FRONT PAGE RESOURCE DASHBOARD (New Fragment 4)
   ========================================================= */
.resource-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stacked on narrow columns */
    gap: 12px;
}

.resource-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 8px;
    padding: 12px 15px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: var(--accent-river);
}

.res-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-tan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.res-info {
    display: flex;
    flex-direction: column;
}

.res-info h3 {
    margin: 0;
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}

.res-info span {
    font-size: 0.75rem;
    color: var(--ink-light);
    margin-top: 2px;
}

/* Tablet/Desktop adjustment for Resource Grid */
@media (min-width: 1200px) {
    /* On wide screens, maybe show them side-by-side if the column is wide enough */
    .resource-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}