/* =========================================================
   linguistics-archive.css (v1.0)
   Archive & Index Templates (archive.php, index.php)
   
   Contains:
   - Archive viewer layout (fixed sidebar + stream)
   - Compact card grid
   - Pothi fixed wrapper (for index.php)
   - Micro card grid (blog list)
   - Pagination styles
   ========================================================= */

/* =========================================================
   1. ARCHIVE VIEWER (Main Layout)
   ========================================================= */
.archive-viewer { 
    position: absolute; 
    top: 70px; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    display: flex; 
    background: #fff; 
}

/* =========================================================
   2. ARCHIVE SIDEBAR (Left Category List)
   ========================================================= */
.archive-sidebar { 
    width: 260px; 
    background: var(--bg-tan); 
    border-right: 1px solid var(--rule); 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0; 
}

.archive-sidebar h3 {
    color: var(--ink);
}

.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 */
.compact-title-list { 
    list-style: none; 
    margin: 0; 
    padding: 0; 
    overflow-y: auto; 
    flex: 1; 
}

.compact-title-list h3 {
    margin: 12px 15px 6px;
    font-size: 0.95rem;
    color: var(--wood-dark);
}

.compact-title-list ul {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}

.compact-title-list .sidebar-group {
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.compact-title-list details {
    margin: 0;
}

.compact-title-list details > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0px 15px;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.compact-title-list details > summary::-webkit-details-marker {
    display: none;
}

.compact-title-list details > summary::after {
    content: "+";
    font-size: 0.75rem;
    color: var(--ink-light);
    transition: transform 0.2s;
}

.compact-title-list .sidebar-summary {
    padding: 0 20px 0 0px;
   margin-left: -2px;
}

.compact-title-list details.cat-accordion > summary::after {
    content: none;
}

.compact-title-list details.cat-accordion[open] > summary::after {
    content: none;
}

.compact-title-list details[open] > summary::after {
    content: "−";
}

.compact-title-list details > summary:hover {
    background: #fff;
    border-left-color: var(--accent);
    color: var(--accent-hover);
}

.compact-title-list details > summary a {
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.compact-title-list details > summary a.active {
    color: var(--accent-hover);
    font-weight: 600;
}

.compact-title-list ul ul {
    margin: 4px 0 8px;
    padding-left: 14px;
}

.compact-title-list ul ul li a {
    font-size: 0.85rem;
}

.compact-title-list li { 
    border-bottom: 1px solid rgba(0,0,0,0.03); 
}

.compact-title-list li:last-child {
    border-bottom: 0;
}

.compact-title-list li a {
    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 li a:hover,
.compact-title-list li.active a {
    background: #fff;
    border-left-color: var(--accent);
    color: var(--accent-hover);
}

.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); 
}

/* =========================================================
   3. ARCHIVE STREAM (Right Content Area)
   ========================================================= */
.archive-stream { 
    flex: 1; 
    overflow-y: auto; 
    padding: 20px; 
    background: #f4f2ef; 
}

/* Stream Header */
.stream-header-area {
    margin-bottom: 2rem; 
    padding-bottom: 1rem; 
    border-bottom: 2px solid var(--accent);
}

.stream-header-area .page-title {
    margin: 0; 
    font-size: 1.8rem;
}

.stream-header-area .page-meta {
    margin-top: 0.5rem; 
    font-size: 0.9rem; 
    color: var(--ink-light);
}

.count-badge {
    display: inline-block; 
    margin-left: 10px; 
    background: var(--accent); 
    color: #fff; 
    padding: 2px 8px; 
    border-radius: 10px; 
    font-size: 0.8rem;
}

/* =========================================================
   4. STREAM GRID (Card Layout)
   ========================================================= */
.stream-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 15px; 
}

/* Compact Card */
.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); 
}

.compact-card .card-title { 
    font-family: var(--serif); 
    font-size: 1.1rem; 
    font-weight: 700; 
    margin: 0 0 10px 0; 
}

.compact-card .card-title a { 
    color: var(--ink); 
    text-decoration: none; 
}

.compact-card .card-meta { 
    font-size: 0.75rem; 
    color: var(--ink-light); 
    display: flex; 
    gap: 8px; 
}

.card-link-overlay { 
    position: absolute; 
    inset: 0; 
    z-index: 1; 
}

/* =========================================================
   5. PAGINATION
   ========================================================= */
.pagination-wrapper {
    margin-top: 2.5rem; 
    text-align: center; 
    padding-bottom: 1.5rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255,255,255,0.9);
    border: 1px solid var(--rule);
    border-radius: 999px;
    color: var(--ink);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--accent-river);
    color: #fff;
    border-color: var(--accent-river);
}

/* =========================================================
   6. INDEX PAGE (Blog List with Pothi Layout)
   ========================================================= */
.pothi-fixed-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.pothi-fixed-wrapper .pothi-header {
    padding: 2rem 0 1.5rem; 
    border-bottom: 2px solid var(--rule);
}

.pothi-fixed-wrapper .page-title {
    margin: 0;
    font-size: 1.6rem;
}

/* Fixed Grid (Two-Column Split) */
.fixed-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Scroll Panes */
.scroll-pane {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 1rem;
}

.scroll-pane::-webkit-scrollbar {
    width: 6px;
}

.scroll-pane::-webkit-scrollbar-track {
    background: var(--bg-tan);
}

.scroll-pane::-webkit-scrollbar-thumb {
    background: var(--accent-river);
    border-radius: 3px;
}

/* =========================================================
   7. MICRO CARD GRID (Minimal Blog Cards)
   ========================================================= */
.micro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.micro-card {
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 12px;
    position: relative;
    transition: all 0.2s ease;
    min-height: 100px;
}

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

.micro-meta {
    font-size: 0.7rem;
    color: var(--ink-light);
    margin-bottom: 6px;
}

.micro-title {
    font-family: var(--serif);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.micro-title a {
    color: var(--ink);
    text-decoration: none;
}

/* =========================================================
   8. COMMENTARY SIDEBAR (for index.php)
   ========================================================= */
.commentary { 
    border-left: 1px solid var(--rule); 
    padding-left: 2rem; 
    font-size: .95rem; 
}

.comment-block { 
    margin-bottom: 2rem; 
}

.comment-title { 
    font-family: var(--serif); 
    font-size: 1.05rem; 
    margin: 0 0 .4rem 0; 
    color: var(--accent-river); 
}

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

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

/* =========================================================
   9. RESPONSIVE - MOBILE
   ========================================================= */
@media (max-width: 800px) {
    /* Archive Layout */
    .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; 
    }
    
    /* Index Layout */
    .fixed-grid {
        display: flex;
        flex-direction: column;
    }
    
    .scroll-pane {
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
    }
    
    .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;
        border-left: none;
    }
}