/* Spin Rate — project-specific overrides only.
   Design tokens live in lailara-frame.css (do not duplicate). */

/* Tab styling — !important overrides Dash's inline styles */
.custom-tabs {
    border-bottom: 2px solid var(--ll-london-85) !important;
    margin-bottom: var(--ll-space-lg);
}

.custom-tab {
    font-family: var(--ll-sans) !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--ll-london-35) !important;
    padding: 12px 20px !important;
    border: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background: transparent !important;
    cursor: pointer;
    border-bottom: 3px solid transparent !important;
    margin-bottom: -2px;
    transition: color var(--ll-duration-fast) var(--ll-ease-out);
}

.custom-tab:hover {
    color: var(--ll-london-20) !important;
}

.custom-tab--selected {
    color: var(--ll-chicago-20) !important;
    border-bottom: 3px solid var(--ll-chicago-20) !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background: transparent !important;
}

/* Dash dropdown — override Dash 4.x default purple accent */
.dash-dropdown {
    accent-color: var(--ll-chicago-20) !important;
    outline-color: var(--ll-chicago-20) !important;
}

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ll-space-base);
    align-items: flex-end;
    padding: var(--ll-space-base) 0;
    border-bottom: 1px solid var(--ll-london-85);
    margin-bottom: var(--ll-space-lg);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--ll-space-xs);
    min-width: 180px;
}

/* Dash 4.x renders an absolutely-positioned focus input inside each
   dropdown that ignores its container width.  Cap it so it cannot
   push the filter group wider than its flex allocation. */
.dash-dropdown-focus-target {
    max-width: 100%;
    box-sizing: border-box;
}

.filter-group label {
    font-family: var(--ll-sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--ll-london-35);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--ll-space-3xl) var(--ll-space-lg);
    color: var(--ll-london-35);
    font-family: var(--ll-sans);
    font-size: 17px;
}

.empty-state button {
    margin-top: var(--ll-space-base);
    background: var(--ll-chicago-20);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: var(--ll-radius);
    font-family: var(--ll-sans);
    font-weight: 600;
    cursor: pointer;
}

.empty-state button:hover {
    background: var(--ll-chicago-10);
}

/* Error banner */
.error-banner {
    background: var(--ll-red-95);
    color: var(--ll-red-18);
    padding: var(--ll-space-md) var(--ll-space-base);
    border-radius: var(--ll-radius);
    font-family: var(--ll-sans);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: var(--ll-space-sm);
}

/* Loading spinner override */
._dash-loading-callback {
    background-color: rgba(245, 243, 238, 0.7) !important;
}

/* Dark callout card */
.dark-callout {
    background: var(--ll-card-bg);
    color: var(--ll-card-text);
    padding: var(--ll-space-base) var(--ll-space-lg);
    border-radius: var(--ll-radius);
    margin: var(--ll-space-base) 0;
    transition: opacity var(--ll-duration-normal) var(--ll-ease-out);
}

.dark-callout-title {
    font-family: var(--ll-sans);
    font-size: 16px;
    font-weight: 600;
    color: var(--ll-card-text);
    margin-bottom: var(--ll-space-sm);
}

.dark-callout-subtitle {
    font-family: var(--ll-sans);
    font-size: 14px;
    color: var(--ll-card-subtitle);
}

.dark-callout-row {
    display: flex;
    justify-content: space-between;
    padding: var(--ll-space-xs) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-family: var(--ll-sans);
    font-size: 14px;
    color: var(--ll-card-item);
}

.dark-callout-row:last-child {
    border-bottom: none;
}

/* Annotation / insight line */
.insight-line {
    border-left: 3px solid var(--ll-london-85);
    padding: var(--ll-space-sm) var(--ll-space-base);
    font-family: var(--ll-sans);
    font-size: 15px;
    color: var(--ll-london-35);
    margin: var(--ll-space-base) 0;
    line-height: 1.5;
}

/* SPPD formula note */
.formula-note {
    font-family: var(--ll-sans);
    font-size: 13px;
    color: var(--ll-london-40);
    font-style: italic;
    padding: var(--ll-space-sm) 0;
    border-top: 1px solid var(--ll-london-85);
    margin-top: var(--ll-space-base);
}

/* Mobile responsive */
@media (max-width: 640px) {
    .filter-bar {
        flex-direction: column;
        gap: var(--ll-space-sm);
    }

    .filter-group {
        min-width: 100%;
    }

    .custom-tabs {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

/* Print — hide interactive controls */
@media print {
    .filter-bar,
    .custom-tabs,
    .dark-callout { display: none; }
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--ll-chicago-20);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    font-family: var(--ll-sans);
}

.skip-link:focus {
    top: 0;
}

/* Focus visible */
*:focus-visible {
    outline: 2px solid var(--ll-london-20);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── Narrative intro (U7) ── */

.narrative-details {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px 32px;
}

.narrative-toggle {
    font-family: var(--ll-sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--ll-chicago-20);
    cursor: pointer;
    padding: 16px 0;
    list-style: none;
    border-top: 1px solid var(--ll-london-85);
}

.narrative-toggle::-webkit-details-marker {
    display: none;
}

.narrative-toggle::before {
    content: '▸ ';
}

.narrative-details[open] > .narrative-toggle::before {
    content: '▾ ';
}

.narrative-toggle:hover {
    color: var(--ll-chicago-10);
}

.narrative-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 0 32px;
}

.narrative-content {
    max-width: var(--ll-body-max-width, 720px);
}

.narrative-title {
    font-family: var(--ll-serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--ll-london-5);
    letter-spacing: -0.02em;
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.narrative-body {
    font-family: var(--ll-sans);
    font-size: 17px;
    font-weight: 400;
    color: var(--ll-london-20);
    line-height: 1.6;
    margin: 0 0 12px 0;
    max-width: var(--ll-body-max-width, 720px);
}

.narrative-protagonist {
    margin: 24px 0;
    padding-left: 16px;
    border-left: 3px solid var(--ll-london-85);
}

/* Type comes from .ll-section-title (frame >= v1.2.0), applied alongside this
   class in layout.py. Only the non-type properties live here. */
.narrative-archetype-label {
    color: var(--ll-london-5);
    margin: 0 0 4px 0;
}

.narrative-transition {
    font-family: var(--ll-sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--ll-london-35);
    margin: 32px 0 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--ll-london-85);
}

@media (max-width: 640px) {
    .narrative-section {
        padding: 32px 16px 24px;
    }

    .narrative-title {
        font-size: 22px;
    }

    .narrative-body {
        font-size: 15px;
    }
}

@media print {
    .narrative-section {
        padding: 24px 0;
    }
}

/* ── Quadrant summary buckets ── */

.quadrant-summary-bucket {
    margin-bottom: 2px;
}

.quadrant-summary-toggle {
    font-family: var(--ll-sans);
    font-size: 14px;
    color: var(--ll-london-5);
    cursor: pointer;
    padding: 6px 0;
    list-style: none;
}

.quadrant-summary-toggle::-webkit-details-marker {
    display: none;
}

.quadrant-summary-toggle::before {
    content: '▸ ';
    color: var(--ll-london-35);
}

.quadrant-summary-bucket[open] > .quadrant-summary-toggle::before {
    content: '▾ ';
}

.quadrant-summary-toggle:hover {
    color: var(--ll-chicago-20);
}

/* ── Quadrant view (U3) ── */

/* Quadrant detail card container */
#quadrant-detail-card {
    min-width: 320px;
}

#quadrant-detail-card .dark-callout {
    min-width: 320px;
    font-size: 16px;
}

/* Indexed SPPD toggle button */
.indexed-toggle-btn {
    transition: background-color 200ms ease-out, color 200ms ease-out;
}

.indexed-toggle-btn:hover {
    opacity: 0.9;
}

/* Plotly chart marker transition for opacity dimming */
.js-plotly-plot .plotly .scatterlayer .trace .points path {
    transition: opacity 200ms ease-out;
}

/* Quadrant chart container */
#quadrant-view {
    position: relative;
}

/* Mobile responsive quadrant */
@media (max-width: 640px) {
    #quadrant-detail-card {
        min-width: 100%;
    }

    #quadrant-detail-card .dark-callout {
        min-width: 100%;
    }
}

/* ── Data grids (spreadsheet-style tables) ── */

/* Compact theme: smaller font + tighter padding so every column fits one line */
.spinrate-grid.ag-theme-alpine {
    --ag-font-size: 12px;
    --ag-grid-size: 4px;
    --ag-cell-horizontal-padding: 8px;
    --ag-row-height: 30px;
    --ag-header-height: 34px;
    --ag-font-family: var(--ll-sans);
}

/* Never wrap cell text — one line per cell */
.spinrate-grid .ag-cell {
    white-space: nowrap;
}

/* Table wrapper — full content-column width; columns fill it via
   responsiveSizeToFit, so no empty gutter and no breakout past the column. */
.grid-wide {
    width: 100%;
    margin: 16px 0;
    overflow-x: auto;
}

/* The shared frame CSS never resets the UA body margin, which leaves
   an 8px white ring around the canvas. Project-level fix. */
html, body {
    margin: 0;
    background-color: #f5f3ee; /* canvas */
}


/* ── Tool hero (30-second test) ─ sanctioned series deviation:
   hero lede 44/30 per LAILARA_DESIGN_SYSTEM.md § series-level sub-tokens */
.tool-hero {
    padding: 24px 0 8px;
}
.hero-headline {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 44px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #0d0d0d;
    margin: 0 0 12px;
    max-width: 900px;
}
.hero-subhead {
    font-family: 'Source Sans 3', 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: #333333;
    max-width: var(--ll-body-max-width, 720px);
    margin: 0 0 8px;
}
@media (max-width: 640px) {
    .hero-headline { font-size: 30px; }
    .hero-subhead  { font-size: 15px; }
}
