/* ============================================================================
   AI-103 / certification field-manual section.
   Builds on the site's existing tokens (--navy, --indigo, --violet, --cyan,
   --text, --muted, --border, --light, --surface). Light theme only, matching
   the rest of sdselite.com.
   ============================================================================ */

.cert-loading { color: var(--muted); padding: 2rem 0; }

/* ---- hero ---------------------------------------------------------------- */
.cert-hero .cert-hero-meta,
.cert-hero-meta {
    display: flex; flex-wrap: wrap; gap: .5rem .75rem; margin-top: 1.25rem;
}
.cert-hero-meta span {
    font-size: .82rem; font-weight: 600; color: #cbd5f5;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px; padding: .3rem .75rem;
}

/* ---- breadcrumbs --------------------------------------------------------- */
.cert-crumbs { margin: 0 0 1.75rem; }
.cert-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.cert-crumbs li { display: flex; align-items: center; font-size: .82rem; color: var(--muted); }
.cert-crumbs li:not(:last-child)::after { content: "/"; margin-left: .35rem; color: var(--border); }
.cert-crumbs a { color: var(--indigo); text-decoration: none; }
.cert-crumbs a:hover { text-decoration: underline; }
.cert-crumbs [aria-current="page"] { color: var(--navy); font-weight: 600; }

/* ---- hub ----------------------------------------------------------------- */
.cert-exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.cert-exam-card {
    display: block; text-decoration: none; background: var(--surface);
    border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cert-exam-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(15,23,42,.12); border-color: #c7cff0; }
.cert-exam-code {
    display: inline-block; font: 700 .78rem/1 "JetBrains Mono", ui-monospace, monospace;
    letter-spacing: .06em; color: #fff; background: linear-gradient(135deg, var(--indigo), var(--violet));
    padding: .35rem .6rem; border-radius: 7px;
}
.cert-exam-name { margin: .9rem 0 .2rem; font-size: 1.25rem; color: var(--navy); line-height: 1.25; }
.cert-exam-sub { margin: 0 0 .7rem; color: var(--muted); font-size: .92rem; }
.cert-exam-blurb { margin: 0 0 1.1rem; color: var(--text); font-size: .92rem; line-height: 1.5; }
.cert-exam-meta { display: flex; flex-wrap: wrap; gap: .4rem .6rem; }
.cert-exam-meta span {
    font-size: .78rem; font-weight: 600; color: var(--indigo);
    background: #eef0fe; border-radius: 999px; padding: .25rem .6rem;
}
.cert-about { margin-top: 2.5rem; padding: 1.5rem; background: var(--light); border-radius: 14px; }
.cert-about p { margin: .4rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }

/* ---- related footer ------------------------------------------------------ */
.cert-related { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.cert-related-title { margin: .3rem 0 1.1rem; font-size: 1.3rem; color: var(--navy); }
.cert-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.cert-related-card {
    display: flex; flex-direction: column; gap: .25rem; text-decoration: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem;
    transition: border-color .15s ease, transform .15s ease;
}
.cert-related-card:hover { border-color: var(--indigo); transform: translateY(-2px); }
.cert-related-label { font-weight: 650; color: var(--navy); font-size: .95rem; }
.cert-related-note { color: var(--muted); font-size: .82rem; }

/* ---- landing: special sheets --------------------------------------------- */
.cert-specials { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 3rem; }
.cert-special {
    display: block; text-decoration: none; border-radius: 16px; padding: 1.6rem;
    border: 1px solid var(--border); transition: transform .15s ease, box-shadow .15s ease;
}
.cert-special:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(15,23,42,.12); }
.cert-special-master { background: linear-gradient(135deg, #eef0fe, #f6f4ff); border-color: #d8ddfb; }
.cert-special-coverage { background: linear-gradient(135deg, #fef4ec, #fff8f2); border-color: #f3d9c4; }
.cert-special-tag {
    display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: var(--indigo); background: #fff; border-radius: 999px;
    padding: .25rem .6rem; margin-bottom: .8rem;
}
.cert-special-tag-warn { color: #b4530f; }
.cert-special h2 { margin: 0 0 .5rem; font-size: 1.3rem; color: var(--navy); }
.cert-special p { margin: 0 0 1rem; color: var(--text); font-size: .95rem; line-height: 1.55; }
.cert-special-go { font-weight: 650; color: var(--indigo); font-size: .92rem; }
.cert-special-coverage .cert-special-go { color: #b4530f; }

/* ---- landing: skills weight bar ------------------------------------------ */
.cert-skills { margin-bottom: 3rem; }
.cert-weightbar {
    display: flex; height: 34px; border-radius: 10px; overflow: hidden; margin: 1rem 0 1rem;
    border: 1px solid var(--border);
}
.cert-weightseg { min-width: 4px; }
.cert-skills-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.cert-skills-legend li { display: flex; align-items: center; gap: .6rem; font-size: .92rem; }
.cert-swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.cert-skill-area { color: var(--navy); font-weight: 550; }
.cert-skill-weight { margin-left: auto; color: var(--muted); font-weight: 600; font-size: .85rem; }

/* ---- landing: topics ----------------------------------------------------- */
.cert-topics { margin-bottom: 3rem; }
.cert-topic { border-top: 1px solid var(--border); padding: 1.5rem 0; }
.cert-topic-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.cert-topic-num {
    flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
    font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--indigo), var(--violet));
}
.cert-topic-head h3 { margin: 0 0 .2rem; color: var(--navy); font-size: 1.15rem; }
.cert-topic-head p { margin: 0; color: var(--muted); font-size: .92rem; }
.cert-topic-eps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .5rem; }
.cert-topic-eps a {
    display: flex; gap: .6rem; align-items: baseline; text-decoration: none; padding: .6rem .8rem;
    border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
    transition: border-color .15s ease, background .15s ease;
}
.cert-topic-eps a:hover { border-color: var(--indigo); background: #f8f9ff; }
.cert-ep-num { font: 700 .74rem/1 "JetBrains Mono", ui-monospace, monospace; color: var(--violet); flex: none; }
.cert-ep-title { color: var(--navy); font-size: .92rem; }

/* ---- landing: cta bands + podcast ---------------------------------------- */
.cert-cta-band {
    display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
    background: linear-gradient(135deg, var(--navy), #1e293b); color: #fff;
    border-radius: 16px; padding: 1.75rem; margin: 1.5rem 0;
}
.cert-cta-band .sds-eyebrow { color: var(--cyan); }
.cert-cta-band .section-title { color: #fff; margin: .3rem 0; }
.cert-cta-band .section-subtitle { color: #cbd5e1; margin: 0; max-width: 42ch; }
.cert-cta-band .cta-button { flex: none; }
.cert-cta-ghost { background: var(--light); color: var(--navy); }
.cert-cta-ghost .sds-eyebrow { color: var(--indigo); }
.cert-cta-ghost .section-title { color: var(--navy); }
.cert-cta-ghost .section-subtitle { color: var(--muted); }

.cert-podcast { margin: 3rem 0 1.5rem; padding: 1.75rem; background: var(--light); border-radius: 16px; }
.cert-audio { width: 100%; margin: 1rem 0 .75rem; }
.cert-fineprint { color: var(--muted); font-size: .78rem; line-height: 1.5; margin: 0; }

/* ---- field manual index -------------------------------------------------- */
.cert-search {
    width: 100%; max-width: 480px; margin: 1rem 0 1.5rem; padding: .7rem 1rem;
    border: 1px solid var(--border); border-radius: 10px; font-size: 1rem; background: var(--surface);
}
.cert-search:focus { outline: 2px solid var(--indigo); outline-offset: 1px; border-color: var(--indigo); }
.cert-search-count { color: var(--muted); font-size: .88rem; margin: 0 0 1rem; }
.cert-fm-topic { margin: 2rem 0 1rem; font-size: 1.05rem; color: var(--violet); font-weight: 700; }
.cert-sheetgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.cert-sheetgrid-special { margin-bottom: 1rem; }
.cert-sheetcard {
    display: flex; flex-direction: column; text-decoration: none; background: var(--surface);
    border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cert-sheetcard:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(15,23,42,.12); border-color: #c7cff0; }
.cert-sheetcard-special { border-color: #d8ddfb; }
.cert-diagram-thumb { display: block; background: #f6f8fb; border-bottom: 1px solid var(--border); }
.cert-diagram-thumb img { display: block; width: 100%; height: auto; }
.cert-sheetcard-body { padding: .8rem 1rem; display: flex; flex-direction: column; gap: .25rem; }
.cert-sheetcard-title { color: var(--navy); font-weight: 600; font-size: .95rem; line-height: 1.3; }

/* ---- sheet page ---------------------------------------------------------- */
.cert-sheet { max-width: 860px; }
.cert-topic-tag {
    display: inline-block; text-decoration: none; font-size: .8rem; font-weight: 650;
    color: var(--indigo); background: #eef0fe; border-radius: 999px; padding: .3rem .7rem; margin-bottom: .9rem;
}
.cert-topic-tag:hover { background: #e3e6fd; }
.cert-sheet-title { font-size: 2rem; color: var(--navy); line-height: 1.2; margin: 0 0 1.25rem; }
.cert-sheet-title .cert-ep-num { font-size: 1rem; vertical-align: middle; margin-right: .5rem; }
.cert-sheet-lede { font-size: 1.08rem; line-height: 1.7; color: var(--text); margin: 1.5rem 0; }
.cert-recall-head { font-size: 1.2rem; color: var(--navy); margin: 2rem 0 1rem; padding-bottom: .4rem; border-bottom: 2px solid var(--indigo); display: inline-block; }
.cert-recall { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.cert-recall li {
    background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--indigo);
    border-radius: 10px; padding: .8rem 1rem; font-size: .96rem; line-height: 1.55; color: var(--text);
}
.cert-recall li strong { color: var(--navy); }
.cert-recall li code { background: #eef0fe; color: var(--violet); padding: .1rem .35rem; border-radius: 5px; font-size: .88em; }

.cert-asof { background: #fef4ec; border: 1px solid #f3d9c4; color: #8a4a1a; border-radius: 10px; padding: .8rem 1rem; font-size: .9rem; margin: 1rem 0; }
.cert-eyebrow-warn { color: #b4530f !important; }
.cert-gaps { display: grid; gap: 1.25rem; margin: 1.5rem 0; }
.cert-gap { border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1.25rem; background: var(--surface); }
.cert-gap h3 { margin: 0 0 .6rem; color: var(--navy); font-size: 1.02rem; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.cert-gap-weight { font-size: .78rem; color: var(--muted); font-weight: 600; }
.cert-gap ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; }
.cert-gap li { color: var(--text); font-size: .92rem; line-height: 1.45; }
.cert-gap-cta { background: linear-gradient(135deg, var(--navy), #1e293b); color: #fff; border-radius: 14px; padding: 1.5rem; margin-top: 1.5rem; }
.cert-gap-cta p { margin: 0 0 1rem; color: #cbd5e1; }

.cert-lab-link {
    display: flex; align-items: center; gap: 1rem; text-decoration: none;
    background: linear-gradient(135deg, #eef0fe, #f6f4ff); border: 1px solid #d8ddfb;
    border-radius: 12px; padding: 1rem 1.25rem; margin: 1.75rem 0; color: var(--text);
}
.cert-lab-link:hover { border-color: var(--indigo); }
.cert-lab-link-tag { flex: none; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--indigo); }
.cert-lab-link strong { color: var(--navy); }
.cert-lab-link-go { margin-left: auto; font-size: 1.4rem; color: var(--indigo); }

.cert-prevnext { display: flex; gap: 1rem; justify-content: space-between; margin: 2.5rem 0 0; }
.cert-pn { text-decoration: none; border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1.1rem; max-width: 48%; transition: border-color .15s ease; }
.cert-pn:hover { border-color: var(--indigo); }
.cert-pn span { display: block; font-size: .78rem; color: var(--muted); }
.cert-pn strong { color: var(--navy); font-size: .92rem; font-weight: 600; }
.cert-pn-next { text-align: right; margin-left: auto; }

/* ---- diagram figure ------------------------------------------------------ */
.cert-diagram { margin: 1.5rem 0; }
.cert-diagram-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 14px; background: var(--dg-ground, #f6f8fb); padding: 1rem; }
.cert-diagram-scroll svg { display: block; min-width: 900px; width: 100%; height: auto; }
.cert-diagram-scroll img { display: block; min-width: 900px; width: 100%; height: auto; }
.cert-diagram figcaption { margin-top: .6rem; color: var(--muted); font-size: .86rem; line-height: 1.5; }

/* ---- lab index + phase --------------------------------------------------- */
.cert-lab-intro { margin: 1rem 0 2rem; }
.cert-phaselist { list-style: none; margin: 0; padding: 0; counter-reset: none; display: grid; gap: .75rem; }
.cert-phase-main { display: flex; gap: 1rem; align-items: flex-start; text-decoration: none; border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.25rem; background: var(--surface); transition: border-color .15s ease, transform .15s ease; }
.cert-phase-main:hover { border-color: var(--indigo); transform: translateY(-2px); }
.cert-phase-num { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--violet), var(--indigo)); }
.cert-phase-num-lg { width: 54px; height: 54px; font-size: 1.4rem; }
.cert-phase-body h3 { margin: 0 0 .3rem; color: var(--navy); font-size: 1.05rem; }
.cert-phase-covers { margin: 0 0 .4rem; color: var(--muted); font-size: .85rem; }
.cert-phase-new, .cert-phase-reuses { margin: .2rem 0; font-size: .88rem; color: var(--text); line-height: 1.45; }
.cert-phase-new span, .cert-phase-reuses span { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .1rem .45rem; border-radius: 5px; margin-right: .4rem; }
.cert-phase-new span { color: #0e6f62; background: #e2f2ef; }
.cert-phase-reuses span { color: var(--muted); background: var(--light); }
.cert-phase-words { flex: none; margin-left: auto; color: var(--muted); font-size: .76rem; font-weight: 600; }

.cert-labphase { max-width: 860px; }
.cert-phase-header { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.cert-phase-header .section-title { margin: 0; }
.cert-phase-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.25rem 0; }
.cert-phase-meta > div { border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; background: var(--surface); }
.cert-phase-meta span { display: block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--indigo); margin-bottom: .3rem; }
.cert-phase-meta p { margin: 0; color: var(--text); font-size: .9rem; line-height: 1.45; }
.cert-phase-back { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 1.25rem 0; padding: .8rem 1rem; background: var(--light); border-radius: 10px; }
.cert-phase-back > span { font-size: .82rem; color: var(--muted); font-weight: 600; }
.cert-phase-back a { text-decoration: none; font-size: .82rem; color: var(--indigo); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .25rem .7rem; }
.cert-phase-back a:hover { border-color: var(--indigo); }

/* ---- downloads ----------------------------------------------------------- */
.cert-downloads { display: grid; gap: 1rem; margin-top: 1rem; }
.cert-download { display: flex; gap: 1rem; align-items: center; text-decoration: none; border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.25rem; background: var(--surface); transition: border-color .15s ease, transform .15s ease; }
.cert-download:hover { border-color: var(--indigo); transform: translateY(-2px); }
.cert-download-icon { flex: none; width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; font: 800 .8rem/1 "JetBrains Mono", monospace; color: #fff; background: linear-gradient(135deg, var(--indigo), var(--violet)); }
.cert-download h3 { margin: 0 0 .2rem; color: var(--navy); font-size: 1.02rem; }
.cert-download p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.cert-download-size { flex: none; margin-left: auto; color: var(--indigo); font-weight: 700; font-size: .85rem; }

.cert-missing { text-align: center; padding: 3rem 1rem; }
.cert-missing h1 { color: var(--navy); }
.cert-missing p { color: var(--muted); margin-bottom: 1.5rem; }

/* ---- responsive ---------------------------------------------------------- */
@media (max-width: 720px) {
    .cert-specials { grid-template-columns: 1fr; }
    .cert-phase-meta { grid-template-columns: 1fr; }
    .cert-cta-band { flex-direction: column; align-items: flex-start; }
    .cert-pn { max-width: 100%; }
    .cert-sheet-title { font-size: 1.6rem; }
}

/* ============================================================================
   Rendered lab-phase markdown (.cert-md) + the JS enhancer's output.
   ============================================================================ */
.cert-md { color: var(--text); font-size: .98rem; line-height: 1.7; }
.cert-md h2 { color: var(--navy); font-size: 1.4rem; margin: 2.25rem 0 .9rem; padding-bottom: .35rem; border-bottom: 1px solid var(--border); scroll-margin-top: 90px; }
.cert-md h3 { color: var(--navy); font-size: 1.15rem; margin: 1.8rem 0 .7rem; scroll-margin-top: 90px; }
.cert-md h4 { color: var(--navy); font-size: 1rem; margin: 1.4rem 0 .6rem; scroll-margin-top: 90px; }
.cert-md p { margin: .8rem 0; }
.cert-md ul, .cert-md ol { margin: .8rem 0; padding-left: 1.4rem; }
.cert-md li { margin: .35rem 0; }
.cert-md a { color: var(--indigo); text-decoration: none; }
.cert-md a:hover { text-decoration: underline; }
.cert-md strong { color: var(--navy); }
.cert-md :not(pre) > code { background: #eef0fe; color: var(--violet); padding: .1rem .4rem; border-radius: 5px; font-size: .88em; font-family: "JetBrains Mono", ui-monospace, monospace; }

/* code blocks */
.cert-md pre { position: relative; background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 1rem 1.1rem; overflow-x: auto; margin: 1rem 0; font-size: .85rem; line-height: 1.55; }
.cert-md pre code { font-family: "JetBrains Mono", ui-monospace, monospace; background: none; color: inherit; padding: 0; }
.cert-copy { position: absolute; top: .55rem; right: .55rem; font: 600 .72rem/1 system-ui, sans-serif; color: #cbd5e1; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 6px; padding: .3rem .55rem; cursor: pointer; opacity: 0; transition: opacity .15s ease, background .15s ease; }
.cert-md pre:hover .cert-copy, .cert-copy:focus { opacity: 1; }
.cert-copy:hover { background: rgba(255,255,255,.2); }
.cert-copy.copied { color: #4ade80; }

/* GFM tables */
.cert-md table { border-collapse: collapse; width: 100%; margin: 1.1rem 0; font-size: .9rem; display: block; overflow-x: auto; }
.cert-md th, .cert-md td { border: 1px solid var(--border); padding: .5rem .7rem; text-align: left; vertical-align: top; }
.cert-md th { background: var(--light); color: var(--navy); font-weight: 650; }

/* blockquote callouts */
.cert-md blockquote { margin: 1.1rem 0; padding: .8rem 1.1rem; border-left: 4px solid var(--indigo); background: #f8f9ff; border-radius: 0 10px 10px 0; color: var(--text); }
.cert-md blockquote > :first-child { margin-top: 0; }
.cert-md blockquote > :last-child { margin-bottom: 0; }
.cert-md blockquote strong:first-child { color: var(--indigo); }

/* checkpoint / exam-recall headings, flagged by the enhancer */
.cert-md .cert-checkpoint { color: #0e6f62; border-bottom: 2px solid #0e6f62; }
.cert-md .cert-examrecall { color: #b4530f; border-bottom: 2px solid #b4530f; }

/* heading anchor link */
.cert-md .cert-anchor { opacity: 0; margin-left: .4rem; color: var(--muted); text-decoration: none; font-weight: 400; }
.cert-md h2:hover .cert-anchor, .cert-md h3:hover .cert-anchor, .cert-md h4:hover .cert-anchor { opacity: 1; }

/* Python / C# language tabs */
.cert-langtabs { margin: 1rem 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cert-langtabs-bar { display: flex; background: var(--light); border-bottom: 1px solid var(--border); }
.cert-langtab { font: 600 .82rem/1 system-ui, sans-serif; color: var(--muted); background: none; border: none; padding: .6rem 1rem; cursor: pointer; border-bottom: 2px solid transparent; }
.cert-langtab.active { color: var(--navy); border-bottom-color: var(--indigo); }
.cert-langtabs pre { margin: 0; border-radius: 0; }
.cert-langpane[hidden] { display: none; }

@media print {
    .cert-crumbs, .cert-related, .cert-prevnext, .sds-nav, .cert-copy, .cert-langtabs-bar { display: none !important; }
    .cert-md pre { background: #f4f4f4; color: #111; border: 1px solid #ccc; }
    .cert-diagram-scroll { overflow: visible; border: none; }
    .cert-langpane[hidden] { display: block !important; }
}
