/* ==========================================================================
   Wilton v2 Page Styles
   Riga Home Pro - Wilton, CT
   Typography, colors and spacing mirror /css/locations.css and
   /css/homepage-v2.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables (same scheme as the Locations page)
   -------------------------------------------------------------------------- */
:root {
    --charcoal-primary: #1C1C1C;
    --charcoal-soft: #222222;
    --charcoal-dark: #555555;
    --accent-red: #9B1C2C;
    --accent-red-hover: #7F1824;
    --white: #FFFFFF;
    --light-gray: #DFDFDF;
    --body-text: #333333;
    --muted-text: #6B6B6B;
    --light-text: #DADADA;
    --border-color: #E5E5E5;
    --star-color: #F5B301;
    /* Service card body. Keep --card-dark-rgb in sync with --card-dark:
       it feeds the transparent stops of the fade gradient. */
    --card-dark: #393939;
    --card-dark-rgb: 57, 57, 57;
}

/* --------------------------------------------------------------------------
   Base Page Styles
   -------------------------------------------------------------------------- */
.wl-page {
    font-family: 'Inter', sans-serif;
    color: var(--body-text);
    line-height: 1.7;
}

.wl-page h1,
.wl-page h2,
.wl-page h3,
.wl-page h4 {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 0.75em;
}

.wl-page h2 {
    color: var(--charcoal-primary);
    font-size: 2.0rem;
    margin: 0 0 1.0em;
}

.wl-page p {
    margin-bottom: 1em;
}

.wl-section {
    padding: 53px 0;
}

@media (min-width: 992px) {
    .wl-section {
        padding: 67px 0;
    }
}

/* Small uppercase red label above section titles */
.wl-page .wl-eyebrow {
    color: var(--accent-red);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.4;
    margin: 0 0 0.6em;
}

.wl-page .wl-subtitle {
    text-align: center;
    color: var(--body-text);
    font-size: 1.7rem;
    font-weight: 400;
    max-width: 750px;
    margin: 0 auto 35px;
}

/* Black source SVGs recolored in CSS: the file is used as a mask and the
   visible colour comes from background-color. Set the file via --icon. */
.wl-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background-color: var(--accent-red);
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.wl-icon.wl-pin {
    width: 18px;
    height: 18px;
}

/* --------------------------------------------------------------------------
   Button & Link Styles
   -------------------------------------------------------------------------- */
.btn-wl-primary,
.btn-wl-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 30px;
    font-size: 1.6rem;
    font-weight: 600;
    height: 44px;
    border-radius: 4px;
    text-decoration: none;
    text-shadow: none;
    background-image: none;
    transition: all 0.3s ease;
}

.btn-wl-primary {
    background-color: var(--accent-red);
    color: var(--white);
    border: 2px solid var(--accent-red);
}

.btn-wl-primary:hover,
.btn-wl-primary:focus {
    background-color: var(--accent-red-hover);
    border-color: var(--accent-red-hover);
    color: var(--white);
    text-decoration: none;
}

.btn-wl-outline {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-wl-outline:hover,
.btn-wl-outline:focus {
    background-color: var(--white);
    color: var(--charcoal-primary);
    text-decoration: none;
}

.btn-wl-primary svg,
.btn-wl-outline svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Red text link with arrow (same as .view-more-link on /locations) */
.wl-link {
    color: var(--accent-red);
    font-size: 1.8rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;
    background-image: none;
    text-shadow: none;
}

.wl-link:hover,
.wl-link:focus {
    color: var(--accent-red-hover);
    text-decoration: underline;
}

.wl-link svg,
.card-link svg {
    margin-left: 8px;
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.wl-closing {
    text-align: center;
    margin-top: 35px;
}

/* --------------------------------------------------------------------------
   Section 1: Hero
   -------------------------------------------------------------------------- */
.wl-hero {
    position: relative;
    background: var(--charcoal-primary);
    min-height: 600px;
    display: flex;
    align-items: center;
    padding: 100px 0;
    overflow: hidden;
}

.wl-hero .wl-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Dark on the left behind the heading, text and buttons, fading out
   towards the right so the house stays bright */
.wl-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.62) 35%,
        rgba(0, 0, 0, 0.40) 55%,
        rgba(0, 0, 0, 0.15) 75%,
        rgba(0, 0, 0, 0.05) 100%);
    z-index: 1;
}

.wl-hero .container {
    position: relative;
    z-index: 2;
}

/* Keeps white text readable on the light overlay */
.wl-hero h1,
.wl-hero .hero-text {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* Brighter red so the label stays legible on the dark photo */
.wl-page .wl-hero .wl-eyebrow {
    color: #E0475A;
    font-size: 1.5rem;
    letter-spacing: 0.12em;
}

.wl-hero h1 {
    max-width: 900px;
    color: var(--white);
    font-size: 5.0rem;
    font-weight: 700;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

.wl-hero .hero-text {
    color: var(--white);
    font-size: 1.8rem;
    font-weight: 500;
    max-width: 700px;
    margin-bottom: 2em;
}

.wl-hero .hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* --------------------------------------------------------------------------
   Section 2: Trust Line (same as the Home page)
   -------------------------------------------------------------------------- */
.wl-trust {
    background-color: var(--white);
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
}

.wl-trust .trust-list {
    list-style: none;
    margin: 0;
    padding: 0;
    /* 2 x 2 by default, never 3 + 1: the four items only fit in one row
       inside the widest container */
    display: grid;
    grid-template-columns: repeat(2, max-content);
    justify-content: center;
    gap: 20px 80px;
}

@media (min-width: 1200px) {
    .wl-trust .trust-list {
        grid-template-columns: repeat(4, auto);
        justify-content: space-between;
        gap: 20px 30px;
    }
}

.wl-trust .trust-list li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--charcoal-soft);
    line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Section 3: Local to Wilton (White Background)
   -------------------------------------------------------------------------- */
.wl-local {
    background-color: var(--white);
}

.wl-local .local-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
}

/* ~45% photo / 55% content */
@media (min-width: 992px) {
    .wl-local .local-grid {
        grid-template-columns: 9fr 11fr;
        gap: 50px;
    }
}

.wl-local .local-photo img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

.wl-local .local-content > p:not(.wl-eyebrow) {
    color: var(--body-text);
    font-size: 1.7rem;
    font-weight: 400;
}

.wl-local .local-points {
    list-style: none;
    margin: 30px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 25px;
}

/* Icon above a centered label so all three columns line up evenly */
.wl-local .local-points li {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    color: var(--charcoal-soft);
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1.4;
}

.wl-local .local-points .wl-icon {
    width: 44px;
    height: 44px;
}

/* --------------------------------------------------------------------------
   Section 4: Services in Wilton (Light Gray Background)
   -------------------------------------------------------------------------- */
.wl-services {
    background-color: var(--light-gray);
    text-align: center;
}

.wl-services .services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: left;
}

@media (min-width: 576px) {
    .wl-services .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .wl-services .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .wl-services .services-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
}

/* Same look as .location-card on /locations */
.service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--card-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover,
.service-card:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.20);
}

/* Source photos have different proportions; crop them to one shape */
.service-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
}

/* Not positioned, so the stretched link below covers the whole card.
   The gradient still paints over the photo because it follows it in the DOM */
.service-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 25px;
    margin-top: -100px;
    padding-top: 100px;
    background-image: linear-gradient(
        to bottom,
        rgba(var(--card-dark-rgb), 0) 0,
        rgba(var(--card-dark-rgb), 0.55) 55px,
        rgba(var(--card-dark-rgb), 0.92) 85px,
        var(--card-dark) 105px
    );
}

.service-card h3 {
    color: var(--white);
    font-size: 2.0rem;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0 0 1.5rem;
}

.service-card p {
    color: var(--light-text);
    font-size: 1.6rem;
    font-weight: 400;
    margin-bottom: 2rem;
}

/* Arrow-only link, pinned to the bottom-right of the card */
.service-card .card-link {
    color: var(--white);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    align-self: flex-end;
    margin-top: auto;
    background-image: none;
    text-shadow: none;
}

/* Stretched link: the arrow's hit area covers the whole card, so the
   photo, title, text and empty space all open the same page */
.service-card .card-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.service-card .card-link svg {
    margin-left: 0;
    width: 22px;
    height: 22px;
    transition: transform 0.3s ease;
}

/* Stays white on hover; only the arrow nudges right */
.service-card .card-link:hover,
.service-card .card-link:focus {
    color: var(--white);
    text-decoration: none;
}

.service-card:hover .card-link svg,
.service-card .card-link:focus svg {
    transform: translateX(4px);
}

/* Keyboard focus ring goes around the whole card, not just the arrow */
.service-card .card-link:focus-visible {
    outline: none;
}

.service-card:has(.card-link:focus-visible) {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
}

/* Five narrow columns: tighter type so the cards stay compact */
@media (min-width: 1200px) {
    .service-card .card-body {
        padding: 90px 18px 20px;
    }

    .service-card h3 {
        font-size: 1.7rem;
        margin-bottom: 1rem;
    }

    .service-card p {
        font-size: 1.5rem;
        line-height: 2.4rem;
        margin-bottom: 1.5rem;
    }
}

/* --------------------------------------------------------------------------
   Section 5: Work in Wilton (White Background)
   -------------------------------------------------------------------------- */
.wl-projects {
    background-color: var(--white);
    text-align: center;
}

.wl-projects .projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: left;
}

@media (min-width: 768px) {
    .wl-projects .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Same look as .project-card on /locations */
.project-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.14);
}

.project-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.project-card .card-body {
    flex: 1;
    padding: 20px 25px 25px;
}

.wl-page .project-card .project-location {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--charcoal-primary);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.4;
    margin: 0 0 0.6em;
}

.project-card h3 {
    color: var(--charcoal-primary);
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

@media (prefers-reduced-motion: reduce) {
    .service-card,
    .project-card {
        transition: box-shadow 0.3s ease;
    }

    .service-card:hover,
    .service-card:focus-within,
    .project-card:hover,
    .service-card:hover .card-link svg,
    .service-card .card-link:focus svg {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Section 6: Review (White Background, one centered testimonial)
   -------------------------------------------------------------------------- */
.wl-review {
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.wl-review .review {
    max-width: 860px;
    margin: 0 auto;
}

.wl-review .review-stars {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 5px 0 20px;
}

.wl-review .review-stars svg {
    width: 24px;
    height: 24px;
    fill: var(--star-color);
}

.wl-review blockquote {
    margin: 0 0 15px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--charcoal-primary);
    font-size: 2.2rem;
    font-weight: 400;
    line-height: 1.6;
}

.wl-review figcaption {
    color: var(--muted-text);
    font-size: 1.6rem;
    font-weight: 500;
}

.wl-review .wl-closing {
    margin-top: 25px;
}

/* --------------------------------------------------------------------------
   Section 7: FAQ + Nearby Communities (Light Gray Background)
   One continuous background; the two columns are split by a vertical
   divider (same idea as Reviews + Financing on the Home page)
   -------------------------------------------------------------------------- */
.wl-faq-nearby {
    background-color: var(--light-gray);
}

.faq-nearby-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
}

@media (min-width: 992px) {
    .faq-nearby-grid {
        grid-template-columns: 1fr 1fr;
        gap: 50px;
        align-items: stretch;
    }

    .nearby-box {
        border-left: 1px solid rgba(0, 0, 0, 0.12);
        padding-left: 50px;
    }

    /* Photo stops where "All Locations" begins (one link line-height above
       the bottom), lining it up with the FAQ's last divider */
    .nearby-box .nearby-photo {
        padding-bottom: calc(1.8rem * 1.7);
    }
}

/* FAQ accordion (same format as /roofing) */
.faq-accordion {
    border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.faq-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 12px 40px 12px 0;
    text-align: left;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--charcoal-soft);
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.faq-question:hover {
    color: var(--accent-red);
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    font-weight: 300;
    color: var(--accent-red);
}

.faq-item.active .faq-question::after {
    content: '-';
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding-bottom: 20px;
}

.faq-answer p {
    color: var(--body-text);
    margin-bottom: 0;
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 2.8rem;
}

.faq-answer .faq-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 25px;
    margin-top: 10px;
}

.faq-answer .wl-link {
    font-size: 1.5rem;
}

.faq-answer .wl-link svg {
    width: 14px;
    height: 14px;
}

/* Town list on the left, Wilton sign photo on the right */
.nearby-box .nearby-body {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 30px;
    align-items: stretch;
}

.nearby-box .nearby-list {
    list-style: none;
    margin: 0 0 25px;
    padding: 0;
}

.nearby-box .nearby-list li + li {
    margin-top: 12px;
}

.nearby-box .nearby-list a,
.nearby-box .nearby-list span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--charcoal-soft);
    font-size: 1.7rem;
    font-weight: 500;
    text-decoration: none;
    background-image: none;
    text-shadow: none;
    transition: color 0.3s ease;
}

.nearby-box .nearby-list a:hover,
.nearby-box .nearby-list a:focus {
    color: var(--accent-red);
    text-decoration: underline;
}

.nearby-box .nearby-photo img {
    width: 100%;
    height: 100%;
    min-height: 240px;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Section 8: Final CTA (photo with charcoal gradient from the left)
   -------------------------------------------------------------------------- */
.wl-final-cta {
    position: relative;
    overflow: hidden;
    background: var(--charcoal-primary);
    padding: 80px 0;
}

/* The source photo is only 1164px wide, so on large screens it fills the
   right 70% of the band; the gradient stays solid until 30% to hide its edge */
.wl-final-cta .final-cta-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
}

@media (min-width: 1200px) {
    .wl-final-cta .final-cta-bg {
        width: 70%;
    }
}

.wl-final-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(28, 28, 28, 1) 0%,
        rgba(28, 28, 28, 1) 30%,
        rgba(28, 28, 28, 0.75) 45%,
        rgba(28, 28, 28, 0.35) 65%,
        rgba(28, 28, 28, 0.08) 85%,
        rgba(28, 28, 28, 0) 100%);
    z-index: 1;
}

.wl-final-cta .container {
    position: relative;
    z-index: 2;
}

.wl-final-cta .final-cta-content {
    max-width: 560px;
}

.wl-final-cta h2,
.wl-final-cta p {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45), 0 2px 12px rgba(0, 0, 0, 0.3);
}

.wl-page .wl-final-cta h2 {
    color: var(--white);
    font-size: 2.45rem;
    margin-bottom: 0.75em;
}

.wl-final-cta p {
    color: var(--white);
    font-size: 1.8rem;
    font-weight: 400;
    margin: 0 0 2em;
}

.wl-final-cta .cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    .wl-page h2 { font-size: 1.85rem; }

    .wl-section {
        padding: 50px 0;
    }

    /* On phones the text spans the full width, so the overlays are even */
    .wl-hero::before {
        background: rgba(0, 0, 0, 0.55);
    }

    .wl-final-cta::before {
        background: rgba(28, 28, 28, 0.7);
    }

    .wl-hero {
        min-height: 500px;
        padding: 80px 0;
    }

    .wl-hero h1 {
        font-size: 3.2rem;
        line-height: 3.8rem;
    }

    .wl-hero .hero-buttons,
    .wl-final-cta .cta-buttons {
        flex-direction: column;
    }

    .btn-wl-primary,
    .btn-wl-outline {
        width: 100%;
    }

    .wl-trust .trust-list {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: start;
        gap: 15px;
        max-width: 320px;
        margin: 0 auto;
    }

    .wl-trust .trust-list li {
        font-size: 1.7rem;
    }

    .wl-trust .wl-icon {
        width: 32px;
        height: 32px;
    }

    .wl-local .local-points {
        grid-template-columns: 1fr;
    }

    .wl-local .local-points li {
        flex-direction: row;
        text-align: left;
        gap: 14px;
    }

    .wl-review blockquote {
        font-size: 1.8rem;
    }

    .nearby-box .nearby-body {
        grid-template-columns: 1fr;
    }

    .wl-page .wl-final-cta h2 {
        font-size: 2.1rem;
    }

    .service-card .card-body,
    .project-card .card-body {
        padding: 20px;
    }

    .service-card .card-body {
        padding-top: 100px;
    }

    .faq-question {
        padding: 15px 35px 15px 0;
    }
}
