/* ==========================================================================
   Seamless Gutters v2 Page Styles
   Riga Home Pro - Fairfield County CT
   Typography, colors and spacing mirror /css/roof-replacement-v2.css
   and /css/residential-roofing-v2.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables (same scheme as the Roof Replacement and Residential Roofing 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
   -------------------------------------------------------------------------- */
.sg-page {
    font-family: 'Inter', sans-serif;
    color: var(--body-text);
    line-height: 1.7;
}

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

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

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

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

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

/* Centered section heading: h2 and subtitle */
.sg-signs,
.sg-install,
.sg-projects,
.sg-faq {
    text-align: center;
}

/* Small uppercase red label above the hero and final CTA titles */
.sg-page .sg-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 */
.sg-page h2:has(+ .sg-subtitle) {
    margin-bottom: 0.75em;
}

.sg-page .sg-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. */
.sg-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;
}

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

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

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

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

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

/* --------------------------------------------------------------------------
   Section 1: Hero
   The source photo is a wide, low panorama (1154 x 219), so it is anchored
   on the rooflines and gutters rather than the sky.
   -------------------------------------------------------------------------- */
.sg-hero {
    position: relative;
    background: var(--charcoal-primary);
    min-height: 600px;
    display: flex;
    align-items: center;
    padding: 100px 0;
    overflow: hidden;
}

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

/* Charcoal fade on the left behind the text, clear on the right so the
   gutters and downspout stay bright */
.sg-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(28, 28, 28, 0.70) 0%,
        rgba(28, 28, 28, 0.55) 35%,
        rgba(28, 28, 28, 0.22) 60%,
        rgba(28, 28, 28, 0) 80%);
    z-index: 1;
}

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

.sg-hero h1,
.sg-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 */
.sg-page .sg-hero .sg-eyebrow,
.sg-page .sg-final-cta .sg-eyebrow {
    color: #E0475A;
    font-size: 1.5rem;
    letter-spacing: 0.12em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.55);
}

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

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

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

/* --------------------------------------------------------------------------
   Section 2: Trust Line (White Background) - same as Residential Roofing
   -------------------------------------------------------------------------- */
.sg-trust {
    background-color: var(--white);
    padding: 30px 0;
    border-bottom: 1px solid var(--border-color);
}

.sg-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) {
    .sg-trust .trust-list {
        grid-template-columns: repeat(4, auto);
        justify-content: space-between;
        gap: 20px 30px;
    }
}

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

/* --------------------------------------------------------------------------
   Sections 3 and 5: Photo left, text right, about 50/50 on desktop,
   stacked (photo first) below 992px. Same layout as /residential-roofing.
   -------------------------------------------------------------------------- */
.sg-systems,
.sg-protection {
    background-color: var(--light-gray);
}

.sg-split .split-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 35px;
    align-items: center;
}

@media (min-width: 992px) {
    .sg-split .split-grid {
        grid-template-columns: 1fr 1fr;
        gap: 50px;
    }
}

@media (min-width: 1200px) {
    .sg-split .split-grid {
        gap: 60px;
    }
}

.sg-split .split-photo img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

/* The gutter screen photo is a close-up: crop it a little so it is not much
   taller than the text beside it, keeping the screen on the left in view */
@media (min-width: 992px) {
    .sg-protection .split-photo img {
        aspect-ratio: 16 / 9;
        object-fit: cover;
        object-position: left center;
    }
}

.sg-page .sg-split h2 {
    margin-bottom: 0.75em;
}

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

/* Red checkmarks without a circle (client mock-up) */
.sg-split .checklist {
    list-style: none;
    margin: 25px 0 0;
    padding: 0;
}

.sg-split .checklist li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--body-text);
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1.5;
}

.sg-split .checklist li + li {
    margin-top: 14px;
}

.sg-split .sg-check {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    fill: var(--accent-red);
}

/* --------------------------------------------------------------------------
   Section 3: Gutter system comparison boxes below the two columns.
   Equal white boxes; the "Our System" header is red with white text.
   -------------------------------------------------------------------------- */
.sg-systems .compare-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .sg-systems .compare-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

.compare-box {
    background: var(--white);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    border-radius: 4px;
    overflow: hidden;
    text-align: center;
}

.compare-ours {
    border-color: var(--accent-red);
}

.sg-page .compare-box .compare-head {
    background: #EFEFEF;
    color: var(--charcoal-primary);
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 2.5rem;
    margin: 0;
    padding: 12px 20px;
}

.sg-page .compare-ours .compare-head {
    background: var(--accent-red);
    color: var(--white);
}

.compare-box .compare-row {
    margin: 0 25px;
    padding: 18px 0;
}

.compare-box .compare-row + .compare-row {
    border-top: 1px solid var(--border-color);
}

.compare-box .compare-size {
    display: block;
    color: var(--charcoal-primary);
    font-size: 2.4rem;
    font-weight: 600;
    line-height: 1.3;
}

.compare-ours .compare-size {
    color: var(--accent-red);
}

.compare-box .compare-label {
    display: block;
    color: var(--charcoal-dark);
    font-size: 1.5rem;
    margin-top: 4px;
}

.compare-box .compare-down {
    display: block;
    color: var(--charcoal-primary);
    font-size: 1.7rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   Section 4: Signs You May Need New Gutters (White Background)
   Three equal photo cards, centered titles with a short red rule beneath.
   -------------------------------------------------------------------------- */
.sg-signs {
    background-color: var(--white);
}

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

@media (min-width: 768px) {
    .sg-signs .signs-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 992px) {
    .sg-signs .signs-grid {
        gap: 30px;
    }
}

.sign-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.sg-page .sign-card h3 {
    color: var(--charcoal-primary);
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 2.5rem;
    margin: 18px 0 0;
}

.sg-page .sign-card h3::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--accent-red);
    margin: 10px auto 0;
}

/* --------------------------------------------------------------------------
   Section 6: Professional Installation (White Background)
   Three icons with centered titles, stacked on mobile.
   -------------------------------------------------------------------------- */
.sg-install {
    background-color: var(--white);
}

.sg-install .install-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 35px;
}

@media (min-width: 768px) {
    .sg-install .install-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
}

.sg-install .sg-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 18px;
}

.sg-page .install-item h3 {
    color: var(--charcoal-primary);
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 2.5rem;
    margin: 0;
}

/* --------------------------------------------------------------------------
   Section 7: Recent Projects (Light Gray Background)
   Same card behaviour as /roof-replacement: the whole card opens the
   location page. Portrait crop keeps the gutters and downspouts in view.
   -------------------------------------------------------------------------- */
.sg-projects {
    background-color: var(--light-gray);
}

.sg-projects .projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

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

@media (min-width: 992px) {
    .sg-projects .projects-grid {
        gap: 30px;
    }
}

.project-card {
    position: relative;
    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,
.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 / 5;
    object-fit: cover;
    object-position: center bottom;
    display: block;
}

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

.sg-page .project-card h3 {
    color: var(--charcoal-primary);
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 2.5rem;
    margin: 0 0 8px;
}

.project-card .card-link {
    color: var(--accent-red);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    background-image: none;
    text-shadow: none;
}

/* Stretched link: the link'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: 8px;
    width: 14px;
    height: 14px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.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 link */
.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 {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Section 8: FAQ (White Background, one column)
   Same accordion as /roof-replacement and /residential-roofing
   -------------------------------------------------------------------------- */
.sg-faq {
    background-color: var(--white);
}

.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:focus-visible {
    outline: 2px solid var(--accent-red);
    outline-offset: 2px;
}

.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: '-';
}

/* Closed answers stay in the HTML (crawlable) but are hidden from
   screen readers and the tab order until opened */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, visibility 0s 0.3s;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding-bottom: 20px;
    visibility: visible;
    transition: max-height 0.3s ease, padding 0.3s ease, visibility 0s;
}

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

/* --------------------------------------------------------------------------
   Section 9: Final CTA (photo with charcoal gradient from the left)
   Wide panorama anchored to keep the gutters and downspout in view.
   -------------------------------------------------------------------------- */
.sg-final-cta {
    position: relative;
    overflow: hidden;
    background: var(--charcoal-primary);
    padding: 80px 0;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

    /* Keep the gutter and downspout (right side of the photo) in the
       narrow phone crop */
    .sg-hero .sg-hero-bg {
        object-position: 85% center;
    }

    .sg-final-cta .final-cta-bg {
        object-position: 45% center;
    }

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

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

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

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

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

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

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

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

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

@media (prefers-reduced-motion: reduce) {
    .faq-answer,
    .faq-item.active .faq-answer {
        transition: none;
    }
}
