/* www/blog/style.css */
/* Dark Mode Class (applied via JS) */
body.dark-mode {
    --bg-color: #0f172a;
    --text-color: #f1f5f9;
    --sidebar-bg: #1e293b;
    --card-bg: #1e293b;
    --border-color: #334155;
    --input-bg: #334155;
    --input-text: #f1f5f9;
    --header-bg: #2d2f34;
}

/* Namuwiki Dark Mode adjustments */
body.dark-mode {
    --primary-color: #00A495;
    --bg-color: #1f2023;
    --text-color: #ddd;
    --sidebar-bg: #2b2b2b;
    --card-bg: #2b2b2b;
    --border-color: #444;
}

/* Default Light Mode Variables (Namuwiki Theme) */
:root {
    --primary-color: #00A495;
    /* Namuwiki Green */
    --primary-hover: #008f82;
    --bg-color: #f0f0f0;
    /* Light gray background */
    --text-color: #373a3c;
    --sidebar-bg: #ffffff;
    /* Dark sidebar like Namu live/wiki tools often have, or keep light? Let's go dark for contrast */
    --card-bg: #ffffff;
    --border-color: #ccc;
    /* Distinct borders */
    --font-main: 'Open Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    /* Namu uses Open Sans often */
    --shadow-sm: 0 1px 1px rgba(0, 0, 0, 0.1);
    /* Flatter look */
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
    --input-bg: #ffffff;
    --input-text: #373a3c;
    --header-bg: #ffffff;
}

/* Auto Dark Mode (System Preference) - ONLY if no user preference override */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: #0f172a;
        --text-color: #f1f5f9;
        --sidebar-bg: #1e293b;
        --card-bg: #1e293b;
        --border-color: #334155;
        --input-bg: #334155;
        --input-text: #f1f5f9;
        color-scheme: dark;
        /* Helps with scrollbars etc */
    }
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    line-height: 1.6;
    font-size: 15px;
    /* Reduced from browser default (16px) */
    display: block;
    /* Prepare for custom layout container */
    min-height: 100vh;
}

/* 3-Column Layout Wrapper */
.layout-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-color);
}

/* Sidebar (Dark Theme Style) */
.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.25rem;
    /* Reduced from 1.5rem */
    position: sticky;
    /* Sticky instead of fixed for better layout flow */
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    transition: margin-left 0.3s ease;
    z-index: 50;
}

.sidebar.hidden {
    margin-left: -240px;
}

/* Adjust links in sidebar for dark background */
/* Adjust links in sidebar for dark background */
.sidebar a {
    color: var(--text-color);
}

.sidebar a:hover {
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.05);
    /* Subtle dark hover */
}

/* Dark mode override for hover */
body.dark-mode .sidebar a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Removed redundant .nav-link rule here, it is defined correctly below */

.logo {
    color: #fff;
    /* White logo on dark sidebar */
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: block;
    color: var(--primary-color);
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.1rem;
    /* Reduced from 0.5rem */
}

.nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    /* Reduced from 0.75rem 1rem */
    border-radius: 0.25rem;
    /* Slightly sharper */
    color: var(--text-color);
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1rem;
    /* Compact padding */
    max-width: 100%;
    /* No margin-left needed with flexbox flow */
    min-width: 0;
    /* Important for flex wrapping text */
}

/* Right Sidebar */
.right-sidebar {
    width: 300px;
    padding: 1rem;
    background: var(--bg-color);
    border-left: 1px solid var(--border-color);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-banner {
    margin-bottom: 1rem;
    overflow: hidden;
    /* rounded corners if desired */
    border-radius: 0.5rem;
}

.sidebar-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* Desktop Toggle Button */
.desktop-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    margin-bottom: 1rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.desktop-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.container {
    max-width: 900px;
    /* Restored/Standard width */
    margin: 0 auto;
}

/* Header (Mobile) */
.mobile-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--header-bg);
    /* Use header-bg for better semantic matching */
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 90;
    height: 60px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    /* Remove duplicate color line */
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

/* Posts */
.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0;
    /* Square corners usually */
    padding: 1rem;
    /* Very compact */
    margin-bottom: 0.5rem;
    /* Very tight spacing */
    box-shadow: none;
    /* Flatter */
}

.post-card:hover {
    transform: none;
    background: var(--bg-color);
    /* Slight darken on hover maybe? or just border change */
    border-color: var(--primary-color);
}

.post-meta {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    line-height: 1.4;
}

.post-excerpt {
    color: var(--text-color);
    opacity: 0.9;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Single Post */
.post-content {
    background: var(--card-bg);
    padding: 1.25rem;
    /* Compact reading area */
    border-radius: 0.5rem;
    /* Reduced radius */
    border: 1px solid var(--border-color);
}

.post-content h1 {
    font-size: 1.4rem;
    /* Reduced to match standard document title */
    margin-bottom: 0.5rem;
    /* Reduced from 0.75rem */
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.25rem;
    color: var(--text-color);
    line-height: 1.4;
}

.post-content h2 {
    font-size: 1.25rem;
    /* Standard sub-section size */
    margin-top: 1.2rem;
    /* Reduced from 1.5rem */
    margin-bottom: 0.3rem;
    /* Reduced from 0.5rem */
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.2rem;
    display: block;
    width: 100%;
    line-height: 1.4;
}

.post-content h3 {
    font-size: 1.1rem;
    margin-top: 1rem;
    /* Reduced from 1.25rem */
    margin-bottom: 0.25rem;
    /* Reduced from 0.5rem */
    font-weight: bold;
    line-height: 1.4;
}

/* Namuwiki-style links in content */
.post-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-content img {
    max-width: 100%;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

/* Footer */
.site-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: #64748b;
}

/* Responsive */
@media (max-width: 1280px) {
    .layout-container {
        flex-direction: column;
    }

    .main-content {
        padding: 1rem;
        padding-top: 1rem;
        /* Added padding top for content gap */
        margin-top: 0;
        /* Sticky header is 60px, ensure content is safe */
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 100;
        height: 100%;
        margin-left: 0;
        /* Reset desktop negative margin logic */
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .right-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        height: auto;
        position: static;
        order: 3;
        /* Ensure it's at the bottom */
        padding: 2rem 1rem;
    }

    .desktop-toggle-btn {
        display: none;
        /* Hide desktop toggle on mobile */
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Language Selector */
    .header-lang-selector {
        display: flex;
        align-items: center;
        background: var(--bg-color);
        padding: 0.2rem 0.5rem;
        border-radius: 0.5rem;
        border: 1px solid var(--border-color);
    }

    .header-lang-selector select {
        background: transparent;
        border: none;
        color: var(--text-color);
        font-size: 0.9rem;
        font-weight: 600;
        margin-left: 0.5rem;
        font-family: inherit;
        outline: none;
        width: auto;
        cursor: pointer;
    }

    /* Menu Toggle Button */
    .menu-toggle {
        color: var(--text-color);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.5rem;
        border-radius: 0.5rem;
        transition: background-color 0.2s;
        margin-left: auto;
    }

    .menu-toggle:active {
        background-color: var(--border-color);
    }

    .post-content {
        padding: 1.5rem;
    }

    /* Mobile Sidebar Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 95;
        /* Behind sidebar (100), above header (90) */
        opacity: 0;
        transition: opacity 0.3s;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Close Button */
    .sidebar-close-btn {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-color);
        position: absolute;
        top: 1rem;
        right: 1rem;
        cursor: pointer;
    }
}

/* Hide close button on desktop */
@media (min-width: 1281px) {
    .sidebar-close-btn {
        display: none;
    }
}

/* Language Toggle */
.lang-toggle {
    display: flex;
    background: var(--border-color);
    border-radius: 0.5rem;
    padding: 0.25rem;
    margin-top: 2rem;
}

.lang-btn {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    /* Ensure no underline */
    color: #64748b;
    transition: all 0.2s;
}

.lang-btn:hover {
    color: var(--text-color);
}

.lang-btn.active {
    background: var(--card-bg);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    font-weight: 700;
}

/* Admin Panel (Global) */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    flex-shrink: 0;
    color: var(--text-color);
}

/* Ensure headings in sidebar inherit color */
.admin-sidebar h3,
.admin-sidebar h4 {
    color: var(--text-color) !important;
}

.admin-nav-link {
    display: block;
    padding: 0.75rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s;
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* Admin Tables */
.admin-content table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
    background: var(--card-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.admin-content th,
.admin-content td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-content th {
    background: var(--header-bg);
    font-weight: 600;
}

.admin-content .btn {
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
}

.admin-content .btn-primary {
    background: var(--primary-color);
    color: white;
}

.admin-content .btn-edit {
    background: #64748b;
    color: white;
}

.admin-content .btn-delete {
    background: #ef4444;
    color: white;
}

.admin-content .form-input,
.admin-content .form-textarea,
.admin-content .form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-family: var(--font-main);
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--input-text);
}

/* Comments */
.comment-form {
    margin-bottom: 2rem;
}

.comment-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.comment-item.admin-comment {
    border-left: 3px solid var(--primary-color);
}

.comment-author {
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.comment-date {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

.comment-body {
    color: var(--text-color);
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Comment Form specific fixes */
input,
textarea,
select,
.form-input {
    background: var(--input-bg) !important;
    color: var(--input-text) !important;
    border: 1px solid var(--border-color);
}

/* Ensure placeholder text is visible but distinct */
::placeholder {
    color: var(--text-color);
    opacity: 0.5;
}

/* Admin Modal */
.admin-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.admin-modal-overlay.active {
    display: flex;
}

.admin-modal {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.admin-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.modal-content-preview img {
    max-width: 100%;
    height: auto;
}

/* Admin Responsive */
@media (max-width: 1024px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .admin-sidebar.active {
        transform: translateX(0);
    }

    /* Overlay for mobile sidebar */
    .admin-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 900;
        display: none;
    }

    .admin-overlay.active {
        display: block;
    }

    .admin-content {
        padding: 10px !important;
        /* Slight gap from edges */
        padding-top: 100px !important;
        /* More space from header */
        width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    /* Mobile Table -> Card Transformation (Namuwiki Style) */
    .admin-content table,
    .admin-content tbody,
    .admin-content tr,
    .admin-content td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .admin-content table {
        border-top: 1px solid #ccc;
        margin-top: 0;
        background: var(--bg-color);
        /* Match background */
        box-shadow: none;
        border-radius: 0;
    }

    /* Hide Table Header */
    .admin-content thead {
        display: none;
    }

    /* Card Style for Rows (Namuwiki Flat Style) */
    .admin-content tr {
        background: var(--card-bg);
        margin-bottom: 5px;
        /* Slight separation */
        border: 1px solid #ccc;
        /* Border on all sides for box look */
        border-radius: 4px;
        /* Slight rounding */
        padding: 0.5rem;
        /* Reduced internal padding */
        box-shadow: none;
    }

    /* Cell Styles */
    .admin-content td {
        padding: 0.2rem 0;
        border: none;
        text-align: left;
    }

    /* Specific Column Targeting (assuming standard order: Date, Title, Category, Actions) */

    /* 1. Date (Small & Gray) */
    .admin-content td:nth-child(1) {
        font-size: 0.75rem;
        color: #888;
        margin-bottom: 0.2rem;
    }

    /* 2. Title (Large & Bold) */
    .admin-content td:nth-child(2) {
        font-size: 1.1rem;
        font-weight: bold;
        margin-bottom: 0.5rem;
    }

    .admin-content td:nth-child(2) a {
        display: block;
        /* Make whole title clickable */
    }

    /* 3. Category (Full Width) */
    .admin-content td:nth-child(3) {
        margin-bottom: 0.5rem;
    }

    .admin-content td:nth-child(3) select {
        width: 100%;
        padding: 0.5rem;
        border: 1px solid var(--border-color);
        border-radius: 0.3rem;
    }

    /* 4. Actions (Flex Buttons) */
    .admin-content td:nth-child(4) {
        display: flex;
        gap: 0.5rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px dashed var(--border-color);
    }

    .admin-content td:nth-child(4) .btn {
        flex: 1;
        text-align: center;
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .admin-content h1 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .admin-content .btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    /* Compact Forms */
    .form-group {
        margin-bottom: 0.8rem;
    }

    .form-input,
    .form-select,
    textarea {
        font-size: 16px;
        /* Prevent IOS zoom */
        padding: 0.5rem;
    }

    /* Mobile Header Toggle */
    .admin-mobile-header {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        background: var(--sidebar-bg);
        border-bottom: 1px solid var(--border-color);
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 9999;
        /* Max Z-Index */
    }

    .admin-toggle-btn {
        background: none;
        border: none;
        color: var(--text-color);
        font-size: 1.5rem;
        cursor: pointer;
        margin-right: 1rem;
    }

    .admin-page-title {
        font-size: 1.1rem;
        font-weight: bold;
        color: var(--text-color);
    }

    .voice-blog-btn {
        background: var(--primary-color);
        border: none;
        color: white;
        font-size: 2rem;
        /* Larger icon */
        width: 60px;
        /* Larger button */
        height: 60px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        margin-left: auto;
        box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
        animation: mobile-pulse 2s infinite;
        z-index: 1001;
        /* Ensure it's on top */
    }

    .voice-blog-btn:active {
        transform: scale(0.95);
    }
}



@keyframes mobile-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 99, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

@media (max-width: 1024px) {

    /* Settings Card Optimization for Mobile */
    .settings-card {
        padding: 0.8rem !important;
        margin-bottom: 0.5rem !important;
        border-radius: 4px !important;
        /* Sharper */
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }

    .settings-card h2 {
        font-size: 1.1rem !important;
        margin-bottom: 0.8rem !important;
        padding-bottom: 0.3rem !important;
        border-bottom: 2px solid var(--border-color) !important;
    }

    .form-group {
        margin-bottom: 0.8rem !important;
    }

    .form-input,
    .form-textarea,
    .form-select {
        padding: 0.5rem !important;
        font-size: 14px !important;
    }

    /* Categories Mobile Styles (Namuwiki Compact) */
    .add-box {
        padding: 0.8rem !important;
        margin-bottom: 1rem !important;
        border-radius: 4px !important;
        border: 1px solid #ccc !important;
        background: var(--card-bg) !important;
    }

    .add-box h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .add-box form {
        flex-direction: column !important;
        gap: 0.5rem !important;
        align-items: stretch !important;
    }

    .add-box form div {
        width: 100% !important;
    }

    .add-box .form-input {
        width: 100% !important;
    }

    .cat-head {
        display: none !important;
        /* Hide header on mobile */
    }

    .cat-item {
        display: flex !important;
        flex-direction: column;
        gap: 0.5rem !important;
        padding: 0.8rem !important;
        border: 1px solid #ccc !important;
        border-radius: 4px !important;
        margin-bottom: 0.5rem !important;
        background: var(--card-bg) !important;
    }

    .cat-item div {
        width: 100% !important;
    }

    .cat-item .form-input {
        width: 100% !important;
    }

    .cat-item .btn-delete {
        width: 100% !important;
        padding: 0.5rem !important;
        margin-top: 0.5rem;
    }
}

@media (min-width: 1025px) {

    .admin-mobile-header,
    .admin-overlay {
        display: none;
    }
}

/* =========================================
   Markdown Content Styling (Added for Better Contrast)
   ========================================= */

/* Blockquote */
blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-left: 5px solid var(--primary-color);
    background-color: #f8fafc;
    /* Light mode bg (Slate 50) */
    color: #334155;
    /* Slate 700 - Darker for better contrast */
    font-style: normal;
    /* Modern look */
    border-radius: 0 0.5rem 0.5rem 0;
    line-height: 1.7;
    border: 1px solid #e2e8f0;
    /* Slight border for definition in light mode */
}

blockquote p {
    margin-bottom: 0.5rem;
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* Code Blocks */
pre {
    background-color: #f1f5f9;
    /* Slate 100 */
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    line-height: 1.5;
    color: #334155;
    white-space: pre-wrap;
    /* Wrap long lines */
}

/* Inline Code */
/* Ensure generic code elements are styled */
code,
.entry-content code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background-color: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    color: #d63384;
    /* Standard pinkish for code */
    border: 1px solid #e2e8f0;
}

/* Reset for code inside pre */
pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    border: none;
    font-size: inherit;
}

/* Tables in Content */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.entry-content th,
.entry-content td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.entry-content th {
    background-color: #f1f5f9;
    font-weight: 600;
    color: #334155;
}

/* Lists */
.entry-content ul,
.entry-content ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
    /* Reduced vertical margin */
    padding-left: 1rem;
}

.entry-content li {
    margin-bottom: 0.25rem;
    /* Tighter list items */
}

/* Remove paragraph margins inside lists to prevent huge gaps */
.entry-content li p {
    margin-bottom: 0;
    display: inline-block;
    /* Helps with alignment */
}


/* Horizontal Rule */
hr {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
    opacity: 0.6;
}

/* =========================================
   Dark Mode Overrides for Markdown
   ========================================= */

body.dark-mode blockquote {
    background-color: rgba(0, 0, 0, 0.3) !important;
    /* Darker than card */
    color: #ffffff !important;
    /* Pure white text */
    border-left-color: var(--primary-color);
    box-shadow: none;
    border: 1px solid #334155;
    /* Add border for definition */
}

body.dark-mode blockquote p,
body.dark-mode blockquote span,
body.dark-mode blockquote div,
body.dark-mode blockquote li {
    color: #ffffff !important;
    /* Force inheritance */
}

body.dark-mode pre {
    background-color: #0f172a !important;
    /* Darker bg */
    border-color: #334155;
    color: #e2e8f0 !important;
}

body.dark-mode code,
body.dark-mode .entry-content code {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #67e8f9 !important;
    /* Cyan 300 - Very distinct */
}

body.dark-mode pre code {
    background-color: transparent !important;
    color: inherit !important;
}

body.dark-mode .entry-content th {
    background-color: #334155;
    color: #ffffff !important;
    border-color: #475569;
}

body.dark-mode .entry-content td {
    border-color: #475569;
    color: #e2e8f0 !important;
}

body.dark-mode .entry-content tr:hover td {
    background-color: rgba(255, 255, 255, 0.05);
}

/* =========================================
   Admin Settings & Layout Fixes
   ========================================= */

/* Admin Layout (ensure sidebar doesn't shrink) */
.admin-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.admin-content {
    flex: 1;
    min-width: 0;
    /* Prevent flex overflow */
    padding: 2rem;
    overflow-x: hidden;
}

/* Settings Card */
.settings-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
}

/* Save Button */
.btn-save {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.btn-save:hover {
    opacity: 0.9;
}

/* Banner Configuration Items */
.banner-item {
    border: 1px solid var(--border-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    background: var(--bg-color);
}

.banner-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    align-items: center;
}

.btn-move {
    background: #64748b;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.85rem;
    margin-right: 0.2rem;
}


/* =========================================
   Editor Layout Force Fix
   ========================================= */
.editor-textarea-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 60vh;
    /* Minimum height for the wrapper */
}

/* Specific selector to override any potential conflicts */
.editor-textarea-wrapper textarea,
textarea#content_ko {
    flex: 1;
    width: 100%;
    height: 100% !important;
    /* Force height to fill wrapper */
    min-height: 60vh !important;
    /* Force minimum height */
    box-sizing: border-box;
    display: block;
}