/* ==========================================================================
   Siding Installation v2 Page Styles
   Riga Home Pro - Fairfield County CT
   Typography, colors and spacing mirror /css/roofing.css and
   /css/wilton-v2.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables (same scheme as the Roofing and Wilton pages)
   -------------------------------------------------------------------------- */
: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;
    --light-text: #DADADA;
    --border-color: #E5E5E5;
}

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

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

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

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

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

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

/* Centered section heading: eyebrow, h2 and optional subtitle */
.sd-signs,
.sd-options,
.sd-projects,
.sd-process,
.sd-faq {
    text-align: center;
}

/* Small uppercase red label above section titles */
.sd-page .sd-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;
}

/* Subtitle sits between the h2 and the content, so the h2 gap shrinks */
.sd-page h2:has(+ .sd-subtitle) {
    margin-bottom: 0.75em;
}

.sd-page .sd-subtitle {
    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. */
.sd-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;
}

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

/* --------------------------------------------------------------------------
   Button & Link Styles
   -------------------------------------------------------------------------- */
.btn-sd-primary,
.btn-sd-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-sd-primary {
    background-color: var(--accent-red);
    color: var(--white);
    border: 2px solid var(--accent-red);
}

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

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

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

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

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

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

.sd-link svg,
.card-link svg {
    margin-left: 8px;
    width: 16px;
    height: 16px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.sd-link:hover svg {
    transform: translateX(4px);
}

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

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

/* Very light charcoal fade on the left behind the text, clear on the right
   so the house stays bright */
.sd-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(28, 28, 28, 0.55) 0%,
        rgba(28, 28, 28, 0.42) 35%,
        rgba(28, 28, 28, 0.18) 60%,
        rgba(28, 28, 28, 0) 80%);
    z-index: 1;
}

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

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

/* Brighter red so the label stays legible on the photo */
.sd-page .sd-hero .sd-eyebrow,
.sd-page .sd-final-cta .sd-eyebrow {
    color: #E0475A;
    font-size: 1.5rem;
    letter-spacing: 0.12em;
    /* The hero overlay is very light, so the label needs a firmer shadow */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.55);
}

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

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

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

/* --------------------------------------------------------------------------
   Section 2: Signs You May Need New Siding (White Background)
   Icons, headings and text only: no cards, borders or icon backgrounds
   -------------------------------------------------------------------------- */
.sd-signs {
    background-color: var(--white);
}

.sd-signs .signs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px 30px;
}

@media (min-width: 768px) {
    .sd-signs .signs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .sd-signs .signs-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.sd-signs .sign-item {
    padding: 0 10px;
}

.sd-signs .sd-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 20px;
}

.sd-signs h3 {
    color: var(--charcoal-primary);
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 2.5rem;
    margin: 0 0 12px;
}

.sd-signs .sign-item p {
    color: var(--body-text);
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 2.6rem;
    max-width: 300px;
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Section 3: Siding Options (Light Gray Background)
   -------------------------------------------------------------------------- */
.sd-options {
    background-color: var(--light-gray);
}

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

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

@media (min-width: 1200px) {
    .sd-options .options-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
}

.option-card,
.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;
}

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

.option-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 25px 25px;
}

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

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

/* Links line up along the bottom even when descriptions differ in length;
   kept on one line so the arrow never drops away from the label */
.option-card .sd-link {
    margin-top: auto;
    align-self: flex-start;
    white-space: nowrap;
}

/* Four narrow columns: tighter padding so "Explore Cedar Impressions" fits */
@media (min-width: 1200px) {
    .option-card .card-body {
        padding: 20px 20px 25px;
    }

    .option-card .sd-link {
        font-size: 1.5rem;
    }
}

/* --------------------------------------------------------------------------
   Section 4: Completed Siding Projects (White Background)
   Wilton project card; the whole card opens the location page
   -------------------------------------------------------------------------- */
.sd-projects {
    background-color: var(--white);
}

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

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

.project-card {
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

.project-card .card-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 25px 25px;
}

.sd-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;
}

.project-card .card-link {
    color: var(--accent-red);
    display: inline-flex;
    text-decoration: none;
    background-image: none;
    text-shadow: none;
}

/* Stretched link: the arrow's hit area covers the whole card */
.project-card .card-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.project-card .card-link svg {
    margin-left: 0;
    width: 22px;
    height: 22px;
}

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

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

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

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

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

/* --------------------------------------------------------------------------
   Section 5: Installation Process (Light Gray Background)
   Same layout as the process on /roofing
   -------------------------------------------------------------------------- */
.sd-process {
    background-color: var(--light-gray);
}

.process-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

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

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

    .process-step:not(:last-child)::after {
        content: '';
        position: absolute;
        top: 50px; /* padding-top(20px) + half of circle(30px) */
        left: calc(50% + 30px);
        right: calc(-50% + 10px); /* gap=20px → 10px to reach left edge of next circle */
        height: 1px;
        background-color: rgba(0, 0, 0, 0.15);
        z-index: 0;
    }

    .process-step:not(:first-child)::before {
        content: '';
        position: absolute;
        left: -19px;
        top: 120px;
        width: 25px;
        height: 25px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%239B1C2C' d='M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-size: contain;
        opacity: 0.6; /* red but subtle */
        z-index: 3;
    }
}

.process-step {
    padding: 20px;
    position: relative;
    z-index: 1;
}

.process-step .step-number {
    width: 60px;
    height: 60px;
    background-color: var(--accent-red);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0 auto 20px;
    position: relative;
    z-index: 2;
}

.process-step h3 {
    color: var(--charcoal-primary);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 25px;
    line-height: 2.5rem;
}

.process-step .step-explanation {
    color: var(--body-text);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 2.5rem;
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Section 6: Finishing Details (White Background)
   Compact band: text on the left, the four photos in one row on the right.
   The row needs the widest container; below that the text sits on top
   -------------------------------------------------------------------------- */
.sd-details {
    background-color: var(--white);
}

.sd-details .details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    align-items: center;
}

@media (min-width: 1200px) {
    .sd-details {
        padding: 45px 0;
    }

    .sd-details .details-grid {
        grid-template-columns: 5fr 7fr;
        gap: 40px;
    }
}

.sd-page .sd-details h2 {
    margin-bottom: 0.75em;
}

.sd-page .sd-details .details-text {
    color: var(--body-text);
    font-size: 1.7rem;
    font-weight: 400;
    margin: 0;
}

/* 2 x 2 on phones, 4 in a row from tablets up */
.sd-details .details-photos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 10px;
}

@media (min-width: 768px) {
    .sd-details .details-photos {
        grid-template-columns: repeat(4, 1fr);
    }
}

.sd-details figure {
    margin: 0;
}

.sd-details figure img {
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 4;
    object-fit: cover;
    display: block;
    border-radius: 4px;
}

.sd-details figcaption {
    color: var(--charcoal-primary);
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Section 7: FAQ (Light Gray Background, one column)
   Same accordion as /roofing
   -------------------------------------------------------------------------- */
.sd-faq {
    background-color: var(--light-gray);
}

.faq-accordion {
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
}

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

/* Black by default, red only on hover or when expanded */
.faq-question:hover,
.faq-item.active .faq-question {
    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.7rem;
    font-weight: 400;
    line-height: 3.0rem;
}

.faq-answer a {
    color: var(--body-text);
    text-decoration: none;
    background-image: none;
    text-shadow: none;
    transition: color 0.3s ease;
}

.faq-answer a:hover,
.faq-answer a:focus {
    color: var(--body-text);
    text-decoration: underline;
}

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

.sd-final-cta .final-cta-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* The left of the photo (trees and shrubs) is the darkest part, so the
   text sits there and the gradient clears towards the house */
.sd-final-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(28, 28, 28, 0.92) 0%,
        rgba(28, 28, 28, 0.80) 30%,
        rgba(28, 28, 28, 0.45) 55%,
        rgba(28, 28, 28, 0.10) 80%,
        rgba(28, 28, 28, 0) 100%);
    z-index: 1;
}

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

.sd-final-cta .final-cta-content {
    max-width: 580px;
}

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

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

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

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

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

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

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

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

    /* Keep the house in frame on the tall, narrow crop */
    .sd-hero .sd-hero-bg {
        object-position: 35% center;
    }

    .sd-final-cta .final-cta-bg {
        object-position: 40% center;
    }

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

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

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

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

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

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

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

/* Very narrow phones: detail photos one per row */
@media (max-width: 479px) {
    .sd-details .details-photos {
        grid-template-columns: 1fr;
    }
}
