/**
 * Custom Mobile Carts: Start Here page
 *
 * Lays out the three path cards, the comparison table, the permitting
 * note, the order steps, the fit check and the closing call to action.
 * Cards, chips, badges, buttons and the section header come from
 * style.css and are not restyled here. The numbered steps and the closing
 * band repeat the About page pattern under their own names, because
 * info-pages.css is not loaded on this template. Mobile first.
 *
 * @package CustomMobileCarts
 */

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

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

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

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

/* ==========================================================================
   Path cards: three in a row from 1024px, stacked below
   ========================================================================== */

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

@media (min-width: 768px) {
    .start-tiers {
        gap: var(--spacing-xl);
    }
}

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

.start-tier {
    height: 100%;
}

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

.start-tier__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.start-tier__number {
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
    letter-spacing: var(--letter-spacing-eyebrow);
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
    color: var(--color-eyebrow);
}

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

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

/* Definition rows with a thin divider between them */
.start-tier__facts {
    margin-bottom: var(--spacing-lg);
    border-top: 1px solid var(--color-border-light);
}

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

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

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

.start-tier__fact--price dd {
    font-family: var(--font-heading);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
    color: var(--color-heading);
}

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

/* Featured card: forest border and the brass tag in its head row */
.start-tier--featured {
    border-color: var(--color-primary);
    box-shadow: inset 0 0 0 1px var(--color-primary), var(--shadow-xs);
}

@media (hover: hover) {
    .start-tier--featured:hover {
        box-shadow: inset 0 0 0 1px var(--color-primary), var(--shadow-xs);
    }
}

.start-tier__tag {
    flex: none;
}

/* ==========================================================================
   Comparison table
   ========================================================================== */

/* The wrapper scrolls sideways on phones and is keyboard focusable so
   the scroll works without a pointer */
.start-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);
}

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

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

.start-table__caption {
    padding: 1rem 1.25rem 0.75rem;
    font-size: var(--font-size-sm);
    line-height: 1.5;
    text-align: left;
    color: var(--color-text-muted);
    caption-side: top;
}

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

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

/* Row labels stay in view while the table scrolls sideways. Backgrounds
   are set explicitly, because a sticky cell shows the row behind it. */
.start-table thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
}

.start-table tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 11rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-heading);
    background-color: var(--color-bg-card);
    box-shadow: inset -1px 0 0 var(--color-border-light);
}

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

/* Zebra rows on linen */
.start-table tbody tr:nth-child(even) td,
.start-table tbody tr:nth-child(even) th {
    background-color: var(--color-bg-light);
}

/* The featured column reads a touch stronger, nothing louder */
.start-table .start-table__featured {
    color: var(--color-heading);
}

.start-table thead .start-table__featured {
    box-shadow: inset 0 -2px 0 var(--color-primary);
}

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

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

    .start-table tbody th {
        width: 13rem;
    }
}

/* ==========================================================================
   Permitting note
   ========================================================================== */

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

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

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

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

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

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

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

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

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

/* ==========================================================================
   Numbered steps (same pattern as the About page)
   ========================================================================== */

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

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

    .start-steps__inner .section-header {
        position: sticky;
        top: calc(var(--header-height) + var(--spacing-xl));
        margin-bottom: 0;
    }
}

.start-steps {
    display: grid;
}

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

.start-step:last-child {
    padding-bottom: 0;
}

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

.start-step__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);
}

.start-step__body {
    padding-top: 0.375rem;
}

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

.start-step__text {
    margin: 0;
    color: var(--color-text-light);
}

/* The consultation note, shown only when the founder has set it */
.start-step__note {
    margin: var(--spacing-sm) 0 0;
    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;
}

/* ==========================================================================
   Fit check
   ========================================================================== */

.start-fit__grid {
    align-items: stretch;
}

/* Lists, not links: the cards stay still under the pointer */
@media (hover: hover) {
    .start-fit__card:hover {
        transform: none;
        box-shadow: var(--shadow-xs);
    }
}

.start-fit__title {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    font-size: var(--font-size-xl);
    border-bottom: 1px solid var(--color-border-light);
}

.start-fit__list {
    display: grid;
    gap: 0.875rem;
}

.start-fit__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--color-text);
}

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

.start-fit__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    margin-top: 0.0625rem;
    border-radius: var(--radius-full);
}

.start-fit__card--yes .start-fit__icon {
    color: var(--color-success);
    background-color: var(--color-success-light);
}

.start-fit__card--maybe .start-fit__icon {
    color: var(--color-chip-fg);
    background-color: var(--color-chip-bg);
}

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

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

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

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

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

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

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

@media (min-width: 480px) {
    .start-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) {
    .start-steps__inner .section-header {
        position: static;
    }
}

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

    .start-permit__inner,
    .start-steps__inner,
    .start-fit__grid {
        display: block;
    }

    .start-tiers {
        grid-template-columns: minmax(0, 1fr);
    }

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

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

    .start-table tbody th {
        position: static;
    }

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