/* ==========================================================================
   M3 Workshop — session content page styles
   Shared brand tokens (kept in sync with m3-workshop.css):
     --navy / --navy-deep : headings, primary text
     --slate / --slate-bg : secondary copy, neutral fills
     --accent / --accent-ink : single blue accent (links, active states)
     --mono / --display   : JetBrains Mono (utility) + Geist (body/headings)
   New for this template:
     --console-bg / --console-text : the terminal styling for prompt blocks —
       the signature element of this page, since the session's subject is
       literally "write this AI prompt, then deploy the result."
   ========================================================================== */

:root {
    --navy: #0f2654;
    --navy-deep: #0a1a3d;
    --slate: #526079;
    --slate-bg: #eef2f8;
    --border: #e2e8f2;
    --accent: #2563eb;
    --accent-ink: #1d4ed8;
    --accent-glow: #60a5fa;
    --bg: #f8fbff;
    --console-bg: #0b1220;
    --console-text: #d7e3ff;
    --console-border: rgba(255, 255, 255, 0.08);
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --display: 'Geist', sans-serif;
    --nav-offset: 72px;
}

/* ---------------------------------------------------------------------- */
/* Override: style.css has TWO rules that set overflow-x: hidden —       */
/* one on html alone, one on html+body together. Both promote the        */
/* element to a scroll container, which silently breaks position: sticky  */
/* on any descendant (including .toc). `clip` achieves the same visual   */
/* effect (no horizontal scrollbar) WITHOUT creating a scroll container. */
/* ---------------------------------------------------------------------- */
html,
body {
    overflow-x: clip !important;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: var(--display);
    background: var(--bg);
    color: #1d2330;
}

a {
    outline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent-ink);
    outline-offset: 3px;
}

/* ---------------------------------------------------------------------- */
/* Session header                                                         */
/* ---------------------------------------------------------------------- */

.session-header {
    padding: 108px 0 40px;
    background: linear-gradient(180deg, var(--navy-deep) 0%, #123a68 100%);
    color: #fff;
}

.back-link {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.2s ease;
}

.back-link:hover,
.back-link:focus-visible {
    color: var(--accent-glow);
}

.session-eyebrow {
    display: block;
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-glow);
    margin-bottom: 0.6rem;
}

.session-title {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2rem, 4vw, 2.9rem);
    letter-spacing: -0.02em;
    margin: 0;
}

.session-byline {
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.98rem;
}

/* ---------------------------------------------------------------------- */
/* Layout: sticky TOC + article                                          */
/* ---------------------------------------------------------------------- */

.session-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
    /* ensures grid items size to their own content, not the row's
       tallest item — required for sticky to have room to move within */
    gap: 56px;
    padding-top: 48px;
    padding-bottom: 80px;
}

.toc {
    /* -webkit- prefix required for older Safari; unprefixed alone will
       silently no-op on those versions */
    position: -webkit-sticky;
    position: sticky;
    top: calc(var(--nav-offset) + 24px);
    align-self: start;
    /* belt-and-braces: if a stray ancestor rule ever sets overflow on
       .toc itself, this forces it back to a value sticky can work with */
    overflow: visible;
    max-height: calc(100vh - var(--nav-offset) - 48px);
    overflow-y: auto;
}

.toc-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin-bottom: 0.9rem;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--border);
}

.toc-list li {
    margin-bottom: 0.1rem;
}

.toc-list a {
    display: block;
    padding: 0.4rem 0 0.4rem 1rem;
    margin-left: -2px;
    border-left: 2px solid transparent;
    font-size: 0.9rem;
    color: var(--slate);
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.toc-list a:hover,
.toc-list a:focus-visible {
    color: var(--navy);
}

.toc-list a.is-active {
    color: var(--accent-ink);
    border-left-color: var(--accent);
    font-weight: 600;
}

.session-content {
    min-width: 0;
    max-width: 760px;
}

.content-section {
    padding-top: 8px;
    margin-bottom: 56px;
    scroll-margin-top: calc(var(--nav-offset) + 16px);
}

.content-section h2 {
    color: var(--navy-deep);
    font-weight: 800;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.content-section h3 {
    color: var(--navy-deep);
    font-weight: 700;
    font-size: 1.15rem;
}

.content-section p {
    color: #333c4d;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* ---------------------------------------------------------------------- */
/* Case study cards (intro & motivation)                                 */
/* ---------------------------------------------------------------------- */

.case-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 1.75rem 0;
}

.case-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 26px;
    box-shadow: 0 12px 28px rgba(19, 36, 72, 0.05);
}

.case-tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-ink);
    background: rgba(37, 99, 235, 0.08);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.7rem;
}

.case-card h3 {
    margin: 0 0 0.6rem;
}

.step-list {
    margin: 0.75rem 0;
    padding-left: 1.2rem;
    color: #333c4d;
    line-height: 1.65;
}

.step-list li {
    margin-bottom: 0.4rem;
}

.resource-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.resource-links a {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--accent-ink);
    text-decoration: none;
}

.resource-links a:hover,
.resource-links a:focus-visible {
    text-decoration: underline;
}

/* ---------------------------------------------------------------------- */
/* Prerequisites card                                                     */
/* ---------------------------------------------------------------------- */

.prereq-card {
    background: var(--slate-bg);
    border-radius: 16px;
    padding: 22px 26px;
    margin-top: 1.5rem;
}

.prereq-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin-bottom: 0.7rem;
}

.prereq-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 24px;
}

.prereq-list li {
    position: relative;
    padding-left: 1.4rem;
    font-size: 0.95rem;
    color: var(--navy-deep);
    font-weight: 500;
}

.prereq-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

/* ---------------------------------------------------------------------- */
/* Prompt consoles — the signature element                                */
/* ---------------------------------------------------------------------- */

.prompt-heading {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.console {
    background: var(--console-bg);
    border: 1px solid var(--console-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(5, 10, 25, 0.35);
    margin-bottom: 1.25rem;
}

.console-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--console-border);
}

.console-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.console-dot-red {
    background: #ef4444;
}

.console-dot-yellow {
    background: #f59e0b;
}

.console-dot-green {
    background: #22c55e;
}

.console-title {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: rgba(215, 227, 255, 0.6);
    margin-left: 6px;
    flex: 1;
}

.console-copy {
    font-family: var(--mono);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--accent-glow);
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.console-copy:hover {
    background: rgba(96, 165, 250, 0.22);
}

.console-copy.is-copied {
    color: #86efac;
    border-color: rgba(134, 239, 172, 0.4);
    background: rgba(34, 197, 94, 0.14);
}

.console-body {
    margin: 0;
    padding: 20px 22px;
    font-family: var(--mono);
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--console-text);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 420px;
    overflow-y: auto;
}

.discuss-box {
    background: rgba(37, 99, 235, 0.06);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    padding: 18px 22px;
    margin-top: 1.5rem;
}

.discuss-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin-bottom: 0.4rem;
}

.discuss-box p {
    margin: 0;
    font-weight: 600;
    color: var(--navy-deep);
}

/* ---------------------------------------------------------------------- */
/* Best-practice cards                                                    */
/* ---------------------------------------------------------------------- */

.practice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 1.5rem;
}

.practice-card {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 4px 14px 14px 4px;
    padding: 22px 24px;
}

.practice-card-wide {
    grid-column: 1 / -1;
}

.practice-tag {
    display: block;
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin-bottom: 0.6rem;
}

.practice-card p {
    font-size: 0.92rem;
    margin-bottom: 0.7rem;
}

.practice-card ul {
    margin: 0 0 0.75rem;
    padding-left: 1.15rem;
    font-size: 0.9rem;
    color: #333c4d;
    line-height: 1.6;
}

.practice-card ul li {
    margin-bottom: 0.3rem;
}

.practice-quote {
    font-style: italic;
    color: var(--slate);
    border-top: 1px dashed var(--border);
    padding-top: 0.7rem;
    margin-bottom: 0 !important;
}

/* ---------------------------------------------------------------------- */
/* References                                                             */
/* ---------------------------------------------------------------------- */

.reference-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.reference-list li {
    border-bottom: 1px solid var(--border);
}

.reference-list a {
    display: block;
    padding: 0.85rem 0;
    font-size: 0.96rem;
    font-weight: 600;
    color: var(--accent-ink);
    text-decoration: none;
    transition: color 0.2s ease;
}

.reference-list a:hover,
.reference-list a:focus-visible {
    color: var(--navy-deep);
}

.footer-note {
    font-size: 0.95rem;
    color: var(--slate);
}

/* ---------------------------------------------------------------------- */
/* Reduced motion                                                         */
/* ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

    .back-link,
    .toc-list a,
    .console-copy {
        transition: none !important;
    }
}

/* ---------------------------------------------------------------------- */
/* Slides CTA                                                             */
/* ---------------------------------------------------------------------- */

.slides-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.slides-cta:hover,
.slides-cta:focus-visible {
    background: rgba(96, 165, 250, 0.22);
    border-color: var(--accent-glow);
    color: #fff;
}

/* ---------------------------------------------------------------------- */
/* Figures                                                                */
/* ---------------------------------------------------------------------- */

.figure {
    margin: 1.75rem 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
}

.figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.figure figcaption {
    margin-top: 0.85rem;
    font-size: 0.85rem;
    color: var(--slate);
    line-height: 1.55;
}

.figure figcaption strong {
    color: var(--navy-deep);
}

/* ---------------------------------------------------------------------- */
/* Data tables                                                            */
/* ---------------------------------------------------------------------- */

.data-table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
}

.data-table caption {
    text-align: left;
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-ink);
    padding: 12px 16px;
    caption-side: top;
    border-bottom: 1px solid var(--border);
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    line-height: 1.55;
}

.data-table th {
    background: var(--slate-bg);
    color: var(--navy-deep);
    font-weight: 700;
    font-size: 0.82rem;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ---------------------------------------------------------------------- */
/* Quiz callouts (reuse the discuss-box pattern, distinct label)          */
/* ---------------------------------------------------------------------- */

.quiz-box {
    background: rgba(37, 99, 235, 0.06);
    border-left: 3px solid var(--accent);
    border-radius: 4px;
    padding: 18px 22px;
    margin: 1.5rem 0;
}

.quiz-label {
    display: block;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin-bottom: 0.6rem;
}

.quiz-box .quiz-given {
    list-style: none;
    margin: 0 0 0.9rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-family: var(--mono);
    font-size: 0.88rem;
    color: var(--navy-deep);
}

.quiz-box ol {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--navy-deep);
    font-weight: 500;
}

.quiz-box ol li {
    margin-bottom: 0.3rem;
}

/* ---------------------------------------------------------------------- */
/* Inline formula styling (MathJax containers inherit body color)         */
/* ---------------------------------------------------------------------- */

.formula-block {
    background: var(--slate-bg);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 1.25rem 0;
    overflow-x: auto;
}

.formula-legend {
    list-style: none;
    margin: 0.75rem 0 1.25rem;
    padding: 0;
    font-size: 0.92rem;
    color: #333c4d;
}

.formula-legend li {
    margin-bottom: 0.35rem;
}

.formula-legend em {
    font-style: normal;
    font-weight: 700;
    color: var(--navy-deep);
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                             */
/* ---------------------------------------------------------------------- */

@media (max-width: 992px) {
    .session-layout {
        grid-template-columns: 1fr;
    }

    .toc {
        position: static;
        max-height: none;
        overflow: visible;
        border-bottom: 1px solid var(--border);
        padding-bottom: 20px;
        margin-bottom: 12px;
    }

    .toc-list {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 6px;
        border-left: none;
    }

    .toc-list a {
        padding: 0.35rem 0.7rem;
        border: 1px solid var(--border);
        border-radius: 999px;
        margin-left: 0;
    }

    .toc-list a.is-active {
        border-color: var(--accent);
        background: rgba(37, 99, 235, 0.06);
    }

    .practice-grid {
        grid-template-columns: 1fr;
    }

    .practice-card-wide {
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .session-header {
        padding: 84px 0 32px;
    }

    .prereq-list {
        grid-template-columns: 1fr;
    }

    .console-body {
        font-size: 0.78rem;
        padding: 16px 16px;
    }
}