/*
 * Homepage Styles
 *
 * Styles specific to the landing page (index.html.twig), plus the postcard
 * preview component and FAQ list, which are also used elsewhere.
 * Mobile-first: base rules target phones, min-width queries scale up.
 */

.container.narrow {
    max-width: 720px;
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
}

/* ---------- Hero ---------- */
.hero-section {
    background-color: var(--color-hero-bg);
    background-image:
        linear-gradient(210deg, transparent 0%, var(--color-hero-bg) 70%),
        radial-gradient(circle, var(--dots-on-dark) 1.6px, transparent 2.2px);
    background-size: auto, 16px 16px;
    color: var(--color-hero-text);
    padding: 1.25rem 0 2.25rem;
    overflow: hidden;
}

.hero-inner {
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
    max-width: 1100px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);   /* never wider than the screen, even with large text */
    grid-template-areas: "copy" "cta" "card";
    gap: 1.25rem;
}

.hero-copy { grid-area: copy; }

/* Tapping the example card starts a postcard, like the button */
.hero-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.hero-card { grid-area: card; position: relative; padding: 0.5rem 0.75rem 0.75rem; }
.hero-cta  { grid-area: cta; }

.hero-heading {
    font-size: clamp(2rem, 8.5vw, 3.6rem);
    font-weight: var(--font-weight-heavy);
    line-height: 1.02;
    margin-bottom: 0.75rem;
    text-transform: lowercase;
}

.hero-text {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 1rem;
}

.hero-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.95rem 0.6rem;
    list-style: none;
    padding: 0;
    margin: 0 0 0.45rem;
}

/* Phones: slightly tighter pills so all three fit on one line (they need ~380px at full size) */
@media (max-width: 575.98px) {
    .hero-chips {
        column-gap: 0.35rem;
    }

    .hero-chips .chip {
        gap: 0.25rem;
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
}

.hero-sticker {
    position: absolute;
    left: 0;   /* bottom-left, so it doesn't cover the stamp on the card's bottom-right */
    bottom: 0.1rem;
    background: var(--color-highlight);
    color: var(--color-primary);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heavy);
    font-size: 1rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-bubble);
    transform: rotate(-4deg);
}

.hero-sticker::after {
    content: "";
    position: absolute;
    left: 0.8rem;
    bottom: -0.5rem;
    border-style: solid;
    border-width: 0.55rem 0.65rem 0 0;
    border-color: var(--color-highlight) transparent transparent transparent;
}

/* "Make yours by Oct 19 · Nonprofit" under the hero button; the deadline part is a bit bolder */
.hero-deadline {
    font-weight: var(--font-weight-semibold);
}

.hero-reassure-sep {
    margin: 0 0.35rem;
}

.hero-reassure {
    margin: 0.6rem 0 0;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Phones: a little more room between the yellow button area and the yellow card, so they read as two things */
@media (max-width: 899.98px) {
    .hero-card {
        margin-top: 0.75rem;
    }
}

@media (min-width: 900px) {
    .hero-section {
        padding: 2.5rem 0 4rem;
    }

    .hero-grid {
        grid-template-columns: 1.05fr 1fr;
        grid-template-areas: "copy card" "cta card";
        column-gap: 3rem;
        align-items: center;
    }

    .hero-cta {
        align-self: start;
        max-width: 380px;
    }

    .hero-reassure {
        text-align: left;
    }
}

/* ---------- Postcard preview component ----------
   The vendor's "i'm voting. you in?" (yellow) front, 6 x 4 in. Measurements are % of the card / cqw
   (1cqw = 1% of the card's width), taken from the print PDF, so it scales to any width. */
.pc-card {
    position: relative;
    aspect-ratio: 3 / 2;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    background-color: var(--postcard-bg);
    background-image: radial-gradient(circle, var(--postcard-dots) 0.55cqw, transparent 0.65cqw);
    background-size: 3.4cqw 3.4cqw;
    color: var(--postcard-text);
    border-radius: 1.2cqw;
    container-type: inline-size;
    overflow: hidden;
}

.hero-card .pc-card {
    outline: 3px solid var(--color-bg);
}

.pc-card--tilt {
    transform: rotate(-3deg);
}

/* Square photo on the left, rounded, with the check badge over its top-left corner */
.pc-photo-wrap {
    position: absolute;
    left: 4.6%;
    top: 13.5%;
    width: 48.3%;
    aspect-ratio: 1 / 1;
}

.pc-photo {
    width: 100%;
    height: 100%;
    border-radius: 2.4cqw;
    overflow: hidden;
    background: #fff;
}

.pc-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pc-photo-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
    font-size: 3.2cqw;
    text-align: center;
}

.pc-photo-placeholder i {
    font-size: 9cqw;
}

.pc-check {
    position: absolute;
    left: -2.8%;
    top: -9%;
    width: 21.5%;
    aspect-ratio: 1 / 1;
    border-radius: 1.6cqw;
    background: var(--postcard-text);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8cqw;
    transform: rotate(-8deg);
}

.pc-check i::before {
    font-weight: 900 !important;
    -webkit-text-stroke: 0.25cqw #fff;
}

.pc-text {
    position: absolute;
    left: 55.7%;
    right: 4%;
    top: 13%;
}

.pc-text p {
    margin: 0;
}

.pc-headline {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heavy);
    font-size: 6.6cqw;
    line-height: 1.02;
    letter-spacing: -0.01em;
    margin-bottom: 2.4cqw !important;
}

/* Tangerine highlighter bar through the bottom of "you in?" */
.pc-headline-mark {
    background: linear-gradient(transparent 58%, var(--postcard-highlight) 58%, var(--postcard-highlight) 76%, transparent 76%);
}

.pc-message {
    font-size: 2.55cqw;
    line-height: 1.38;
    margin-bottom: 2.6cqw !important;
}

.pc-message strong {
    font-weight: var(--font-weight-bold);
}

/* The sender's name in a white box */
.pc-name {
    background: #fff;
    border: 0.3cqw solid var(--postcard-text);
    padding: 1.4cqw 2cqw;
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heavy);
    font-size: 3cqw;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.pc-stamp {
    position: absolute;
    right: 3.4%;
    bottom: 5%;
    width: 18.5%;
    height: auto;
}

/* ---------- Content sections ---------- */
.home-section {
    padding: 2.75rem 0;
}

.home-section h2 {
    margin-bottom: 1rem;
    color: var(--color-primary);
    font-weight: var(--font-weight-heavy);
    text-transform: lowercase;
}

.lead-text {
    font-size: 1.1rem;
}

.small-note {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.why-section {
    background: var(--color-bg);
}

.how-section {
    background: var(--color-section-alt);
}

.steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.9rem;
}

.step-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--color-bg);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-card);
    padding: 1rem 1.1rem;
}

.step-card h3 {
    font-size: 1.2rem;
    color: var(--color-primary);
    margin: 0.15rem 0 0.25rem;
}

.step-card p {
    margin: 0;
}

.step-num {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-accent);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-heavy);
    font-size: 1.2rem;
    line-height: 1;
    /* Nudge Jost's digits to the true center of the circle (measured) */
    padding-top: 0.05em;
}

.trust-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
}

.trust-list li {
    padding-left: 0.9rem;
    border-left: 4px solid var(--color-highlight);
}

.trust-list strong {
    color: var(--color-primary);
}

.sweeps-section {
    background: var(--color-section-fun);
}

.sweeps-disclaimer {
    margin: 1.5rem auto 0;
    max-width: 38rem;
    text-align: left;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--color-text-muted);
}

.sweeps-emoji {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
}

.faq-section {
    background: var(--color-bg);
}

.closing-section {
    background-color: var(--brand-soft-pink);
    background-image:
        linear-gradient(20deg, transparent 0%, var(--brand-soft-pink) 75%),
        radial-gradient(circle, var(--dots-on-light) 1.6px, transparent 2.2px);
    background-size: auto, 16px 16px;
    color: var(--color-primary);
}

.closing-section .btn-on-dark {
    --bs-btn-border-color: var(--color-primary);
    --bs-btn-hover-border-color: var(--color-primary);
    --bs-btn-active-border-color: var(--color-primary);
    --btn-edge: var(--color-primary);
}

@media (min-width: 768px) {
    .home-section {
        padding: 4rem 0;
    }

    .trust-list {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

/* ---------- FAQ list (homepage + FAQ page) ---------- */
.faq-list {
    display: grid;
    gap: 0.6rem;
}

.faq-item {
    border: 2px solid var(--color-primary);
    border-radius: 14px;
    background: var(--color-bg);
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 0.85rem 2.75rem 0.85rem 1rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    position: relative;
    min-height: 48px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

/* Focus outline inside the box, so it doesn't merge with the box's own border */
.faq-item summary:focus-visible {
    outline-offset: -6px;
    border-radius: 12px;
}

.faq-item summary::after {
    content: "+";
    content: "+" / "";   /* screen readers already say open/closed; don't also read "plus" */
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
}

.faq-item[open] summary::after {
    content: "\2212";
    content: "\2212" / "";
}

.faq-item[open] summary {
    border-bottom: 2px solid var(--color-line);
}

.faq-item p {
    margin: 0;
    padding: 0.85rem 1rem 1rem;
}

.faq-more {
    margin-top: 1rem;
    text-align: center;
}

/* Full-width image helper */
.img-full {
    width: 100%;
}

/* ---------- Simple content pages (FAQ, privacy) ---------- */
.page-title {
    color: var(--color-primary);
    margin-bottom: 1.25rem;
    font-weight: var(--font-weight-heavy);
}

.legal-content h2,
.legal-content h3 {
    color: var(--color-primary);
    margin-top: 1.5rem;
}

.legal-content {
    overflow-wrap: anywhere;
}

/* Privacy policy: an h1 title and h2 sections (screen readers need the levels), drawn exactly like
   the old h2 title and h3 sections */
.legal-content .legal-title {
    color: var(--color-primary);
    font-size: clamp(1.5rem, 5.5vw, 2.25rem);
    font-weight: var(--font-weight-heavy);
    text-transform: lowercase;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.home-section .legal-content h2.legal-section {
    font-size: calc(1.3rem + 0.6vw);
    font-weight: var(--font-weight-bold);
    text-transform: none;
    margin-bottom: 0.5rem;
}

@media (min-width: 1200px) {
    .home-section .legal-content h2.legal-section {
        font-size: 1.75rem;
    }
}

/* /card: for people who received a printed postcard (templates/card/index.html.twig) */
.card-page .container { max-width: 640px; }
.card-block { border: 2px solid var(--brand-blue); border-radius: 16px; padding: 1.1rem 1.15rem; margin-top: 1.25rem; background: #fff; }
.card-block h2 { margin-top: 0; }
.card-block-vote { background: var(--brand-pale-pink); border-color: var(--brand-pale-pink); }
.card-block-donate { text-align: center; margin-top: 1.5rem; }
.card-vote-btn { display: flex; align-items: center; gap: .6rem; text-align: left; white-space: normal; line-height: 1.3; }
.card-vote-btn .bi-box-arrow-up-right { margin-left: auto; font-size: .9em; }
.card-step { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.card-q { font-family: var(--font-family-heading); font-weight: 800; font-size: 1.1rem; margin-bottom: .6rem; }
.card-choice { display: flex; align-items: center; gap: .6rem; border: 2px solid var(--brand-soft-pink); border-radius: 12px; padding: .65rem .8rem; margin-bottom: .45rem; cursor: pointer; }
.card-choice:has(input:checked) { border-color: var(--brand-blue); background: var(--brand-pale-pink); }
.card-choice input, .card-check input { width: 1.15rem; height: 1.15rem; flex-shrink: 0; accent-color: var(--brand-blue); }
.card-check { display: flex; align-items: flex-start; gap: .6rem; margin: 1rem 0 .5rem; font-weight: 600; cursor: pointer; }
.card-stop-fields { border-left: 4px solid var(--brand-soft-pink); padding-left: .8rem; margin-bottom: .5rem; }
.card-nav { display: flex; justify-content: space-between; align-items: center; gap: .6rem; }
.card-thanks { background: var(--brand-pale-pink); border-radius: 12px; padding: .9rem 1rem; }
