/* ==========================================================================
   Programmatic SEO pages (views/seo). Page-specific bits only: everything
   shared (cards, tables, FAQ, link grids, stats, range, ladder) comes from
   lcd.css. Colors and sizes use lcd.css tokens.
   ========================================================================== */

/* Hero: copy on the left, market panel on the right ------------------------ */

.seo-hero {
    padding-block: clamp(24px, 2vw + 12px, 40px) clamp(40px, 3vw + 24px, 72px);
}

.seo-breadcrumbs {
    margin-bottom: clamp(20px, 2vw + 8px, 32px);
}

.seo-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 64px);
    align-items: start;
}

.seo-hero__copy .eyebrow {
    margin-bottom: 16px;
}

.seo-hero__copy .h1 {
    margin-bottom: 20px;
}

.seo-hero__text {
    max-width: 62ch;
    margin-top: 14px;
    color: var(--text-2);
    line-height: 1.7;
}

.seo-panel__note {
    margin-top: 8px;
    font-size: 0.875rem;
    color: var(--on-ink-2);
}

.seo-panel .range {
    margin-top: 8px;
}

.seo-panel__stats {
    margin-top: 22px;
}

.seo-panel__stats .stat {
    flex-basis: 40%; /* two per row */
}

@media (max-width: 900px) {
    .seo-hero__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Sections ----------------------------------------------------------------- */

.seo-section .section-head .lede {
    max-width: 68ch;
}

.seo-cards > li {
    display: flex;
}

.seo-cards > li > .car-card {
    flex: 1;
}

/* Listing grids turn into a compact list on phones */
@media (max-width: 640px) {
    .seo-cards--compact {
        gap: 12px;
    }

    .seo-cards--compact .car-card {
        flex-direction: row;
        border-radius: var(--radius-md);
    }

    .seo-cards--compact .car-card__media {
        flex: 0 0 40%;
        aspect-ratio: auto;
        min-height: 112px;
    }

    .seo-cards--compact .car-card__media img {
        position: absolute;
        inset: 0;
    }

    .seo-cards--compact .car-card__badges {
        inset: 8px auto auto 8px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .seo-cards--compact .car-card__body {
        gap: 2px;
        padding: 12px 14px;
    }

    .seo-cards--compact .car-card__title {
        font-size: 0.9375rem;
    }

    .seo-cards--compact .car-card__foot {
        padding-top: 8px;
    }

    .seo-cards--compact .car-card__price {
        font-size: 1.0625rem;
    }

    .seo-cards--compact .car-card__price-label,
    .seo-cards--compact .car-card__cta {
        display: none;
    }
}

/* Locked deal teasers */
.seo-deal__reason {
    margin-top: 6px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-2);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.seo-score {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: var(--radius-pill);
    background: var(--good-tint);
    color: var(--good-strong);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.seo-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-top: clamp(24px, 2vw + 8px, 36px);
}

/* Link hubs: three columns, so long anchors ("Used Porsche 911 in San Luis
   Obispo, CA") stay on one line */
.seo-links {
    padding-block: clamp(32px, 2vw + 20px, 56px);
}

.seo-links__title {
    margin-bottom: 12px;
}

.seo-links .link-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

/* Price ladder: keep long tables of years readable */
.seo-ladder {
    max-width: 880px;
}

.seo-ladder a.ladder__year {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 3px;
}

.seo-ladder a.ladder__year:hover,
.seo-ladder a.ladder__year:focus-visible {
    text-decoration-color: currentColor;
}

/* Data tables: the first column is a row header, styled like a body cell */
.seo-section .data-table th[scope="row"] {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    font-size: inherit;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text);
    white-space: nowrap;
    vertical-align: middle;
}

.seo-section .data-table tr:last-child th[scope="row"] {
    border-bottom: 0;
}

.seo-section .data-table tbody tr:hover th[scope="row"] {
    background: rgba(17, 17, 19, 0.02);
}

.seo-section .data-table td.is-num,
.seo-section .data-table th.is-num {
    text-align: right;
}

/* Links in tables look like links, not just bold text */
.seo-section .data-table a {
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
}

.seo-section .data-table a:hover,
.seo-section .data-table a:focus-visible {
    text-decoration-color: currentColor;
}

/* Phones: tighter cells, row labels may wrap, and the label column stays put
   while a wide table (the price guide) scrolls sideways */
@media (max-width: 640px) {
    .seo-section .data-table {
        font-size: 0.875rem;
    }

    .seo-section .data-table th,
    .seo-section .data-table td,
    .seo-section .data-table th[scope="row"] {
        padding: 12px 10px;
    }

    .seo-section .data-table th:first-child {
        padding-left: 14px;
    }

    .seo-section .data-table th:last-child,
    .seo-section .data-table td:last-child {
        padding-right: 14px;
    }

    .seo-section .data-table thead th {
        white-space: normal;
        vertical-align: bottom;
    }

    .seo-section .data-table th[scope="row"] {
        min-width: 7.5em;
        white-space: normal;
    }

    .seo-section .data-table thead th:first-child,
    .seo-section .data-table th[scope="row"] {
        position: sticky;
        left: 0;
        z-index: 1;
        background: var(--surface);
        box-shadow: inset -1px 0 0 var(--line);
    }

    .seo-section .data-table td {
        white-space: nowrap;
    }
}
