/* =========================================================================
   MONGKOL DRIVE — EDITORIAL ALMANAC STYLESHEET
   Style definitions, responsive calendar rules, and custom components
   ========================================================================= */

:root {
    --bg-paper: #F5F1E8;
    --bg-card: #FCFBF8;
    --border-hairline: #DCD2BC;
    --border-dark: #1F1D1A;
    --ink-primary: #141311;
    --ink-secondary: #5C574F;
    --brass-accent: #8A6624;
}

body {
    background-color: var(--bg-paper);
    background-image: radial-gradient(#DCD2BC 0.55px, transparent 0.55px);
    background-size: 24px 24px;
    color: var(--ink-primary);
    min-height: 100vh;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    -webkit-tap-highlight-color: transparent;
}

/* System Title Bar */
.system-titlebar {
    background: #141311;
    color: #F5F1E8;
    border-bottom: 1px solid rgba(220, 210, 188, 0.2);
}

/* Editorial Container & Cards */
.editorial-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-hairline);
    box-shadow: 0 1px 2px rgba(20, 19, 17, 0.03);
}

.editorial-double-border {
    border-top: 2px solid var(--border-dark);
    border-bottom: 1px solid var(--border-hairline);
}

/* Custom form elements */
select.editorial-select, 
input.editorial-input {
    background-color: #FCFBF8;
    border: 1px solid #CFC4AC;
    color: #141311;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select.editorial-select:focus, 
input.editorial-input:focus {
    outline: none;
    border-color: #1F1D1A;
    box-shadow: 0 0 0 1px #1F1D1A;
}

/* Calendar Grid & Cells */
.calendar-cell {
    transition: background-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
    position: relative;
    user-select: none;
}

.calendar-cell:active {
    transform: scale(0.98);
}

/* Selected Active Date Cell */
.calendar-cell-selected {
    background-color: #141311 !important;
    color: #FCFBF8 !important;
    box-shadow: 0 4px 12px rgba(20, 19, 17, 0.25);
    z-index: 20;
}

/* Tabular Numbers */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #F5F1E8;
}

::-webkit-scrollbar-thumb {
    background: #BFB297;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8A6624;
}

/* Smooth Horizontal Scroll on Mobile */
.scroll-touch {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Hide scrollbar for clean tab look while keeping scroll */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Mobile Badge and Label Adjustments */
@media (max-width: 640px) {
    .calendar-cell {
        min-height: 68px;
    }
}

/* Mobile Bottom Navigation Bar & Safe Area */
.safe-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 1023px) {
    body {
        padding-bottom: 4.5rem; /* Space so fixed mobile bottom dock never covers content */
    }
}

.mobile-tab-btn {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Print Optimization for Report Generation */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    header, 
    nav, 
    .tab-btn, 
    #toastBanner, 
    button, 
    select {
        display: none !important;
    }
    .editorial-card {
        border: 1px solid #cccccc !important;
        box-shadow: none !important;
    }
}
