/*
Theme Name: Sidebar Posts Theme
Description: Native-app dual-pane theme with blazing fast CSS masonry and dynamic branding.
Author: You
Version: 27.2
*/

:root {
    --bg-color: #0A1720;
    --text-color: #ffffff;
    --accent-red: #FF3333; 
    --accent-teal: rgba(17, 94, 89, 0.75); 
}

/* Bulletproof root against rounding gap bleeds */
html {
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 17px; /* slightly bigger than browser default 16px, normal weight */
    font-weight: 400;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

*, *::before, *::after {
    box-sizing: border-box;
}

img {
    border: none;
}

/* Links & Typography */
a { color: var(--accent-red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { color: var(--text-color); text-transform: capitalize; }

.container-narrow { max-width: 800px; margin: 0 auto; padding: 10px 20px 20px; }

/* Centered Title (Matches Brand Styling exactly) */
.centered-title { 
    text-align: center; 
    margin-top: 0; 
    margin-bottom: 15px; 
    font-size: 0.9rem; /* Matches mobile brand */
    font-weight: bold;
}
.centered-title::after { 
    content: ""; 
    display: block; 
    width: 40px; 
    height: 3px; 
    background-color: var(--accent-red); 
    margin: 10px auto 0; 
}

/* ==================================== */
/* Unified Footer Escape Hatch          */
/* ==================================== */
.site-footer {
    padding: 15px 10px;
    text-align: center;
    margin-top: 0;
}
.footer-home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1rem; 
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
}
.footer-home-link img { height: 20px; width: auto; border-radius: 4px; }
.footer-home-link:hover { color: var(--accent-red); text-decoration: none; }

/* ==================================== */
/* Global Layout Base (Mobile First)    */
/* ==================================== */
body.single { overflow: hidden; height: 100vh; }

.split-layout { 
    display: flex; 
    align-items: flex-start; 
    height: 100vh; 
    max-width: 1800px; 
    margin: 0 auto; 
    width: 100%; 
    overflow: hidden;
    position: relative;
}

body.admin-bar .split-layout { height: calc(100vh - 32px); }

/* Mobile Sidebar: Powered by Customizer % Variable */
.left-sidebar {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    width: var(--sidebar-width-mobile, 70%); 
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    background: var(--bg-color);
    border: none !important;
    border-right: 1px solid #1a364d !important;
    outline: none !important;
    margin: 0 !important;
}

.left-sidebar.is-open {
    transform: translateX(0);
    box-shadow: 12px 0 30px rgba(0, 0, 0, 0.65);
}

.right-content { 
    width: 100%; 
    flex-grow: 1; 
    height: 100%; 
    overflow-y: auto; 
    padding: 0; 
}

#post-content-area { min-height: 100%; display: flex; flex-direction: column; justify-content: space-between; }

.sidebar-scroll-area::-webkit-scrollbar, .right-content::-webkit-scrollbar { width: 14px; }
.sidebar-scroll-area::-webkit-scrollbar-track, .right-content::-webkit-scrollbar-track { background: #0d1e2b; border-radius: 7px; }
.sidebar-scroll-area::-webkit-scrollbar-thumb, .right-content::-webkit-scrollbar-thumb {
    background: #1a364d;
    border-radius: 7px;
    border: 3px solid #0d1e2b;
    min-height: 40px;
}
.sidebar-scroll-area::-webkit-scrollbar-thumb:hover, .right-content::-webkit-scrollbar-thumb:hover {
    background: #244a68;
}
/* Firefox scrollbar styling */
.sidebar-scroll-area, .right-content {
    scrollbar-width: auto;
    scrollbar-color: #1a364d #0d1e2b;
}

/* ==================================== */
/* Single Row Header (Aggressively Thin) */
/* Header height + padding driven by customizer CSS variables. */
/* NOTE: overflow is visible (NOT hidden) so the SEO info dropdown
   (positioned absolute; top: 100%) can render below the header. */
/* ==================================== */
.sidebar-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: var(--sidebar-header-padding-mobile, 2px) 8px !important;
    height: var(--sidebar-header-height-mobile, 32px) !important;
    background: var(--bg-color);
    border-bottom: 1px solid #1a364d;
    flex-shrink: 0;
    position: relative;
    z-index: 30;
    min-height: 0 !important;
    line-height: 1 !important;
    overflow: visible !important; /* must be visible so the SEO dropdown can render below */
}

/* UI Toggles — reduce padding so the header stays thin */
.menu-toggle, .info-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px !important;       /* was 4px */
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    line-height: 1;
}
.menu-toggle { margin-left: -2px; }
.info-toggle { margin-right: -2px; }

/* Hamburger Icon — tighter bars to fit a thinner header */
.hamburger { display: block; width: 16px; height: 2px; background-color: var(--text-color); position: relative; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; left: 0; width: 100%; height: 2px; background-color: var(--text-color); }
.hamburger::before { top: -5px; }
.hamburger::after { top: 5px; }

/* Center Branding Cluster — line-height 1 + reduced font size for thin header */
.site-branding { line-height: 1 !important; }
.site-branding .site-title { margin: 0 !important; line-height: 1 !important; }
.site-branding .site-title a {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-color);
    text-decoration: none;
    outline: none;
    font-size: 0.85rem; 
    font-weight: bold;
    margin: 0;
    line-height: 1 !important;
}
.header-site-icon { max-height: 16px; width: auto; border-radius: 4px; }

/* ==================================== */
/* SEO Info Dropdown Overlay            */
/* ==================================== */
.seo-info-dropdown {
    display: none;
    position: absolute;
    top: 100%; 
    left: 0;
    width: 100%;
    background: #0d1e2b;
    padding: 20px;
    border-bottom: 1px solid #1a364d;
    z-index: 9999; /* above everything inside the sidebar */
    box-shadow: 0 10px 25px rgba(0,0,0,0.7);
}
.seo-info-dropdown.is-open { display: block; }
.seo-info-dropdown h2 { margin: 0 0 10px 0; font-size: 1.1rem; color: var(--accent-red); font-weight: bold; }
.seo-info-dropdown p { margin: 0; font-size: 0.9rem; line-height: 1.4; color: #a0aec0; }

.main-navigation { 
    display: none; 
    background: #0d1e2b; 
    padding: 15px 10px; 
    border-bottom: 1px solid #1a364d; 
    flex-shrink: 0; 
    z-index: 20;
}
.main-navigation.is-open { display: block; }
.main-navigation ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.main-navigation a { color: var(--text-color); font-weight: bold; text-decoration: none; font-size: 0.9rem; }
.main-navigation a:hover { color: var(--accent-red); }

/* ==================================== */
/* Scene Directory (Homepage)           */
/* ==================================== */
.scene-directory-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.scene-directory-header {
    text-align: center;
    margin-bottom: 30px;
}

/* Homepage Hero — customizable H1 + sub-paragraph (SEO) */
.scene-hero-h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 12px 0;
    line-height: 1.2;
    text-transform: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
/* Site icon inline within the hero H1 (inserted at the chosen word position) */
.scene-hero-h1 .hero-site-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}
.scene-hero-h1 .hero-word {
    display: inline-block;
}
/* Red divider line directly under the H1 */
.scene-hero-divider {
    width: 80px;
    height: 3px;
    background: var(--accent-red);
    border-radius: 2px;
    margin: 0 auto 16px;
}
.scene-hero-sub {
    font-size: 1rem;
    font-weight: 400;
    color: #a0aec0;
    margin: 0 0 24px 0;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.scene-count {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    border-bottom: 2px solid var(--accent-red);
    padding-bottom: 10px;
    margin: 0;
}

/* Leading site-icon before each post title in the homepage post list */
.scene-title-list .scene-list-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Leading site-icon before each post's centered title (single-post view) */
.centered-title .post-title-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
    display: inline-block;
}

.scene-list {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.scene-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    transition: background 0.2s;
    color: var(--text-color);
}
.scene-item a:hover { background: rgba(255, 255, 255, 0.06); }

.scene-title-list {
    font-weight: bold;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
}

.scene-meta-group {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.75rem;
    color: #a0aec0;
}

.scene-preview-box {
    position: fixed;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    background: #000;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 50;
}
.scene-preview-box.active { opacity: 1; }
.scene-preview-box img { width: 100%; height: auto; display: block; border-radius: 7px; }


/* ==================================== */
/* Native CSS Masonry Sidebar Grid      */
/* ==================================== */
.sidebar-scroll-area { flex-grow: 1; overflow-y: auto; padding: 10px; }

.sidebar-grid { 
    column-count: var(--sidebar-cols-mobile, 1);
    column-gap: 10px;
}

/* ===== Card shell ===== */
.sidebar-card { 
    border-radius: 14px; 
    background: transparent; 
    break-inside: avoid;
    margin-bottom: 10px;
    display: inline-block; 
    width: 100%;
    position: relative; 
}

/* ===== Card link wrapper =====
   Clean, no hover darkening / no zoom / no title overlay.
   The post title shows via the browser's native tooltip (the <a>
   element already has title="..." set in PHP). */
.sidebar-card a { 
    display: block; 
    overflow: hidden; 
    border-radius: 14px; 
    position: relative; 
    background: #0d1e2b; 
    outline: none;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

/* Hover: subtle shadow growth only — NO lift, NO image zoom, NO darkening (per user spec) */
.sidebar-card a:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 51, 51, 0.2);
}

/* Active Post — subtle ring */
.sidebar-card.active-post a {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 1px var(--accent-red), 0 6px 18px rgba(255, 51, 51, 0.25);
}
.sidebar-card.active-post a:hover {
    box-shadow: 0 0 0 1px var(--accent-red), 0 8px 22px rgba(255, 51, 51, 0.35);
}

/* "CURRENT" badge — top-right pill */
.sidebar-card.active-post::before {
    content: 'CURRENT';
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent-red);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 3px 9px;
    z-index: 10;
    border-radius: 999px;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ===== Image area — clean, no zoom, no filter ===== */
.card-image-wrap { 
    width: 100%; 
    background: #000; 
    overflow: hidden;
}
.sidebar-card img {
    width: 100%;
    height: auto;
    object-fit: cover; 
    display: block;
    /* No transition, no filter, no transform — image stays exactly as-is on hover */
}

/* The title overlay span is hidden on all viewports — the native browser tooltip
   (via the <a title="..."> attribute) is the only title presentation. */
.sidebar-card-title { display: none !important; }

/* Legacy card-header / card-footer / cat-pill rules removed */
.card-header, .card-title, .card-footer, .cat-pill, .cat-color-0, .cat-color-1, .card-date { display: none !important; }

/* ==================================== */
/* Load More Button                     */
/* ==================================== */
.load-more-container { 
    column-span: all; 
    text-align: center; 
    margin-top: 15px; 
    padding-bottom: 20px;
}
.load-more-btn {
    background: var(--accent-red);
    color: var(--text-color);
    border: none;
    padding: 10px 28px; 
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    max-width: 250px;
    margin: 0 auto;
    display: block;
    box-shadow: 0 4px 14px rgba(255, 51, 51, 0.3);
}
.load-more-btn:hover { 
    background: #cc0000; 
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 51, 51, 0.45);
}

/* ==================================== */
/* Mobile Chevron Toggle                */
/* ==================================== */
.sidebar-slide-toggle {
    display: flex;
    position: absolute;
    right: -24px; 
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 40px; 
    background: rgba(10, 23, 32, 0.85); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    border-left: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
    box-shadow: 3px 0 8px rgba(0,0,0,0.3);
    z-index: 1001;
    padding-right: 2px; 
    outline: none;
}

.chevron {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(-45deg); 
    transition: transform 0.3s ease;
}
.left-sidebar.is-open .chevron { transform: rotate(135deg); }


/* ==================================== */
/* Desktop Adjustments (>=1024px)       */
/* ==================================== */
@media (min-width: 1024px) {
    
    .sidebar-slide-toggle { display: none; }
    
    /* Variables driven by customizer */
    .left-sidebar { 
        position: relative !important;
        width: var(--sidebar-width-desktop, 40%) !important;
        height: 100% !important;
        transform: none !important; 
        box-shadow: none !important;
        flex-shrink: 0 !important;
    } 
    
    .right-content { 
        width: calc(100% - var(--sidebar-width-desktop, 40%)) !important; 
    }
    
    .sidebar-header {
        padding: var(--sidebar-header-padding-desktop, 3px) 12px !important;
        height: var(--sidebar-header-height-desktop, 36px) !important;
    } /* height + padding driven by customizer */
    
    /* Center Branding matching desktop title */
    .site-branding .site-title a { font-size: 1rem; gap: 6px; }
    .header-site-icon { max-height: 20px; }
    
    .centered-title { font-size: 1.1rem; }
    
    .seo-info-dropdown { padding: 25px; }
    
    .main-navigation { padding: 15px 20px; }
    .main-navigation a { font-size: 1rem; }
    
    .sidebar-scroll-area { padding: 20px; }
    
    .sidebar-grid { 
        column-count: var(--sidebar-cols-desktop, 2);
        column-gap: 16px; 
    }
    
    /* Desktop cards: slightly larger radius + more breathing room between cards */
    .sidebar-card { border-radius: 16px; margin-bottom: 16px; }
    .sidebar-card a { border-radius: 16px; }
}

/* ==================================== */
/* Mobile View Overrides                */
/* ==================================== */
@media (max-width: 1023px) {
    .container-narrow { padding: 10px 15px 20px; }
    
    /* Prevent image hover popup on mobile */
    .scene-preview-box { display: none !important; }
    
    .scene-item a { flex-direction: column; align-items: flex-start; gap: 6px; }
    .scene-meta-group { width: 100%; justify-content: space-between; }
}