/**
 * Info pages: the About page in this version, and the layout pieces later
 * information pages (Start Here, Plumbing, Permitting, FAQ) will reuse.
 *
 * Built on the shared components in style.css (section, section-header,
 * card, icon-chip, badge, buttons) and the page hero in theme.css. Nothing
 * here restyles those; this file only lays them out and adds the pieces
 * that are specific to info pages. Mobile first.
 *
 * @package CustomMobileCarts
 */

/* ==========================================================================
   Intro: copy beside the highlight list
   ========================================================================== */

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

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

    .info-intro__inner--solo {
        grid-template-columns: minmax(0, 1fr);
    }
}

.info-intro .section-header {
    margin-bottom: 0;
}

.info-intro .section-subtitle + .section-subtitle {
    margin-top: var(--spacing-md);
}

/* Text a page has in the editor follows its intro in the same section */
.info-intro .info-intro__content {
    margin-top: var(--spacing-2xl);
    margin-bottom: 0;
}

/* ==========================================================================
   Highlights: icon chip beside a short title and text
   ========================================================================== */

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

@media (min-width: 640px) {
    .info-highlights:not(.info-highlights--stacked) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.info-highlight {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.info-highlight__title {
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-lg);
    letter-spacing: -0.01em;
}

.info-highlight__text {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--color-text-light);
}

/* ==========================================================================
   Card grid
   ========================================================================== */

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

@media (min-width: 640px) {
    .info-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

/* Cards in a row share one height so their links line up */
.info-cards > li {
    display: flex;
}

.info-card {
    width: 100%;
}

/* ==========================================================================
   Numbered steps
   ========================================================================== */

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

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

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

.info-steps {
    display: grid;
}

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

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

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

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

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

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

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

.info-step__link {
    margin-top: 0.625rem;
}

/* ==========================================================================
   Facts band
   ========================================================================== */

.info-band {
    padding-block: var(--spacing-3xl);
    border-block: 1px solid var(--color-border);
}

.info-band__inner {
    display: grid;
    gap: var(--spacing-xl);
}

.info-band__title {
    max-width: 18ch;
    margin: 0;
    font-size: var(--font-size-2xl);
}

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

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

@media (min-width: 768px) {
    .info-facts {
        grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    }
}

/* The value reads first, the label stays first for screen readers */
.info-fact {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    gap: var(--spacing-xs);
    padding-left: var(--spacing-md);
    border-left: 2px solid var(--color-secondary);
}

.info-fact__value {
    font-family: var(--font-heading);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.1;
    letter-spacing: var(--letter-spacing-heading);
    font-variant-numeric: tabular-nums;
    color: var(--color-heading);
}

.info-fact__label {
    font-size: var(--font-size-sm);
    line-height: 1.4;
    color: var(--color-text-light);
}

/* ==========================================================================
   Reviews: a wall of cards in CSS columns, so ten reviews of different
   lengths pack like a real review feed. One column on phones, two on
   tablets, three on desktop. No carousel.
   ========================================================================== */

.reviews__grid {
    column-gap: var(--spacing-lg);
}

.reviews__grid > li {
    break-inside: avoid;
    margin-bottom: var(--spacing-lg);
}

@media (min-width: 768px) {
    .reviews__grid {
        columns: 2;
    }
}

@media (min-width: 1024px) {
    .reviews__grid {
        columns: 3;
        column-gap: var(--spacing-xl);
    }

    .reviews__grid > li {
        margin-bottom: var(--spacing-xl);
    }
}

.review {
    gap: 0;
}

/* Reviews are not links, so the card stays put under the pointer */
@media (hover: hover) {
    .review:hover {
        transform: none;
        box-shadow: var(--shadow-xs);
    }
}

.review__head {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.review__avatar {
    flex: none;
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius-full);
    background-color: var(--color-bg-light);
}

.review__who {
    min-width: 0;
}

.review__name {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
    color: var(--color-heading);
}

.review__meta {
    margin: 0.125rem 0 0;
    font-size: var(--font-size-sm);
    line-height: 1.4;
    color: var(--color-text-muted);
}

.review__stars {
    margin-bottom: var(--spacing-md);
}

/* Gold rather than brass so the stars keep 3:1 against the white card */
.review__stars-row {
    display: inline-flex;
    gap: 0.125rem;
    color: var(--color-secondary);
}

.review__star {
    display: inline-flex;
}

/* Given stars are solid, the rest stay as outlines */
.review__star svg {
    fill: currentColor;
}

.review__star--empty {
    color: var(--palette-text-400);
}

.review__star--empty svg {
    fill: none;
}

.review__quote {
    margin: 0;
    padding: 0;
    border: 0;
}

.review__quote p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--color-text);
}

.review__date {
    margin: var(--spacing-md) 0 0;
    padding-top: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border-light);
}

/* ==========================================================================
   Editor content and other free text
   ========================================================================== */

.info-prose {
    max-width: 46rem;
    margin-bottom: var(--spacing-2xl);
}

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

.info-prose > :last-child {
    margin-bottom: 0;
}

.info-prose h2 {
    margin-top: var(--spacing-2xl);
    font-size: var(--font-size-3xl);
}

.info-prose h3 {
    margin-top: var(--spacing-xl);
    font-size: var(--font-size-xl);
}

.info-prose ul,
.info-prose ol {
    margin-bottom: var(--spacing-md);
    padding-left: 1.25rem;
}

.info-prose ul { list-style: disc; }
.info-prose ol { list-style: decimal; }

.info-prose li {
    margin-bottom: 0.375rem;
}

.info-prose a:not([class]) {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.info-prose img {
    border-radius: var(--radius-md);
}

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

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

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

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

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

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

.info-cta__note {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.info-cta__note a {
    font-weight: var(--font-weight-semibold);
    overflow-wrap: anywhere;
}

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

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

/* ==========================================================================
   Print
   ========================================================================== */

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

    .info-intro__inner,
    .info-steps__inner,
    .info-cta__inner {
        display: block;
    }

    .info-prose {
        max-width: none;
    }

    h2,
    h3 {
        break-after: avoid;
    }

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