/* ============================================================================
 * /certificates marketing page.
 *
 * Loaded automatically by the landing-light theme because the filename matches
 * the CMS page URL (see viewmodels/cms/cmspage_viewmodel._find_page_css), which
 * also guarantees it lands AFTER landing-cms-page-light-bulma.css. Several rules
 * below win on cascade order rather than specificity, so that ordering matters.
 *
 * Everything is scoped to .cert-page, which sits on each top-level <section>.
 * An unscoped rule here does not stay here: the landing-light theme is shared by
 * every CMS landing page, so a bare `p { }` would land on all of them. There is
 * a test for this in tests/test_certificates_page.py.
 *
 * The scope class is .cert-page and not .certificates because home-redesign.css
 * already owns a .certificates-section / .certificates-list family for the
 * homepage's certificate block. Those are different class names and would not
 * actually collide, but two similarly-named families on the same subject is how
 * an edit lands in the wrong file six months from now.
 *
 * TOKENS
 * This page uses --tp-* from b2b-tokens.css directly. team-trial.css carries a
 * --tt-* alias layer only because it predates the extraction; new pages skip it.
 * Adding a token means adding it to b2b-tokens.css, not here.
 *
 * The page is not a B2B page, but it consumes the same tokens, so the two
 * invariants that matter travel with it: every var() must resolve, and the
 * tokens must never arrive via @import. See the header of b2b-tokens.css for
 * why the second one is not a style preference.
 * ========================================================================= */

.cert-page {
    color: var(--tp-ink);
    font-family: var(--tp-font-sans);
    font-size: var(--tp-fs-body);
    line-height: var(--tp-lh-body);
}

/* --------------------------------------- UNDO INHERITED CMS/BULMA DEFAULTS */

/* landing-cms-page-base-bulma.css caps every p/h/ul at 900px and auto-centres
   it, which silently misaligns any grid built inside .landing-cms. */
.cert-page h1,
.cert-page h2,
.cert-page h3,
.cert-page h4,
.cert-page p,
.cert-page ul,
.cert-page ol {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.cert-page p {
    font-size: var(--tp-fs-body);
    line-height: var(--tp-lh-body);
    margin: 0 0 1rem;
}

.cert-page ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cert-page li {
    margin: 0;
}

.cert-page h1,
.cert-page h2,
.cert-page h3 {
    font-family: var(--tp-font-serif);
    font-weight: 700;
    color: var(--tp-ink);
    letter-spacing: -0.01em;
    margin-bottom: 0;
}

/* site-bulma.css:397 gives every Font Awesome icon .85em and .5em of side
   margin, which breaks every badge and list row on this page. */
.cert-page i[class*='fa-'] {
    margin: 0;
    font-size: inherit;
    line-height: 1;
}

/* ------------------------------------------------------------------ LAYOUT */

.cert-page.cert-section {
    padding: var(--tp-section-y) 0;
}

.cert-page.cert-section--tight {
    padding: var(--tp-section-y-tight) 0;
}

.cert-page.cert-section--tint {
    background: var(--tp-surface);
}

.cert-page .cert-wrap {
    max-width: var(--tp-wrap);
    margin: 0 auto;
    padding: 0 var(--tp-gutter);
}

/* The privacy list and the FAQ are read straight down rather than scanned, so
   they get the narrow column. */
.cert-page .cert-wrap--narrow {
    max-width: var(--tp-wrap-narrow);
}

.cert-page .cert-head {
    max-width: 640px;
    margin: 0 0 var(--tp-head-gap);
}

.cert-page .cert-head--center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.cert-page .cert-h2 {
    font-size: var(--tp-fs-h2);
    line-height: var(--tp-lh-tight);
    margin: 0 0 0.75rem;
}

/* The certificate image is what the page is selling, so its heading is the one
   oversized head. Exactly one per page; a second cancels the first. */
.cert-page .cert-h2--lead {
    font-size: var(--tp-fs-h2-lead);
}

.cert-page .cert-lede {
    font-size: var(--tp-fs-body-lg);
    line-height: 1.6;
    color: var(--tp-ink-2);
    max-width: var(--tp-measure);
    margin: 0;
}

/* -------------------------------------------------------------------- HERO */

.cert-page.cert-hero {
    padding: 3rem 0 4rem;
    text-align: center;
}

.cert-page .cert-hero-inner {
    max-width: 780px;
    margin: 0 auto;
    padding: 0 var(--tp-gutter);
}

.cert-page .cert-eyebrow {
    display: inline-block;
    background: var(--tp-yellow);
    color: #000;
    font-size: var(--tp-fs-micro);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: var(--tp-r-sm);
    margin-bottom: 1.25rem;
}

.cert-page.cert-hero h1 {
    font-size: var(--tp-fs-h1);
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0 0 1rem;
    text-align: center;
}

.cert-page .cert-hero-sub {
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--tp-ink-2);
    max-width: var(--tp-measure);
    margin: 0 auto 2rem;
}

/* Fact row. Equal-weight items in a row have no grouping cue other than a rule,
   which is the one place on this page a border is the right tool. */
.cert-page .cert-facts {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0 0 2.5rem;
}

.cert-page .cert-fact {
    padding: 0 1.75rem;
    text-align: center;
}

.cert-page .cert-fact + .cert-fact {
    border-left: 1px solid var(--tp-line);
}

.cert-page .cert-fact-n {
    display: block;
    font-family: var(--tp-font-serif);
    font-size: var(--tp-fs-h2);
    font-weight: 700;
    line-height: 1.1;
    color: var(--tp-ink);
}

.cert-page .cert-fact-l {
    display: block;
    margin-top: 0.25rem;
    font-size: var(--tp-fs-micro);
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--tp-ink-3);
}

.cert-page .cert-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.cert-page .cert-cta--center {
    justify-content: center;
}

/* Bound tightly to the buttons, because it is a footnote ON them. */
.cert-page .cert-cta-note {
    margin: 0.75rem auto 0;
    max-width: var(--tp-measure);
    font-size: var(--tp-fs-fine);
    color: var(--tp-ink-3);
}

/* Prose links carry an underline, not just colour. #337ab7 against --tp-ink-2
   body copy is 1.78:1, and WCAG G183 wants 3:1 where colour is the only cue.
   Scoped to prose: .cert-btn links live in divs, and course cards are grid
   children. */
.cert-page p a:not(.cert-btn) {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    text-decoration-color: hsl(207, 56%, 72%);
}

.cert-page p a:not(.cert-btn):hover {
    text-decoration-color: currentColor;
}

.cert-page .cert-checks li a {
    font-weight: 600;
}

/* ----------------------------------------------------------------- BUTTONS */
/* Deliberately not Bulma's .button, which drags in site-bulma's dark colours,
   its own height, and `.button i { margin-left: .5em !important }`. */

.cert-page .cert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    font-family: inherit;
    text-decoration: none;
    border-radius: var(--tp-r);
    cursor: pointer;
    white-space: nowrap;
    transition:
        background-color var(--tp-transition),
        border-color var(--tp-transition),
        box-shadow var(--tp-transition),
        transform var(--tp-transition),
        color var(--tp-transition);
}

.cert-page .cert-btn i {
    margin: 0 !important; /* beats .button i in site-bulma.css:277 */
    font-size: 1em;
}

.cert-page .cert-btn:focus-visible {
    outline: var(--tp-focus-ring);
    outline-offset: var(--tp-focus-offset);
}

/* PRIMARY. Selling a course is the page's job, so this is the only saturated
   block of colour above the fold. */
.cert-page a.cert-btn-primary {
    background: var(--tp-blue-dark);
    /* !important beats .landing-cms a:not(.button):not(.btn) { color: #337ab7 }
       at (0,3,1) in the light theme. */
    color: #fff !important;
    border: 2px solid var(--tp-blue-dark);
    font-size: 19px;
    font-weight: 700;
    padding: 0 2rem;
    min-height: 60px;
    box-shadow: var(--tp-sh-cta);
}

.cert-page a.cert-btn-primary:hover {
    background: var(--tp-blue-darker);
    border-color: var(--tp-blue-darker);
    transform: translateY(-1px);
    box-shadow: var(--tp-sh-cta-h);
}

.cert-page a.cert-btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--tp-sh-sm);
}

/* SECONDARY. Text contrast is left at full strength on purpose: lightening the
   label is exactly how disabled controls are drawn. It loses on fill and
   elevation instead, which is where most of the perceived weight lives. */
.cert-page a.cert-btn-secondary {
    background: var(--tp-surface-0);
    color: var(--tp-ink) !important; /* same override target as above */
    border: 2px solid var(--tp-border-ui);
    font-size: var(--tp-fs-body);
    font-weight: 600;
    padding: 0 1.5rem;
    min-height: 56px;
    box-shadow: none;
}

.cert-page a.cert-btn-secondary:hover {
    background: var(--tp-blue-tint);
    border-color: var(--tp-blue);
    color: var(--tp-blue-darker) !important;
}

/* ------------------------------------------------------- THE CERTIFICATE */

/* Stacked, not side by side. The same mistake /team-trial made with its
   dashboard screenshot applies here with more force: this image is a document,
   and a document rendered at half width is a picture of a document. It runs the
   full width of the wrap, with the list underneath in two columns. */
.cert-page .cert-shot {
    display: block;
}

.cert-page .cert-shot-head {
    max-width: 640px;
    margin: 0 0 2rem;
}

.cert-page .cert-shot-head p {
    font-size: 1.0625rem;
    color: var(--tp-ink-2);
    max-width: var(--tp-measure-narrow);
    margin: 0;
}

.cert-page .cert-shot-media {
    margin: 0 0 2.5rem;
}

/* No aspect-ratio and no object-fit, unlike the /team-trial screenshot. The
   intrinsic 1600x1236 IS the shape of a US Letter landscape page, so forcing a
   ratio here could only crop the document. The width/height attributes on the
   <img> reserve the right box before the file lands. */
.cert-page .cert-shot-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--tp-r);
    border: 1px solid var(--tp-line-strong);
    box-shadow: var(--tp-sh-lg);
    background: var(--tp-surface-0);
}

.cert-page .cert-shot-cap {
    margin: 0.875rem 0 0;
    font-size: var(--tp-fs-fine);
    line-height: 1.5;
    color: var(--tp-ink-3);
}

/* ------------------------------------------------------------ CHECK LISTS */

.cert-page .cert-checks {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.cert-page .cert-checks li {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    font-size: var(--tp-fs-body);
    line-height: 1.55;
    color: var(--tp-ink-2);
}

.cert-page .cert-checks li i {
    flex: 0 0 20px;
    width: 20px;
    text-align: center;
    color: var(--tp-blue);
    font-size: var(--tp-fs-body);
    margin-top: 3px;
}

/* Beats .landing-cms strong:not(a):not(a *) { color: black } at (0,3,1). */
.cert-page .cert-checks li strong {
    color: var(--tp-ink) !important;
    font-weight: 600;
}

/* Must come AFTER .cert-checks: same specificity, so display:grid only beats
   its display:flex on source order. */
.cert-page .cert-shot-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 3rem;
    row-gap: 1rem;
}

/* The privacy list stays one column at every width. Each row is a full sentence
   about what we do and do not publish, and two columns of that invites skimming
   the half that sounds reassuring. */
.cert-page .cert-privacy {
    gap: 1.25rem;
}

/* ------------------------------------------------------------------- STEPS */

.cert-page .cert-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
}

.cert-page .cert-step {
    position: relative;
}

/* Numbers, not icons: an icon cannot express sequence, and Font Awesome is
   loaded async here so icons arrive late. */
.cert-page .cert-step-n {
    position: relative;
    z-index: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tp-blue-tint);
    color: var(--tp-blue-darker);
    font-size: var(--tp-fs-body);
    font-weight: 700;
    margin-bottom: 1rem;
}

.cert-page .cert-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 21px;
    left: 52px;
    right: -2rem;
    height: 2px;
    background: var(--tp-line);
}

.cert-page .cert-step h3 {
    font-family: var(--tp-font-sans);
    font-size: var(--tp-fs-h3);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0;
    margin: 0 0 0.375rem;
}

.cert-page .cert-step p {
    font-size: var(--tp-fs-ui);
    line-height: 1.6;
    color: var(--tp-ink-2);
    margin: 0;
}

/* -------------------------------------------------------------------- USES */

.cert-page .cert-uses {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--tp-gutter);
}

.cert-page .cert-use {
    background: var(--tp-surface-0);
    border: 1px solid var(--tp-line);
    border-radius: var(--tp-r);
    box-shadow: var(--tp-sh-sm);
    padding: 2rem;
}

.cert-page .cert-use-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--tp-r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tp-blue-tint);
    color: var(--tp-blue-darker);
    font-size: 20px;
    margin-bottom: 1.25rem;
}

.cert-page .cert-use h3 {
    font-family: var(--tp-font-sans);
    font-size: var(--tp-fs-h3);
    font-weight: 600;
    letter-spacing: 0;
    margin: 0 0 0.625rem;
}

.cert-page .cert-use p {
    color: var(--tp-ink-2);
    margin: 0 0 0.875rem;
}

/* Secondary detail inside the card, not a caption on it: one step down in size
   and colour, and it keeps the card's measure rather than being centred. */
.cert-page .cert-use-note {
    font-size: var(--tp-fs-small);
    line-height: var(--tp-lh-snug);
    color: var(--tp-ink-3);
    margin: 0;
}

/* ------------------------------------------------------------------ COURSES */

/* $COURSE_CARDS$ renders cms/partials/course-cards.pt, and that partial ships NO
   stylesheet of its own -- every rule for it lives in the consuming page's file,
   scoped to that page. Drop these and the cards render as three full-width
   stacked images with `3.9 hoursintermediate` run together underneath, which is
   exactly what happened the first time this page was previewed. The rules are
   carried over from team-trial.css rather than reinvented, so the two pages
   present the same catalog the same way. */
.cert-page .cms-course-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}

/* No card chrome. The course images are already saturated and loud; wrapping
   them in bordered boxes would create competing rectangles. */
.cert-page a.cms-course-card {
    display: block;
    text-decoration: none;
    color: var(--tp-ink) !important; /* beats the CMS link-blue rule */
}

.cert-page .cms-course-card-image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--tp-r);
    box-shadow: var(--tp-sh-sm);
    background: var(--tp-surface-2);
    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.cert-page a.cms-course-card:hover .cms-course-card-image {
    box-shadow: var(--tp-sh-md);
    transform: translateY(-2px);
}

.cert-page .cms-course-card-title {
    font-family: var(--tp-font-sans);
    font-size: var(--tp-fs-body);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0;
    margin: 0.875rem 0 0.25rem;
    color: var(--tp-ink);
}

.cert-page a.cms-course-card:hover .cms-course-card-title {
    color: var(--tp-blue-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cert-page .cms-course-card-meta {
    margin: 0;
    font-size: var(--tp-fs-fine);
    color: var(--tp-ink-3);
    text-transform: capitalize;
}

/* The partial emits two bare <span>s with no separator between them. */
.cert-page .cms-course-card-meta span + span::before {
    content: ' \00b7\00a0';
}

.cert-page .cert-courses-note {
    margin: 2.5rem 0 0;
    font-size: var(--tp-fs-small);
    color: var(--tp-ink-3);
}

/* --------------------------------------------------------------------- FAQ */

.cert-page .cert-faq {
    max-width: var(--tp-wrap-narrow);
}

.cert-page .cert-faq-item {
    border-top: 1px solid var(--tp-line);
}

.cert-page .cert-faq-item:last-child {
    border-bottom: 1px solid var(--tp-line);
}

.cert-page .cert-faq-item > summary {
    list-style: none;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 0;
    font-size: var(--tp-fs-body-lg);
    font-weight: 600;
    line-height: 1.45;
    color: var(--tp-ink);
    cursor: pointer;
}

.cert-page .cert-faq-item > summary::-webkit-details-marker {
    display: none;
}

.cert-page .cert-faq-item > summary:hover,
.cert-page .cert-faq-item[open] > summary {
    color: var(--tp-blue-dark);
}

/* Browsers give <summary> almost no focus indication of their own. */
.cert-page .cert-faq-item > summary:focus-visible {
    outline: var(--tp-focus-ring);
    outline-offset: 2px;
    border-radius: var(--tp-r-sm);
}

/* Drawn in CSS so the FAQ does not depend on the async icon font. */
.cert-page .cert-faq-item > summary::after {
    content: '';
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    margin-top: 0.5em;
    border-right: 2px solid var(--tp-ink-3);
    border-bottom: 2px solid var(--tp-ink-3);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.cert-page .cert-faq-item[open] > summary::after {
    transform: rotate(-135deg);
    margin-top: 0.8em;
}

.cert-page .cert-faq-answer {
    padding: 0 0 1.5rem;
    max-width: var(--tp-measure-wide);
}

.cert-page .cert-faq-answer p {
    line-height: var(--tp-lh-relaxed);
    color: var(--tp-ink-2);
    margin: 0 0 0.75rem;
}

.cert-page .cert-faq-answer p:last-child {
    margin-bottom: 0;
}

/* -------------------------------------------------------------- FINAL BAND */

.cert-page.cert-final {
    padding: 0 0 var(--tp-section-y);
}

.cert-page .cert-final-card {
    background: var(--tp-surface-2);
    border: 1px solid var(--tp-line);
    border-radius: var(--tp-r);
    padding: 3rem 2rem;
    text-align: center;
}

.cert-page .cert-final-card h2 {
    font-size: var(--tp-fs-h2);
    line-height: var(--tp-lh-tight);
    margin: 0 0 0.75rem;
}

.cert-page .cert-final-card p {
    color: var(--tp-ink-2);
    max-width: var(--tp-measure);
    margin: 0 auto 2rem;
}

/* ----------------------------------------------------------- BREAKPOINTS */

/* Two columns is one too many for the check list once the column is under
   roughly 460px each, which is where a laptop half-screen lands. */
@media screen and (max-width: 900px) {
    .cert-page .cert-shot-list {
        grid-template-columns: 1fr;
        column-gap: 0;
    }

    .cert-page .cert-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem 1.5rem;
    }

    /* The connector implies a single left-to-right sequence; in a 2x2 grid it
       would draw a line from step 2 to step 3 across a row break. */
    .cert-page .cert-step:not(:last-child)::after {
        display: none;
    }

    .cert-page .cert-uses {
        grid-template-columns: 1fr;
    }
}

/* Three 16:9 images across stop being legible well before the phone breakpoint,
   so the cards flip to a horizontal row-per-course of their own accord. */
@media screen and (max-width: 760px) {
    .cert-page .cms-course-cards {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .cert-page a.cms-course-card {
        display: grid;
        grid-template-columns: 140px minmax(0, 1fr);
        column-gap: 1rem;
        align-items: center;
    }

    .cert-page .cms-course-card-title {
        margin: 0 0 0.25rem;
    }
}

@media screen and (max-width: 720px) {
    .cert-page.cert-hero {
        padding: 2rem 0 3rem;
    }

    .cert-page .cert-wrap,
    .cert-page .cert-hero-inner {
        padding: 0 var(--tp-gutter);
    }

    .cert-page .cert-head {
        margin-bottom: var(--tp-head-gap);
    }

    .cert-page .cert-h2,
    .cert-page .cert-h2--lead,
    .cert-page .cert-final-card h2 {
        font-size: 1.625rem;
    }

    .cert-page.cert-hero h1 {
        font-size: 2rem;
    }

    .cert-page .cert-hero-sub {
        font-size: 1.0625rem;
    }

    /* 2x2 rather than a four-item scroll. The vertical rule between items only
       makes sense within a row, so it is redrawn per column. */
    .cert-page .cert-facts {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 0;
        margin-bottom: 2rem;
    }

    .cert-page .cert-fact {
        padding: 0 0.75rem;
    }

    .cert-page .cert-fact + .cert-fact {
        border-left: none;
    }

    .cert-page .cert-fact:nth-child(even) {
        border-left: 1px solid var(--tp-line);
    }

    .cert-page .cert-fact-n {
        font-size: 1.625rem;
    }

    /* Full-bleed to the screen edges. At 390px, 20px of gutter each side is 10%
       of the width the document has to work with, and this image is the page. */
    .cert-page .cert-shot-media {
        margin-left: calc(var(--tp-gutter) * -1);
        margin-right: calc(var(--tp-gutter) * -1);
    }

    .cert-page .cert-shot-img {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* The caption keeps its gutter; only the image goes full width. */
    .cert-page .cert-shot-cap {
        padding: 0 var(--tp-gutter);
    }

    .cert-page .cert-steps {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .cert-page .cert-use {
        padding: 1.5rem;
    }

    .cert-page .cert-faq-item > summary {
        font-size: var(--tp-fs-body);
    }

    .cert-page .cert-final-card {
        padding: 2rem 1.25rem;
    }

    /* Stacked CTAs go full width. Two 60px buttons side by side on a 350px
       screen wrap into a ragged pair with different widths. */
    .cert-page .cert-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .cert-page .cert-btn {
        width: 100%;
        white-space: normal;
        text-align: center;
    }
}

/* The 140px image column is a third of a 390px screen. */
@media screen and (max-width: 560px) {
    .cert-page a.cms-course-card {
        grid-template-columns: 110px minmax(0, 1fr);
    }
}

/* The card lift and the button nudge are decoration, not feedback. */
@media (prefers-reduced-motion: reduce) {
    .cert-page .cert-btn,
    .cert-page .cms-course-card-image,
    .cert-page .cert-faq-item > summary::after {
        transition: none;
    }

    .cert-page a.cert-btn-primary:hover,
    .cert-page a.cms-course-card:hover .cms-course-card-image {
        transform: none;
    }
}
