/**
 * Custom Mobile Carts: Plumbing page
 *
 * Lays out the five stage water path, the option card grids, the county
 * checklist, the quoting note and the closing call to action. Cards,
 * chips, buttons and the section header come from style.css and are not
 * restyled here. The numbered markers and the connecting line repeat the
 * About page steps under their own names, because info-pages.css is not
 * loaded on this template. Mobile first: the water path is a vertical
 * list on phones and a horizontal strip from 1024px.
 *
 * @package CustomMobileCarts
 */

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

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

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

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

/* ==========================================================================
   The water path: vertical with a line down the markers, then a strip
   ========================================================================== */

.plumb-flow {
    display: grid;
    max-width: 40rem;
    margin-inline: auto;
}

.plumb-flow__step {
    position: relative;
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr);
    column-gap: var(--spacing-lg);
    padding-bottom: var(--spacing-xl);
}

.plumb-flow__step:last-child {
    padding-bottom: 0;
}

/* The line runs from under one marker to the top of the next */
.plumb-flow__step:not(:last-child)::before {
    content: '';
    position: absolute;
    top: 3rem;
    bottom: 0.5rem;
    left: calc(1.25rem - 1px);
    width: 2px;
    background-color: var(--color-border);
}

.plumb-flow__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);
}

.plumb-flow__body {
    padding-top: 0.375rem;
}

.plumb-flow__title {
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-xl);
    letter-spacing: -0.01em;
}

.plumb-flow__text {
    margin: 0;
    color: var(--color-text-light);
}

@media (min-width: 1024px) {
    .plumb-flow {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        column-gap: var(--spacing-lg);
        max-width: none;
    }

    .plumb-flow__step {
        grid-template-columns: minmax(0, 1fr);
        row-gap: var(--spacing-md);
        padding-bottom: 0;
    }

    /* Same line, now running sideways from one marker to the next and
       across the column gap */
    .plumb-flow__step:not(:last-child)::before {
        top: calc(1.25rem - 1px);
        right: calc(-1 * var(--spacing-lg));
        bottom: auto;
        left: 3rem;
        width: auto;
        height: 2px;
    }

    .plumb-flow__body {
        padding-top: 0;
    }

    .plumb-flow__title {
        font-size: var(--font-size-lg);
    }

    .plumb-flow__text {
        font-size: 0.9375rem;
        line-height: 1.55;
    }
}

/* ==========================================================================
   Option cards: one column, two at 768px, three at 1024px
   ========================================================================== */

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

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

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

    /* A pair of options stays two wide so there is no empty third slot */
    .plumb-grid--pair {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 56rem;
        margin-inline: auto;
    }
}

.plumb-item {
    height: 100%;
}

/* Details, not links: the card stays still under the pointer */
@media (hover: hover) {
    .plumb-item:hover {
        transform: none;
        box-shadow: var(--shadow-xs);
    }
}

.plumb-item__title {
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-xl);
    letter-spacing: -0.01em;
}

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

.plumb-item__facts {
    display: grid;
    gap: 0.625rem;
    margin-bottom: var(--spacing-lg);
}

.plumb-item__fact {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--color-text);
}

.plumb-item__tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.0625rem;
    color: var(--color-success);
    background-color: var(--color-success-light);
    border-radius: var(--radius-full);
}

/* A caution on the option itself, for example the pump that should not
   feed a heater */
.plumb-item__note {
    margin: 0 0 var(--spacing-lg);
    padding: 0.625rem 0.875rem;
    font-size: var(--font-size-sm);
    line-height: 1.5;
    color: var(--color-accent-text);
    background-color: var(--color-accent-light);
    border-left: 2px solid var(--color-accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Best for and price sit on the card's bottom edge whatever the text length */
.plumb-item__meta {
    margin-top: auto;
    margin-bottom: 0;
    border-top: 1px solid var(--color-border-light);
}

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

.plumb-item__row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

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

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

/* A note for the whole group, under its grid */
.plumb-group__note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 46rem;
    margin: var(--spacing-xl) auto 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--color-text);
}

.plumb-group__note-icon {
    display: inline-flex;
    flex: none;
    margin-top: 0.125rem;
    color: var(--color-chip-fg);
}

/* ==========================================================================
   County checklist
   ========================================================================== */

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

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

    .plumb-checks__inner .section-header {
        position: sticky;
        top: calc(var(--header-height) + var(--spacing-xl));
    }
}

.plumb-checks-section .section-header {
    margin-bottom: 0;
}

.plumb-checks__chip {
    margin-bottom: var(--spacing-lg);
}

.plumb-checks__btn {
    margin-top: var(--spacing-lg);
}

.plumb-checks__note {
    margin-top: var(--spacing-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-heading);
}

.plumb-checks {
    display: grid;
    gap: var(--spacing-lg);
}

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

.plumb-check {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.plumb-check__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2rem;
    height: 2rem;
    margin-top: 0.125rem;
    color: var(--color-chip-fg);
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
}

.plumb-check__title {
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-lg);
}

.plumb-check__text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--color-text-light);
}

/* ==========================================================================
   How plumbing is quoted
   ========================================================================== */

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

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

.plumb-quote .section-header {
    margin-bottom: 0;
}

.plumb-quote__body {
    max-width: 40rem;
}

.plumb-quote__body p {
    color: var(--color-text);
}

.plumb-quote__body > :last-child {
    margin-bottom: 0;
}

.plumb-quote__body a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

/* ==========================================================================
   Closing call to action (same pattern as the About page)
   ========================================================================== */

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

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

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

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

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

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

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

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

/* style.css already zeroes the motion tokens; this covers the sticky
   header block, which can jump while the page scrolls. */
@media (prefers-reduced-motion: reduce) {
    .plumb-checks__inner .section-header {
        position: static;
    }
}

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

    .plumb-checks__inner,
    .plumb-quote__inner {
        display: block;
    }

    .plumb-flow,
    .plumb-grid,
    .plumb-grid--pair {
        grid-template-columns: minmax(0, 1fr);
        max-width: none;
    }

    .plumb-flow__step {
        grid-template-columns: 2.5rem minmax(0, 1fr);
    }

    .plumb-flow__step:not(:last-child)::before {
        display: none;
    }

    .plumb-checks__inner .section-header {
        position: static;
    }

    .card,
    .plumb-item,
    .plumb-flow__step,
    .plumb-check {
        break-inside: avoid;
    }
}
