/* ==========================================================================
   Roof Replacement v2 Page Styles
   Riga Home Pro - Fairfield County CT
   Typography, colors and spacing mirror /css/siding-v2.css,
   /css/roofing.css and /css/homepage-v2.css
   ========================================================================== */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Charcoal fade on the left behind the text, clear on the right so the
   roof stays bright. Slightly firmer than on /siding-installation because
   the aerial photo is lighter and busier behind the text */
.rr-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;
}

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

.rr-hero h1,
.rr-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 */
.rr-page .rr-hero .rr-eyebrow,
.rr-page .rr-final-cta .rr-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);
}

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

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

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

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

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

.rr-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: When Roof Replacement Makes Sense (Light Gray Background)
   Icons, headings and text only, like the signs on /siding-installation
   -------------------------------------------------------------------------- */
.rr-signs {
    background-color: var(--light-gray);
}

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

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

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

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

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

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

.rr-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 4: What's Included (White Background)
   Heading ~30% | photo ~35% | checklist ~35%; stacked below 992px
   -------------------------------------------------------------------------- */
.rr-included {
    background-color: var(--white);
}

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

@media (min-width: 992px) {
    .rr-included .included-grid {
        grid-template-columns: 30fr 35fr 35fr;
        gap: 40px;
    }
}

.rr-page .rr-included h2 {
    margin-bottom: 0.75em;
}

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

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

.rr-included .checklist {
    list-style: none;
    margin: 0;
    padding: 0;
}

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

.rr-included .checklist li + li {
    margin-top: 18px;
}

/* Small red circle with a white check, as on /roofing (red instead of gray) */
.rr-included .check-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background-color: var(--accent-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.rr-included .check-icon svg {
    width: 15px;
    height: 15px;
    fill: var(--white);
}

/* --------------------------------------------------------------------------
   Section 5: What Affects Cost (Light Gray Background)
   Five white cards: 3 in the first row, 2 centered beneath them.
   A 6-track grid lets every card span 2 tracks; the 4th card starts on
   track 2 so the last two sit in the middle.
   -------------------------------------------------------------------------- */
.rr-cost {
    background-color: var(--light-gray);
}

.rr-cost .cost-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.cost-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    border-radius: 4px;
    padding: 30px 25px;
}

.cost-card .rr-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
}

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

.cost-card p {
    color: var(--body-text);
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 2.6rem;
    max-width: 320px;
    margin: 0 auto;
}

/* Tablet and desktop: three cards in the first row, the last two stretched
   to the full width beneath them (6-track grid: 2+2+2, then 3+3). The wide
   cards put the icon on the left of the heading and text. */
@media (min-width: 768px) {
    .rr-cost .cost-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
    }

    .cost-card {
        grid-column: span 2;
        padding: 30px 20px;
    }

    .cost-card:nth-child(n+4) {
        grid-column: span 3;
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 20px;
        align-items: center;
        text-align: left;
        padding: 25px;
    }

    .cost-card:nth-child(n+4) .rr-icon {
        grid-row: 1 / span 2;
        margin-bottom: 0;
    }

    .cost-card:nth-child(n+4) h3 {
        align-self: end;
    }

    .cost-card:nth-child(n+4) p {
        align-self: start;
        max-width: none;
        margin: 0;
    }
}

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

    .cost-card {
        padding: 30px 25px;
    }

    .cost-card:nth-child(n+4) {
        column-gap: 25px;
        padding: 30px;
    }
}

/* --------------------------------------------------------------------------
   Section 6: Completed Projects (White Background)
   Same card as /siding-installation; the whole card opens the location page
   -------------------------------------------------------------------------- */
.rr-projects {
    background-color: var(--white);
}

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

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

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

.rr-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 {
    width: 22px;
    height: 22px;
    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 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 {
        transform: none;
    }
}

/* --------------------------------------------------------------------------
   Section 7: FAQ (Light Gray Background, one column)
   Same accordion as /roofing and /siding-installation
   -------------------------------------------------------------------------- */
.rr-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;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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