/**
 * Custom Mobile Carts: Semi-Custom page
 *
 * The four step strip, the three starting point cards, the panel style
 * tiles with their drawn swatches, the finish list, the stain chips, the
 * add-on table, the permitting note and the closing band. Cards, chips,
 * badges, buttons and the section header come from style.css. The steps
 * and the closing band repeat the Custom Builds and Start Here patterns
 * under their own names, because those bundles are not loaded here.
 * Phone first, breakpoints at 768px and 1024px.
 *
 * @package CustomMobileCarts
 */

/* ==========================================================================
   Editor content under the hero
   ========================================================================== */

.sc-content {
    padding-bottom: 0;
}

.sc-prose {
    max-width: 46rem;
}

.sc-prose > :first-child {
    margin-top: 0;
}

/* ==========================================================================
   How it works: four compact steps
   ========================================================================== */

.sc-steps {
    display: grid;
    gap: var(--spacing-lg);
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .sc-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--spacing-xl);
    }
}

@media (min-width: 1024px) {
    .sc-steps {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.sc-step {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr);
    grid-template-areas:
        "marker title"
        "marker text";
    column-gap: var(--spacing-md);
    row-gap: 0.25rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .sc-step {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "marker"
            "title"
            "text";
        row-gap: 0.5rem;
        padding-top: var(--spacing-lg);
        border-top: 2px solid var(--color-border);
    }
}

.sc-step__marker {
    grid-area: marker;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
    color: var(--color-text-white);
    background-color: var(--color-primary);
    border-radius: var(--radius-full);
}

.sc-step__title {
    grid-area: title;
    margin: 0;
    padding-top: 0.5rem;
    font-size: var(--font-size-xl);
    letter-spacing: -0.01em;
}

@media (min-width: 1024px) {
    .sc-step__title {
        padding-top: 0;
    }
}

.sc-step__text {
    grid-area: text;
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.55;
    color: var(--color-text-light);
}

/* ==========================================================================
   Three starting points
   ========================================================================== */

.sc-type-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-lg);
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .sc-type-grid {
        gap: var(--spacing-xl);
    }
}

@media (min-width: 1024px) {
    .sc-type-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
    }
}

.sc-type {
    height: 100%;
}

/* Details with a button inside, not a link card: it stays still */
@media (hover: hover) {
    .sc-type:hover {
        transform: none;
        box-shadow: var(--shadow-xs);
    }
}

.sc-type__title {
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-2xl);
}

.sc-type__summary {
    margin-bottom: var(--spacing-lg);
    color: var(--color-text-light);
}

.sc-type__facts {
    margin-bottom: var(--spacing-lg);
    border-top: 1px solid var(--color-border-light);
}

.sc-type__fact {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    column-gap: var(--spacing-md);
    padding-block: 0.625rem;
    border-bottom: 1px solid var(--color-border-light);
}

.sc-type__fact dt {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1.5;
    color: var(--color-text-muted);
}

.sc-type__fact dd {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--color-text);
}

/* The button sits on the card's bottom edge whatever the text length */
.sc-type > .sc-type__btn {
    align-self: stretch;
    margin-top: auto;
}

/* ==========================================================================
   Panel styles: eight tiles, each with a drawn swatch
   ========================================================================== */

.sc-panel-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-md);
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 480px) {
    .sc-panel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .sc-panel-grid {
        gap: var(--spacing-lg);
    }
}

@media (min-width: 1024px) {
    .sc-panel-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.sc-panel {
    padding: var(--spacing-md);
}

@media (hover: hover) {
    .sc-panel:hover {
        transform: none;
        box-shadow: var(--shadow-xs);
    }
}

.sc-panel__title {
    margin-bottom: 0.25rem;
    font-size: var(--font-size-lg);
}

.sc-panel__text {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.55;
    color: var(--color-text-light);
}

/* The swatches are drawn with gradients in the border tokens on the linen
   background, so they stay on palette and need no image files. Each one is
   a rough impression of the pattern, not a rendering of the real panel. */
.sc-panel__swatch {
    --sc-face: var(--color-bg-light);
    --sc-line: var(--color-border-strong);
    --sc-shadow: var(--color-border);
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    margin-bottom: var(--spacing-md);
    background-color: var(--sc-face);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* One tile per row on the narrowest phones, so a shorter swatch keeps the
   eight of them from becoming a very long scroll */
@media (max-width: 479px) {
    .sc-panel__swatch {
        aspect-ratio: 2 / 1;
    }
}

/* Box trim: a frame drawn inside the face. Spread lengths must be fixed
   units, a percentage would void the whole declaration. */
.sc-panel__swatch--box_trim {
    box-shadow:
        inset 0 0 0 14px var(--sc-face),
        inset 0 0 0 16px var(--sc-line),
        inset 0 0 0 19px var(--sc-face),
        inset 0 0 0 20px var(--sc-shadow);
}

/* Slatted: even vertical slats with a gap */
.sc-panel__swatch--slatted {
    background-image: repeating-linear-gradient(
        to right,
        var(--sc-face) 0,
        var(--sc-face) 10px,
        var(--sc-line) 10px,
        var(--sc-line) 13px
    );
}

/* Fluted: tighter ribs with a softer edge on each */
.sc-panel__swatch--fluted {
    background-image: repeating-linear-gradient(
        to right,
        var(--sc-shadow) 0,
        var(--sc-face) 3px,
        var(--sc-face) 5px,
        var(--sc-line) 7px,
        var(--sc-line) 8px
    );
}

/* Mid century: wide flat faces with slim reveals */
.sc-panel__swatch--mid_century {
    background-image: repeating-linear-gradient(
        to right,
        var(--sc-face) 0,
        var(--sc-face) 28px,
        var(--sc-line) 28px,
        var(--sc-line) 30px
    );
}

/* Herringbone: two bands of opposed diagonals */
.sc-panel__swatch--herringbone {
    background-image:
        repeating-linear-gradient(45deg, var(--sc-face) 0, var(--sc-face) 8px, var(--sc-line) 8px, var(--sc-line) 10px),
        repeating-linear-gradient(-45deg, var(--sc-face) 0, var(--sc-face) 8px, var(--sc-line) 8px, var(--sc-line) 10px);
    background-size: 100% 50%;
    background-position: 0 0, 0 100%;
    background-repeat: no-repeat;
}

/* Shiplap: horizontal boards */
.sc-panel__swatch--shiplap {
    background-image: repeating-linear-gradient(
        to bottom,
        var(--sc-face) 0,
        var(--sc-face) 14px,
        var(--sc-line) 14px,
        var(--sc-line) 16px
    );
}

/* Rattan: a cane weave as two crossed grids */
.sc-panel__swatch--rattan {
    background-image:
        repeating-linear-gradient(to right, var(--sc-line) 0, var(--sc-line) 2px, transparent 2px, transparent 8px),
        repeating-linear-gradient(to bottom, var(--sc-line) 0, var(--sc-line) 2px, transparent 2px, transparent 8px);
    background-color: var(--color-bg-tint);
}

/* Slatted box trim: slats inside a frame */
.sc-panel__swatch--slatted_box_trim {
    background-image: repeating-linear-gradient(
        to right,
        var(--sc-face) 0,
        var(--sc-face) 8px,
        var(--sc-line) 8px,
        var(--sc-line) 10px
    );
    background-clip: content-box;
    padding: 20px;
    box-shadow:
        inset 0 0 0 14px var(--sc-face),
        inset 0 0 0 16px var(--sc-line);
}

/* ==========================================================================
   Finishes and stains
   ========================================================================== */

.sc-subheading {
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-2xl);
}

.sc-finish-block + .sc-stain-block {
    margin-top: var(--spacing-3xl);
}

.sc-finish-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-md);
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .sc-finish-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--spacing-lg);
    }
}

@media (min-width: 1024px) {
    .sc-finish-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.sc-finish {
    padding: var(--spacing-lg);
}

@media (hover: hover) {
    .sc-finish:hover {
        transform: none;
        box-shadow: var(--shadow-xs);
    }
}

.sc-finish__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.sc-finish__title {
    margin: 0;
    font-size: var(--font-size-lg);
}

.sc-finish__price {
    flex: none;
    white-space: normal;
}

.sc-finish__note {
    margin: 0;
    font-size: var(--font-size-sm);
    line-height: 1.55;
    color: var(--color-text-light);
}

.sc-stain-intro {
    max-width: 44rem;
    margin-bottom: var(--spacing-xl);
    color: var(--color-text-light);
}

.sc-stain-groups {
    display: grid;
    gap: var(--spacing-xl);
}

@media (min-width: 768px) {
    .sc-stain-groups {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--spacing-2xl);
    }
}

.sc-stain-group__title {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-eyebrow);
    text-transform: uppercase;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}

.sc-stain-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--spacing-md);
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 480px) {
    .sc-stain-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .sc-stain-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Each tone has a base colour from the palette and a step; the chip mixes
   ink into that base by its depth (0 to 3, set inline from the data file).
   Browsers without color-mix() show the plain base for the whole group. */
.sc-stain {
    --sc-stain-base: var(--palette-gold);
    --sc-stain-step: 12%;
    --sc-stain-ink: var(--palette-ink);
    display: grid;
    gap: 0.5rem;
}

.sc-stain-group--light .sc-stain {
    --sc-stain-base: var(--palette-gold-300);
    --sc-stain-step: 8%;
}

.sc-stain-group--medium .sc-stain {
    --sc-stain-base: var(--palette-gold);
    --sc-stain-step: 12%;
}

.sc-stain-group--dark .sc-stain {
    --sc-stain-base: var(--palette-gold-800);
    --sc-stain-step: 22%;
}

/* The grey stains lean towards the cool greys instead of the ink. Same
   specificity as the group rules and placed after them, so it wins. */
.sc-stain-group .sc-stain--cool {
    --sc-stain-ink: var(--palette-text-400);
    --sc-stain-step: 30%;
}

.sc-stain__chip {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: var(--sc-stain-base);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

@supports (background-color: color-mix(in srgb, red 10%, blue)) {
    .sc-stain__chip {
        background-color: color-mix(
            in srgb,
            var(--sc-stain-ink) calc(var(--sc-stain-depth, 0) * var(--sc-stain-step)),
            var(--sc-stain-base)
        );
    }
}

.sc-stain__name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
    color: var(--color-text);
}

/* ==========================================================================
   Add-ons table
   ========================================================================== */

.sc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background-color: var(--color-bg-card);
    box-shadow: var(--shadow-xs);
}

.sc-table-wrap:focus-visible {
    box-shadow: var(--focus-ring);
}

.sc-table {
    width: 100%;
    min-width: 32rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--color-text);
}

.sc-table th,
.sc-table td {
    padding: 0.875rem 1.25rem;
    text-align: left;
    vertical-align: top;
    border-top: 1px solid var(--color-border-light);
}

.sc-table thead th {
    font-family: var(--font-heading);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    color: var(--color-heading);
    border-top: 0;
    border-bottom: 2px solid var(--color-border);
}

.sc-table tbody th {
    width: 13rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-heading);
}

.sc-table tbody th a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.sc-table tbody tr:nth-child(even) th,
.sc-table tbody tr:nth-child(even) td {
    background-color: var(--color-bg-light);
}

.sc-table .sc-table__price {
    width: 9rem;
    white-space: nowrap;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sc-add-ons__note {
    max-width: 44rem;
    margin: var(--spacing-lg) 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

@media (min-width: 1024px) {
    .sc-table {
        font-size: var(--font-size-md);
    }

    .sc-table th,
    .sc-table td {
        padding: 1rem 1.5rem;
    }
}

/* ==========================================================================
   Permitted builds
   ========================================================================== */

.sc-permit__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--spacing-xl);
}

@media (min-width: 1024px) {
    .sc-permit__inner {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        column-gap: var(--spacing-3xl);
        align-items: start;
    }
}

.sc-permit .section-header {
    margin-bottom: 0;
}

.sc-permit__chip {
    margin-bottom: var(--spacing-lg);
}

.sc-permit__body {
    max-width: 40rem;
}

.sc-permit__body p {
    color: var(--color-text);
}

.sc-permit__body > :last-child {
    margin-bottom: 0;
}

.sc-permit__body .btn {
    margin-top: var(--spacing-sm);
}

.sc-permit__note {
    font-weight: var(--font-weight-semibold);
    color: var(--color-heading);
}

/* ==========================================================================
   Closing call to action
   ========================================================================== */

.sc-cta__inner {
    display: grid;
    gap: var(--spacing-xl);
}

@media (min-width: 1024px) {
    .sc-cta__inner {
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: var(--spacing-3xl);
        align-items: center;
    }
}

.sc-cta__copy > :last-child {
    margin-bottom: 0;
}

.sc-cta__title {
    max-width: 24ch;
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-4xl);
}

.sc-cta__text {
    max-width: 40rem;
    font-size: var(--font-size-lg);
    line-height: 1.6;
}

.sc-cta__actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .sc-cta__actions {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   Reduced motion and print
   ========================================================================== */

/* style.css zeroes the transition tokens and skips the reveal animation
   when motion is reduced. The card lift on hover is switched off here too,
   so nothing on this page moves under the pointer. */
@media (prefers-reduced-motion: reduce) {
    .sc-page .card,
    .sc-page .card:hover {
        transform: none;
        transition: none;
    }
}

@media print {
    .page-hero .breadcrumbs,
    .sc-cta {
        display: none !important;
    }

    .sc-permit__inner {
        display: block;
    }

    .sc-type-grid,
    .sc-panel-grid,
    .sc-finish-list,
    .sc-stain-groups {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sc-table-wrap {
        overflow: visible;
        border: 0;
        box-shadow: none;
    }

    .sc-table {
        min-width: 0;
    }

    .sc-stain__chip,
    .sc-panel__swatch {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .card,
    .sc-step {
        break-inside: avoid;
    }
}
