/* ==========================================================================
   1. GLOBAL PYDATA THEME COLOR PALETTE (Light Mode Defaults)
   ========================================================================== */
html[data-theme="light"] {
    /* Main Canvas Background & Typography */
    --pst-color-background: #ffffff;
    --pst-color-text-base: #334155;   /* Soft slate for highly readable body prose */
    --pst-color-heading: #0f172a;     /* Crisp, near-black for authoritative headings */

    /* Brand Accent Colors */
    --pst-color-primary: #f0781e;       /* Heat Brand Orange */
    --pst-color-primary-hover: #d66413; /* Deepened Orange */
    --pst-color-secondary: #005aa0;     /* Deep Accent Blue */

    /* Layout Borders & Dividers */
    --pst-color-border: #cbd5e1;        /* Defined, professional structural borders */

    /* Top Horizontal Navigation Banner */
    --pst-color-navbar-background: #005aa0;      /* Deep Accent Blue Header Bar */
    --pst-color-navbar-link: #ffffff;            /* White main link items */
    --pst-color-navbar-link-hover: #f0781e;      /* Brand Orange on element hover */
    --pst-color-navbar-link-active: #f0781e;     /* Brand Orange on current section marker */
}

/* ==========================================================================
   2. SPHINX DESIGN COMPONENT REFINEMENTS
   ========================================================================== */

/* Modern Grid Portal Cards (Diátaxis Gateway) */
.sd-card {
    background-color: #f8fafc !important; /* Extremely clean, cool-gray fill */
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
    transition: all 0.2s ease-in-out !important;
}

/* Smooth lift transition on user interactions */
.sd-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04) !important;
}

/* Strip structural header/footer layout lines inside cards */
.sd-card-header,
.sd-card-footer {
    background-color: transparent !important;
    border-bottom: none !important;
    border-top: none !important;
}

/* Primary Action Callouts (Buttons matching our Brand Tokens) */
.sd-btn-primary {
    background-color: var(--pst-color-primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    padding: 10px 20px !important;
    transition: background-color 0.2s ease-in-out !important;
}

/* ==========================================================================
   3. CUSTOM LAYOUT UTILITIES & CASE STUDY MODULES
   ========================================================================== */

/* Typography Overrides */
.text-center {
    text-align: center;
}

/* Unified Code Block Typography Settings */
code,
.rst-content tt,
.rst-content code {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", Courier, monospace;
    font-size: 0.9em;
}

/* Custom Interactive Section Blocks */
.tutorial,
.case {
    overflow: hidden;
    border-radius: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.tutorial:hover,
.case:hover {
    color: #ffffff !important;
    background-color: var(--pst-color-primary);
}

.tutorial-image {
    background-color: #ffffff;
    margin: 20px;
    padding: 20px;
    width: 25%;
    float: left;
    border-radius: 7px;
}

.tutorial-text {
    padding: 20px;
    float: left;
    width: 65%;
}

/* Symmetrical Grid Alignments for Internal Visual Components */
.case {
    width: 45%;
    float: left;
    margin: 2.5%;
}

.case-image {
    background-color: #ffffff;
    position: relative;
    height: 200px;
    overflow: hidden;
}

.case-image>img {
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    margin: auto;
    max-height: 170px;
    padding: 15px;
}

.case-text {
    height: 200px;
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Custom Inline Highlight Highlights */
.highlight-output>.highlight,
.highlight-text>.highlight {
    background-color: #fbe4d2 !important; /* Matches your brand --horange-light token */
}

.heat-timeline {
    margin-top: 4rem;
    border-left: 3px solid #dee2e6;
    padding-left: 25px;
    margin-left: 15px;
    list-style: none;
}

.heat-timeline .timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

/* The dots on the timeline */
.heat-timeline .timeline-item::before {
    content: "";
    position: absolute;
    left: -34px; /* Centers the dot exactly on the border line */
    top: 32px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: #005aa9;
    border: 3px solid #ffffff; /* Creates a clean cutout ring effect */
}

.timeline-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.heat-timeline h4 {
    margin-top: 0.2rem !important; /* Overrides the Sphinx theme gap */
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   4. FRONTPAGE NEWS TIMELINE OVERRIDES
   ========================================================================== */

/* Hide any timeline items beyond the 4th on the main landing page */
.frontpage-news .timeline-item:nth-child(n+5) {
    display: none;
}

/* ============================================================
   CUSTOM OVERRIDES: Force hyperlinks to be visible in italics
   ============================================================ */
.rst-content a,
.md-typeset a {
    color: #2980B9 !important; /* Matches standard RTD blue */
    text-decoration: none;
}

.rst-content a:hover,
.md-typeset a:hover {
    text-decoration: underline !important;
}
