/* notebooks.css */

/* 
   VIEWPORT LAYOUT STRATEGY 
   Mobile (< 768px): Text 96%, Charts 100%
   Tablet (>= 768px): Text 80%, Charts 100%
   Desktop (>= 1024px): Text 50%, Charts 80%
*/

.notebook-content {
    width: 100%;
    margin: 0 auto;

    /* Typography Unification: Use Home Page Sans-Serif */
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1.125rem;
    /* 18px */
    line-height: 1.7;
    /* Standard readable line-height for sans */
    color: #f3f4f6;
    /* Gray-100 - High Contrast White */
    text-align: left;
    /* Enforce left alignment */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Notebook Headings */
.notebook-content h1,
.notebook-content h2,
.notebook-content h3,
.notebook-content h4,
.notebook-content h5,
.notebook-content h6 {
    font-family: 'Inter', system-ui, sans-serif;
    color: #ffffff;
    /* Pure White */
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    /* Enforce left alignment */
}

.notebook-content h1 {
    font-size: 2.25rem;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.notebook-content h2 {
    font-size: 1.75rem;
    margin-top: 2em;
    margin-bottom: 0.8em;
    /* Removed border-bottom for cleaner look */
    padding-bottom: 0.3em;
    border-bottom-color: #374151;
    /* Gray-700 */
}

.notebook-content h3 {
    font-size: 1.5rem;
    margin-top: 1.8em;
    margin-bottom: 0.8em;
}

.notebook-content p {
    margin-bottom: 1.8em;
}

.notebook-content iframe[src*="youtube.com"],
.notebook-content iframe[src*="youtube-nocookie.com"],
.notebook-content iframe[src*="youtu.be"] {
    display: block;
    width: min(100%, 720px);
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 0 auto 2em;
    border: 1px solid #333;
    border-radius: 8px;
    background: #111;
}

/* LIST STYLING RESTORATION */
.notebook-content ul {
    list-style-type: disc;
    margin-bottom: 1.8em;
    padding-left: 1.5em;
    /* Visible indentation */
}

.notebook-content ol {
    list-style-type: decimal;
    margin-bottom: 1.8em;
    padding-left: 1.5em;
    /* Visible indentation */
}

.notebook-content li {
    margin-bottom: 0.5em;
    padding-left: 0.5em;
    /* Slight separation from bullet */
}

.notebook-content li::marker {
    color: #9ca3af;
    /* Gray-400 */
}

/* END LIST STYLING */

/* -- TEXT CONTENT (The "Well") -- */
/* Applies to everything that is NOT a chart/breakout element */
.notebook-content>*:not(.output-image):not(.rich-output):not(.svg-output):not(.dataframe-container):not(img):not(iframe):not(p:has(img)) {
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    padding-left: 0;
    padding-right: 0;

    /* Mobile Default */
    width: 96%;
}

/* Tablet Text */
@media (min-width: 768px) {
    .notebook-content>*:not(.output-image):not(.rich-output):not(.svg-output):not(.dataframe-container):not(img):not(iframe):not(p:has(img)) {
        width: 80%;
    }
}

/* Desktop Text */
@media (min-width: 1024px) {
    .notebook-content>*:not(.output-image):not(.rich-output):not(.svg-output):not(.dataframe-container):not(img):not(iframe):not(p:has(img)) {
        width: 50%;
    }
}


/* -- CHARTS / BREAKOUT CONTENT -- */
.notebook-content .output-image,
.notebook-content .rich-output,
.notebook-content .svg-output,
.notebook-content img,
.notebook-content .dataframe-container {
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;

    /* Mobile/Tablet Default: Full Width */
    width: 100%;
    max-width: none;

    margin-top: 2em;
    margin-bottom: 2em;
    background-color: #1e1e1e;
    padding: 1rem;

    /* Mobile: Square edges or minimal radius */
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    box-shadow: none;
}

/* Desktop Charts */
@media (min-width: 1024px) {

    .notebook-content .output-image,
    .notebook-content .rich-output,
    .notebook-content .svg-output,
    .notebook-content img,
    .notebook-content .dataframe-container {
        width: 66.666667%;

        /* Premium Card Look applies strictly on Desktop when it floats */
        border-radius: 8px;
        border: 1px solid #333;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
        padding: 2rem;
        margin-top: 3em;
        margin-bottom: 3em;
    }
}


/* -- DARK MODE OVERRIDES -- */

.notebook-content .output-image,
.notebook-content .rich-output svg,
.notebook-content .svg-output svg {
    filter: invert(1) hue-rotate(180deg) contrast(0.9);
}

/* -- TABLE STYLING -- */
.notebook-content table {
    display: block;
    margin-left: auto;
    margin-right: auto;
    overflow-x: auto;

    /* Mobile Default */
    width: 100%;
    border-radius: 0;
    border: none;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    background: #1e1e1e;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
    border-spacing: 0;
    border-collapse: separate;
}

@media (min-width: 1024px) {
    .notebook-content table {
        width: 80%;
        border-radius: 8px;
        border: 1px solid #333;
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    }
}

.notebook-content table thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #374151;
    color: #9ca3af;
    background-color: #111827;
}

.notebook-content table tbody td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #374151;
    color: #d1d5db;
}

.notebook-content table tbody th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-weight: normal;
    border-bottom: 1px solid #374151;
    color: #6b7280;
    background-color: #1e1e1e;
}

/* Header utility class to match text width */
.post-header-container {
    margin-left: auto;
    margin-right: auto;
    width: 96%;
}

@media (min-width: 768px) {
    .post-header-container {
        width: 80%;
    }
}

@media (min-width: 1024px) {
    .post-header-container {
        width: 50%;
    }
}
