/* Custom Theme Overrides for Learning Portal */

/* === Visual Design Refresh (feature/visual_design_refresh prototype) === */

.article-header {
    margin-bottom: 28px;
}

/* Top accent banner - the "yellow strip" from the PySpark intro page,
   now a reusable per-article element instead of hand-copied per page.
   Breaks out to full viewport width regardless of the content column. */
.top-accent-banner {
    background: linear-gradient(90deg, #ffc700 0%, #ffd033 100%);
    color: #0a192f;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    padding: 12px 24px;
    margin-left: calc(-1 * var(--content-h-padding, 50px));
    margin-right: calc(-1 * var(--content-h-padding, 50px));
    width: calc(100% + 2 * var(--content-h-padding, 50px));
    text-align: center;
    box-shadow: 0 4px 12px rgba(255, 199, 0, 0.12);
    margin-top: -24px;
    margin-bottom: 32px;
    user-select: none;
}

/* Minimal, borderless coffee-support line - no boxed "card" treatment,
   uses the site's blue accent instead of the old clashing amber. */
.coffee-line {
    margin-top: 24px;
    padding-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
}

.coffee-line span {
    color: var(--text-muted);
}

.coffee-line a {
    color: var(--accent-blue);
    font-weight: 700;
    text-decoration: none;
}

.coffee-line a:hover {
    text-decoration: underline;
}

/* Minimal, borderless Prev/Next lesson navigation - plain text hyperlinks,
   no boxed "card" treatment (matches .coffee-line's minimal style). */
.lesson-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    gap: 20px;
    font-size: 13.5px;
}

.lesson-nav-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    max-width: 48%;
}

.lesson-nav-link.next-link {
    align-items: flex-end;
    text-align: right;
    margin-left: auto;
}

.lesson-nav-direction {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.lesson-nav-title {
    font-weight: 700;
    color: var(--accent-blue);
}

.lesson-nav-link:hover .lesson-nav-title {
    text-decoration: underline;
}

/* Free-account nudge toast - non-blocking, bottom-right corner card
   shown once per browser to anonymous visitors on free content. */
.free-account-nudge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 900;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 320px;
    padding: 16px 18px;
    background: var(--bg-secondary, #1e293b);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-left: 3px solid #10b981;
    border-radius: 14px;
    box-shadow: 0 12px 30px -8px rgba(0,0,0,0.35);
    transform: translateY(16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.free-account-nudge.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.free-account-nudge-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    padding: 2px;
}

.free-account-nudge-icon {
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.free-account-nudge-body strong {
    display: block;
    font-size: 13.5px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.free-account-nudge-body p {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.free-account-nudge-body a {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 700;
    color: #10b981;
    text-decoration: none;
}

.free-account-nudge-body a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .free-account-nudge {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

.article-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: var(--accent-blue-soft);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue-soft);
}

.reading-time-badge {
    font-size: 15px;
    color: var(--text-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Collapsible in-article Table of Contents.
   Note: this is a <details> element, and .content-body details / .content-body
   details summary / .content-body details > :not(summary) (generic styling for
   markdown-authored collapsible blocks, defined in base.html) match it too, at
   equal-or-higher specificity, some with !important. Every rule below is scoped
   under .content-body and !important'd where needed to reliably win that fight -
   dropping either would silently lose properties back to the generic rules. */
.content-body .in-article-toc {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-left: 3px solid var(--accent-blue) !important;
    border-radius: 10px !important;
    padding: 0 !important;
    margin: 0 0 32px 0 !important;
    box-shadow: none !important;
    overflow: hidden;
}

.content-body .in-article-toc summary {
    padding: 16px 22px;
    font-size: 22px;
    font-weight: 800;
    color: var(--accent-blue) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    user-select: none;
}

.content-body .in-article-toc summary::-webkit-details-marker {
    display: none;
}

.content-body .in-article-toc summary .material-icons-round {
    font-size: 22px;
    color: var(--accent-blue);
    transition: transform 0.2s ease;
}

.content-body .in-article-toc[open] summary .material-icons-round.toc-chevron {
    transform: rotate(90deg);
}

.content-body .in-article-toc-list {
    padding: 4px 22px 20px 54px !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-left: none !important;
}

.content-body .in-article-toc-list a {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-blue) !important;
    text-decoration: none;
    padding: 5px 0 5px 18px;
    border-left: 2px solid var(--border-color);
    transition: color 0.15s ease, border-color 0.15s ease;
}

.content-body .in-article-toc-list a:hover,
.content-body .in-article-toc-list a.toc-active {
    color: var(--accent-blue) !important;
    border-left-color: var(--accent-blue);
}

.content-body .in-article-toc-list a.toc-active {
    font-weight: 700;
}

.content-body .in-article-toc-list a.toc-level-3 {
    padding-left: 42px;
    font-size: 13.5px;
    font-weight: 500;
}

/* Decorative wave footer that closes out an article */
.article-ocean-footer {
    margin: 56px -4px -4px -4px;
    line-height: 0;
    overflow: hidden;
    border-radius: 0 0 12px 12px;
}

.article-ocean-footer svg {
    width: 100%;
    height: 130px;
    display: block;
}

.article-ocean-footer .wave-back {
    fill: var(--accent-blue);
    opacity: 0.16;
}

.article-ocean-footer .wave-front {
    fill: var(--accent-blue);
    opacity: 0.32;
}

/* Glassmorphism card style */
.card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
}

/* Code block styling enhancements */
pre {
    background: var(--bg-secondary) !important;
    border-radius: 8px;
    padding: 16px !important;
    position: relative;
    overflow-x: auto;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.2), 0 4px 6px -2px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}

/* Scoped to code BLOCKS only - a bare `code` selector here used to match
   every inline <code> span on the site too (with !important, so it beat
   .content-body :not(pre)>code's theme-aware color in base.html), forcing
   this block's dark-terminal gray onto inline code regardless of what
   background it sat on. Most visible on custom-colored callout boxes,
   where the gray became nearly unreadable against a light background. */
pre code {
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 13px;
    color: #d4d4d4 !important;
}

/* Highlighted "type this" prompts in tutorial walkthroughs (yellow
   highlighter effect on <mark>). Same treatment in light and dark mode
   on purpose - a highlighter pen doesn't change color with the room,
   and it needs to read as "type this exact text" regardless of theme. */
.content-body mark {
    background: #fde047;
    color: #1f2937;
    padding: 0.05em 0.4em;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* Accordion styling for scenario sections */
details {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 12px 0;
}
summary {
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Call‑out blockquote enhancements */
blockquote {
    border-left-width: 8px;
    background: var(--blockquote-bg);
    border-left-color: var(--blockquote-border);
    padding: 16px 20px;
    border-radius: 0 12px 12px 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
blockquote:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 10px -1px rgba(0,0,0,0.1);
}

/* Smooth scroll for in‑page navigation */
html {
    scroll-behavior: smooth;
}

/* Theme-aware Admonitions (Borderless / Boxless) */
.admonition-note,
.admonition-tip,
.admonition-warning,
.admonition-danger,
.admonition-caution {
    background: none !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 4px 0 4px 18px !important;
    margin: 24px 0 !important;
    box-shadow: none !important;
    color: var(--text-primary);
}

.admonition-note {
    border-left: 3px solid #017cee !important;
}
.admonition-note strong {
    color: #017cee !important;
}

.admonition-tip {
    border-left: 3px solid #4caf50 !important;
}
.admonition-tip strong {
    color: #2e7d32 !important;
}
:root[data-theme="dark"] .admonition-tip strong {
    color: #4caf50 !important;
}

.admonition-warning {
    border-left: 3px solid #ff9800 !important;
}
.admonition-warning strong {
    color: #e65100 !important;
}
:root[data-theme="dark"] .admonition-warning strong {
    color: #ff9800 !important;
}

.admonition-danger,
.admonition-caution {
    border-left: 3px solid #f44336 !important;
}
.admonition-danger strong,
.admonition-caution strong {
    color: #c62828 !important;
}
:root[data-theme="dark"] .admonition-danger strong,
:root[data-theme="dark"] .admonition-caution strong {
    color: #f44336 !important;
}

/* GitHub-style callouts (> [!NOTE], [!TIP], [!WARNING], [!IMPORTANT], [!CAUTION])
   rendered via the markdown-callouts extension as <div class="admonition KIND">.
   Same borderless left-rail treatment as .admonition-note etc. above. */
.admonition {
    background: none !important;
    border-radius: 0 !important;
    border: none !important;
    padding: 4px 0 4px 18px !important;
    margin: 24px 0 !important;
    box-shadow: none !important;
    color: var(--text-primary);
}

.admonition-title {
    font-weight: 700;
    display: inline !important;
    margin: 0 !important;
}
.admonition-title::after {
    content: ": ";
}

/* Keep the title and the callout's opening line on the same row -
   only the first paragraph flows inline; any further paragraphs in a
   multi-line callout still stack normally below. */
.admonition-title + p {
    display: inline !important;
    margin: 0 !important;
}

.admonition.note {
    border-left: 3px solid #017cee !important;
}
.admonition.note .admonition-title {
    color: #017cee !important;
}

.admonition.tip {
    border-left: 3px solid #4caf50 !important;
}
.admonition.tip .admonition-title {
    color: #2e7d32 !important;
}
:root[data-theme="dark"] .admonition.tip .admonition-title {
    color: #4caf50 !important;
}

.admonition.important {
    border-left: 3px solid #8250df !important;
}
.admonition.important .admonition-title {
    color: #6639ba !important;
}
:root[data-theme="dark"] .admonition.important .admonition-title {
    color: #a371f7 !important;
}

.admonition.warning {
    border-left: 3px solid #ff9800 !important;
}
.admonition.warning .admonition-title {
    color: #e65100 !important;
}
:root[data-theme="dark"] .admonition.warning .admonition-title {
    color: #ff9800 !important;
}

.admonition.danger {
    border-left: 3px solid #f44336 !important;
}
.admonition.danger .admonition-title {
    color: #c62828 !important;
}
:root[data-theme="dark"] .admonition.danger .admonition-title {
    color: #f44336 !important;
}

/* Details & summary styles for accordions (Borderless / Boxless) */
.content-body details {
    margin: 16px 0;
    padding: 8px 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.content-body details summary {
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #017cee !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
    outline: none;
}

.content-body details[open] summary {
    margin-bottom: 12px;
}

.content-body details > :not(summary) {
    margin-top: 8px;
    margin-bottom: 8px;
    padding-left: 16px;
    border-left: 2px solid var(--border-color);
}

/* Mermaid edge/relationship labels (e.g. "Rack-Aware Replication" on a
   connector line) render with a solid grey pill background by default,
   which reads as an ugly highlight rather than a label. Strip the
   background and make the text itself carry the emphasis instead. */
.mermaid .edgeLabel,
.mermaid .edgeLabel p,
.mermaid .edgeLabel span,
.mermaid .edgeLabel rect,
.mermaid .labelBkg {
    background: transparent !important;
    fill: transparent !important;
    opacity: 1 !important;
}

.mermaid .edgeLabel,
.mermaid .edgeLabel p {
    font-weight: 700 !important;
    color: #f59e0b !important;
}

:root[data-theme="dark"] .mermaid .edgeLabel,
:root[data-theme="dark"] .mermaid .edgeLabel p {
    color: #fbbf24 !important;
}

/* Brand Logo Badge Override (Reset Global Image Boxes) */
.content-body .airflow-brand-badge img {
    display: inline-block !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.12)) !important;
    transition: none !important;
}
.content-body .airflow-brand-badge img:hover {
    transform: none !important;
    box-shadow: none !important;
}
