/* ============================================================================
   Strategies product page — 2026-09 redesign.

   Loaded only when woocommerce/single-product.php picks page-strategies-product.php
   (see mzpack_is_strategies_product() in inc/helpers.php). Everything here is
   prefixed sp- and nothing overrides a class that product.css already styles:
   the purchase card, the sticky buy bar, the related block and the WooCommerce
   reviews keep their shared styling.

   The switcher behind the prompt demo and "The engine underneath" is not here:
   the front page uses the same mechanic, so its rules live in
   assets/css/mz-showcase.css, which both pages enqueue. Only page-specific
   override of it stays in this file — the focus ring, which covers every
   focusable on the page, not just the switcher.

   Source of truth for the rules below:
   design/prototypes/strategies-page-redesign.html.

   Two deliberate departures from the prototype:

   1. Layout follows the theme — .container is 1200px with 40px padding, not the
      prototype's 1120/24. Multi-column grids collapse at 1000px as the prototype
      does; the hero grid is the exception and collapses at 900px, because it
      holds the shared purchase card whose own "stop being sticky" rule fires at
      900px in product.css, and that file is not ours to override.

   2. **Type is the prototype's, literally** — owner's rule of 2026-09-23, which
      replaced the earlier instruction to round sizes to the theme's six-step
      scale. `node scripts/diff-proto.mjs strategies` compares the two
      mechanically and must print an empty table.
   ============================================================================ */

/* ─── Page scope: the prototype's body and element defaults ───────────────── */

/* Three roots, not one: the hero's own column, the redesigned sections, and the
   Coding Service strip. Deliberately NOT .sp-hero — the purchase card lives in
   its other column and is a shared component that keeps product.css's sizing.
   The stock WooCommerce reviews, the related block and the sticky buy bar sit
   outside every one of these, so they are untouched too.

   :where() keeps the element rules at element specificity, as the prototype
   writes them; against main.css, which styles the same bare tags at the same
   specificity, source order decides, and this file loads after it. */
.sp-hero-col,
.sp-section,
.sp-service {
    font-size: 17px;
    line-height: 1.6;
    color: var(--mz-ink);
}

:where(.sp-hero-col, .sp-section, .sp-service) p {
    margin: 0;
    color: inherit;
    line-height: inherit;
}

:where(.sp-hero-col, .sp-section, .sp-service) h1,
:where(.sp-hero-col, .sp-section, .sp-service) h2,
:where(.sp-hero-col, .sp-section, .sp-service) h3 {
    margin: 0;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--mz-ink);
}

:where(.sp-hero-col, .sp-section, .sp-service) h1 { font-size: 44px; font-weight: 800; }
:where(.sp-hero-col, .sp-section, .sp-service) h2 { font-size: 32px; font-weight: 700; }
:where(.sp-hero-col, .sp-section, .sp-service) h3 { font-size: 20px; font-weight: 600; }

/* Links read in --green-text, not --green: the brand green is a fill colour and
   clears only 2.5:1 as text. Buttons keep the underline offset — the prototype
   sets it on every <a> and only takes the underline away on .btn. */
:where(.sp-hero-col, .sp-section, .sp-service) a {
    color: var(--green-text);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

:where(.sp-hero-col, .sp-section, .sp-service) a:hover {
    text-decoration-thickness: 2px;
}

/* ─── Section shell ───────────────────────────────────────────────────────── */

.sp-section {
    padding: 88px 0;
    border-top: 1px solid var(--border);
}

.sp-section--warm {
    background: var(--bg-warm);
}

.sp-sub {
    font-size: 20px;
    color: var(--text-mid);
    margin-top: 10px;
}

.sp-measure {
    max-width: 68ch;
}

.sp-btn {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    padding: 14px 24px;
    border-radius: 10px;
    border: 0;
    cursor: pointer;
    text-decoration: none;
}

.sp-btn-primary {
    background: var(--green);
    color: #fff;
}

.sp-btn-primary:hover {
    background: #0ea456;
    color: #fff;
}

.sp-btn-secondary {
    background: #fff;
    color: var(--mz-ink);
    border: 1px solid var(--mz-border-strong);
}

.sp-btn-secondary:hover {
    border-color: var(--mz-ink);
    color: var(--mz-ink);
}

/* ─── Hero ────────────────────────────────────────────────────────────────── */

/* The site nav is position:fixed and 73px tall, so the first section has to
   clear it — product.css does the same for .single-product .product, admin bar
   included. The prototype's 40px assumed no fixed header and would tuck the line
   label underneath it. */
.sp-hero {
    padding: calc(100px + var(--mzpack-adminbar-offset, 0px)) 0 64px;
}

/* WooCommerce notices, when there are any, take the clearance instead. */
.wc-notices-wrap + .sp-hero {
    padding-top: 16px;
}

.sp-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 48px;
    align-items: start;
}

.sp-line-label {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 17px;
    font-weight: 600;
    color: var(--mz-line-text);
    padding-left: 14px;
    border-left: 3px solid var(--mz-line);
    line-height: 1.2;
    margin: 0;
}

.sp-hero h1 {
    margin: 20px 0 0;
}

.sp-hero .sp-sub {
    font-size: 24px;
    line-height: 1.35;
    margin-top: 20px;
    max-width: 26ch;
}

.sp-rating {
    margin: 22px 0 0;
    font-size: 17px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sp-stars {
    letter-spacing: 2px;
    color: var(--mz-line);
}

.sp-trust {
    margin: 10px 0 0;
    font-size: 15px;
    color: var(--text-muted);
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}

/* Hero media is managed in Product Tabs → Media. */
.sp-hero-media {
    position: relative;
    margin-top: 36px;
    aspect-ratio: 16 / 9;
    background: var(--dark);
    border-radius: 14px;
    overflow: hidden;
    border: 2px dashed rgba(255, 255, 255, 0.25);
}

.sp-hero-media > video,
.sp-hero-media > iframe,
.sp-hero-media > .sp-hero-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.sp-hero-media > .sp-hero-poster {
    object-fit: contain;
}

.sp-chart {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.sp-chart polyline {
    fill: none;
    stroke: #7ee2a8;
    stroke-width: 2;
    opacity: 0.55;
}

.sp-chart .sp-bars rect {
    fill: var(--green);
    opacity: 0.25;
}

.sp-play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 76px;
    height: 76px;
    margin: -38px 0 0 -38px;
    border-radius: 50%;
    border: 0;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.sp-play span {
    position: absolute;
    left: 31px;
    top: 24px;
    border-style: solid;
    border-width: 14px 0 14px 22px;
    border-color: transparent transparent transparent var(--text);
}

.sp-media-note {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 12px 18px;
    font-size: 14px;
    color: #c8cdd3;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}

/* ─── Purchase card additions ─────────────────────────────────────────────── */

/* The card itself is a shared component and keeps its styling. These two are
   new content the prototype adds, not restyling of what was there. */
.sp-fine {
    margin: 20px 0 0;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* The default 1px UA outline disappears against the card border. The switcher
   itself is styled in mz-showcase.css; this covers every focusable on the page. */
.sp-hero :focus-visible,
.sp-section :focus-visible {
    outline: 3px solid var(--line);
    outline-offset: 3px;
}
/* ─── MZpack AI Skill ─────────────────────────────────────────────────────── */

.sp-gets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

.sp-get {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--line);
    border-radius: 12px;
    padding: 24px 24px 26px;
}

.sp-get strong {
    display: block;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.25;
}

.sp-get p {
    margin: 10px 0 0;
    color: var(--text-mid);
}

.sp-get code {
    display: block;
    margin-top: 14px;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--line-text);
}

.sp-steps-wrap {
    margin-top: 56px;
    background: var(--green-bg);
    border-radius: 16px;
    padding: 36px 32px;
}

.sp-steps-wrap h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--green-text);
    margin: 0;
}

.sp-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 22px;
}

.sp-step {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.sp-step em {
    flex: none;
    font-style: normal;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.sp-actions {
    margin-top: 36px;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.sp-also {
    margin: 0 0 0 8px;
    font-size: 16px;
    color: var(--text-mid);
}

.sp-gh-count {
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 6px;
}

/* ─── Coding Service strip ────────────────────────────────────────────────── */

.sp-service {
    background: var(--dark);
    color: #fff;
    padding: 56px 0;
}

.sp-service .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.sp-service h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.sp-service p {
    margin: 8px 0 0;
    font-size: 16px;
    color: #c8cdd3;
}

/* ─── ML ──────────────────────────────────────────────────────────────────── */

.sp-split {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: 48px;
    align-items: center;
}

.sp-lead {
    font-size: 16px;
    color: var(--text-mid);
    margin-top: 18px;
}

/* position:relative is load-bearing: the YouTube facade from product.css is
   `position: absolute; inset: 0` and needs a positioned ancestor. Without it the
   facade escapes and covers the whole viewport. */
.sp-video {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--dark);
    border-radius: 12px;
    overflow: hidden;
}

.sp-video iframe,
.sp-video > * {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Engine media: complete screenshots and transparent illustration corners. */
#engine .product-gallery-wrap,
#engine .sp-engine-screenshot {
    margin: 0;
}

#engine .sp-shot--engine-img {
    padding: 0;
    border: 0;
    background: transparent;
}

#engine .sp-shot--engine-img img {
    display: block;
    object-fit: contain;
    border-radius: 0;
}

/* ─── Two strategies ──────────────────────────────────────────────────────── */

.sp-strats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 44px;
}

.sp-strat {
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
}

.sp-strat .sp-video {
    border-radius: 0;
}

.sp-strat-body {
    padding: 20px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.sp-strat h3 {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.sp-strat p {
    margin: 0;
    font-size: 16px;
}

.sp-signals {
    color: var(--text-mid);
}

.sp-signals b {
    color: var(--text);
    font-weight: 600;
}

.sp-more {
    margin-top: auto !important;
    padding-top: 6px;
}

.sp-note {
    margin-top: 32px;
    color: var(--text-mid);
}

/* ─── In the box ──────────────────────────────────────────────────────────── */

.sp-box {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: 48px 64px;
    margin-top: 40px;
}

.sp-box h3 {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 16px;
}

.sp-check {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.sp-check li {
    position: relative;
    padding-left: 28px;
    font-size: 16px;
    line-height: 1.6;
}

.sp-check li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 14px;
    height: 8px;
    border-left: 2.5px solid var(--green);
    border-bottom: 2.5px solid var(--green);
    transform: rotate(-45deg);
}

.sp-check b {
    font-weight: 600;
}

.sp-req {
    display: grid;
    gap: 22px;
    color: var(--text-mid);
    font-size: 16px;
}

.sp-req p {
    margin: 0;
    line-height: 1.6;
}

.sp-req b {
    color: var(--text);
    font-weight: 600;
}

/* ─── Reviews ─────────────────────────────────────────────────────────────── */

.sp-rv-head {
    display: flex;
    align-items: baseline;
    gap: 18px;
    flex-wrap: wrap;
}

.sp-score {
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
}

.sp-rv-head .sp-stars {
    font-size: 24px;
}

.sp-dim {
    color: var(--text-muted);
    font-size: 16px;
}

.sp-quotes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-top: 40px;
}

.sp-quote {
    margin: 0;
}

.sp-quote p {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
}

/* <footer> is the right element for a quote attribution, but main.css styles the
   bare tag for the site footer — warm background, 60px of padding and a border.
   Reset those three here rather than reach for a div. */
.sp-quote footer {
    margin: 14px 0 0;
    padding: 0;
    background: none;
    border-top: 0;
    color: var(--text-muted);
    font-size: 15px;
}

.sp-rv-more {
    margin-top: 32px;
    font-size: 16px;
}

/* ─── FAQ ─────────────────────────────────────────────────────────────────── */

.sp-faq {
    max-width: 760px;
    margin-top: 32px;
}

.sp-faq details {
    border-top: 1px solid var(--border);
}

.sp-faq details:last-child {
    border-bottom: 1px solid var(--border);
}

.sp-faq summary {
    cursor: pointer;
    list-style: none;
    padding: 20px 0;
    font-size: 19px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.sp-faq summary::-webkit-details-marker {
    display: none;
}

.sp-faq summary::after {
    content: "+";
    font-weight: 400;
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
}

.sp-faq details[open] summary::after {
    content: "\2013";
}

.sp-faq details p {
    margin: 0;
    padding: 0 0 22px;
    color: var(--text-mid);
    max-width: 66ch;
}

/* ─── Which one ───────────────────────────────────────────────────────────── */

.sp-cmp-wrap {
    margin-top: 36px;
    overflow-x: auto;
}

.sp-cmp {
    width: 100%;
    border-collapse: collapse;
    font-size: 17px;
}

.sp-cmp th,
.sp-cmp td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.sp-cmp thead th {
    font-size: 19px;
    font-weight: 600;
    border-bottom: 2px solid var(--mz-ink);
}

/* The tick and the dash are drawn glyphs with a screen-reader label beside
   them, but the prototype still colours the cell: green for yes, muted and
   regular weight for no. */
.sp-cmp .sp-yes {
    color: var(--green-text);
}

.sp-cmp .sp-no {
    color: var(--text-muted);
    font-weight: 400;
}

.sp-cmp thead th span {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--line-text);
}

.sp-cmp tbody th {
    font-weight: 500;
    color: var(--text-mid);
    width: 44%;
}

.sp-cmp td {
    font-weight: 600;
    position: relative;
}

.sp-cmp .sp-this {
    background: var(--green-bg);
}

.sp-cmp tbody tr:last-child td {
    font-size: 19px;
}

.sp-ic-yes {
    display: inline-block;
    width: 16px;
    height: 9px;
    border-left: 3px solid var(--green);
    border-bottom: 3px solid var(--green);
    transform: rotate(-45deg);
    margin-bottom: 5px;
}

.sp-ic-no {
    display: inline-block;
    width: 14px;
    height: 3px;
    background: var(--border);
    vertical-align: middle;
}

/* Screen-reader text for the tick and dash glyphs. */
.sp-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

#which-one .sp-note {
    margin-top: 22px;
}

/* ─── Breakpoints ─────────────────────────────────────────────────────────── */

/* The hero follows the purchase card's own breakpoint, see the header note. */
@media (max-width: 900px) {
    .sp-hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 1000px) {
    .sp-split,
    .sp-strats,
    .sp-box,
    .sp-quotes {
        grid-template-columns: 1fr;
    }

    .sp-gets,
    .sp-steps {
        grid-template-columns: 1fr 1fr;
    }

    .sp-cmp {
        min-width: 640px;
    }
}

/* The prototype's phone block. Its 600px, not the theme's 768px: the sizes
   below are the prototype's and they change where it says they change. */
@media (max-width: 600px) {
    .sp-hero-col,
    .sp-section,
    .sp-service {
        font-size: 16px;
    }

    :where(.sp-hero-col, .sp-section, .sp-service) h1 { font-size: 32px; }
    :where(.sp-hero-col, .sp-section, .sp-service) h2 { font-size: 26px; }

    .sp-hero .sp-sub {
        font-size: 20px;
        max-width: none;
    }

    .sp-section {
        padding: 64px 0;
    }

    .sp-gets,
    .sp-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sp-steps-wrap {
        padding: 28px 20px;
    }
}

/* ─── Stock WooCommerce reviews ───────────────────────────────────────────── */

/* The collapsed "All N reviews" block at the bottom of the page — where the
   link in the reviews section lands.

   WooCommerce ships its own furniture here: a bordered box per review, a
   viewport-scaled heading, 13px meta, and a star rating that inherits the body
   colour. None of it belongs on this page. Everything below rebuilds the list
   to read like the three quotes above it — no frames, text at 17, attribution
   at 15 muted, the same 32px between entries and 14px under the text — scoped
   to .sp-all-reviews so no other product page moves.

   One thing is deliberately left alone: the width of the star glyphs.
   WooCommerce sizes those in em and draws the filled portion with a percentage
   width, so changing font-size there changes how much of the rating shows.
   Only the colour is ours. */

.sp-all-reviews {
    margin: 48px 0;
    font-size: 17px;
    line-height: 1.6;
    color: var(--mz-ink);
}

.sp-all-reviews > summary {
    cursor: pointer;
    font-size: 19px;
    font-weight: 700;
    color: var(--mz-ink);
    padding: 14px 0;
}

.sp-all-reviews .woocommerce-Reviews-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--mz-ink);
    margin: 0 0 24px;
}

/* ── The list ─────────────────────────────────────────────────────────────── */

.sp-all-reviews .commentlist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 32px;
}

.sp-all-reviews .commentlist > li {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    list-style: none;
}

.sp-all-reviews .comment_container {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

.sp-all-reviews #reviews #comments ol.commentlist li img.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex: none;
    margin: 0;
    padding: 0;
    border: 0;
    position: static;
}

/* WooCommerce's own box: a 1px border, 4px radius, 1em of padding and a 50px
   indent that made room for the avatar it also floats. The flex row above does
   that job now.

   The selector is long on purpose. WooCommerce writes this rule as
   `#reviews #comments ol.commentlist li .comment-text`, two ids deep; a plain
   `.sp-all-reviews .comment-text` loses to it and the frame stays. Repeating
   its shape and adding the scope class wins by one class, with no !important. */
.sp-all-reviews #reviews #comments ol.commentlist li .comment-text {
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: 0;
    background: none;
    padding: 0;
    margin: 0;
    min-width: 0;
    flex: 1;
}

/* DOM order is stars, attribution, text. The quotes above read text first and
   sign off underneath, so the three are reordered visually to match. Assistive
   technology still follows the DOM, which reads the rating and the name before
   the words — no worse an order to hear. */
.sp-all-reviews #reviews #comments ol.commentlist li .star-rating {
    order: 1;
    color: var(--mz-line);
    margin: 0 0 10px;
}

.sp-all-reviews .description {
    order: 2;
}

.sp-all-reviews #reviews #comments ol.commentlist li .comment-text p.meta {
    order: 3;
    margin: 14px 0 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-muted);
}

.sp-all-reviews #reviews #comments ol.commentlist li .description p {
    margin: 0;
    font-size: 17px;
    line-height: 1.5;
    color: var(--mz-ink);
}

.sp-all-reviews .description p + p {
    margin-top: 10px;
}

.sp-all-reviews .woocommerce-review__author {
    font-weight: 600;
    color: inherit;
}

.sp-all-reviews .woocommerce-review__dash,
.sp-all-reviews .woocommerce-review__published-date {
    color: inherit;
}

/* ── The form and the empty state ─────────────────────────────────────────── */

.sp-all-reviews #review_form_wrapper {
    margin-top: 40px;
}

.sp-all-reviews .comment-reply-title {
    font-size: 19px;
    font-weight: 600;
    color: var(--mz-ink);
}

.sp-all-reviews .woocommerce-noreviews,
.sp-all-reviews .must-log-in,
.sp-all-reviews .comment-notes,
.sp-all-reviews .comment-form-comment label,
.sp-all-reviews .comment-form-rating label {
    font-size: 17px;
    line-height: 1.6;
    color: var(--mz-ink);
}

/* WooCommerce links here default to --green, which is a fill colour: 2.52:1 as
   text. --green-text is the same brand green tuned for reading. */
.sp-all-reviews .comment-text a,
.sp-all-reviews .must-log-in a,
.sp-all-reviews .comment-notes a {
    color: var(--green-text);
}
