/* ==========================================================================
   Roofing Hub Page Styles
   Riga Home Pro - Fairfield County CT
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables (Color Scheme from Roofing_Color_Plan_Elite.docx)
   -------------------------------------------------------------------------- */
: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 Roofing Page Styles
   -------------------------------------------------------------------------- */
.roofing-page {
    font-family: 'Inter', sans-serif;
    color: var(--body-text);
    line-height: 1.7;
}

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

.roofing-page h1 { font-size: 2.75rem; }
.roofing-page h2 { font-size: 2.45rem; }
.roofing-page h3 { font-size: 1.7rem; }

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

/* Section spacing */
.roofing-section {
    padding: 53px 0;
}

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

/* --------------------------------------------------------------------------
   Section 1: Hero
   -------------------------------------------------------------------------- */
.roofing-hero {
    position: relative;
    background: var(--charcoal-primary);
    background-image: url('/images/roofing/roof-replacement-fairfield-county-ct-hero.webp');
    background-size: cover;
    background-position: center;
    min-height: 600px;
    display: flex;
    align-items: center;
    padding: 100px 0;
}

.roofing-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1;
}

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

.roofing-hero h1 {
    color: var(--white);
    font-size: 5.0rem;
    font-weight: 600;
    margin-bottom: 0.5em;

    line-height: 5.0rem;
}

.roofing-hero h2 {
    color: var(--white);
    font-size: 2.7rem;
    font-weight: 600;
    margin: 0 0 0.5em 0;

    line-height: 40px;
}

.roofing-hero .hero-subtitle {
    color: var(--white);
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1.5em;

    line-height: 1.9;
}

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

    line-height: 3.0rem;
}

.roofing-hero .hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 2em;
}

.roofing-hero .trust-line {
    background-color: #F8F8F8;
    color: var(--charcoal-soft);
    font-weight: 500;
    font-size: 1.4rem;
    padding: 20px;
    text-align: center;
}

/* --------------------------------------------------------------------------
   Button Styles
   -------------------------------------------------------------------------- */
.btn-roofing-primary {
    display: inline-block;
    background-color: var(--accent-red);
    color: var(--white);
    padding: 0 30px;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 40px;
    height: 44px;
    border: 2px solid var(--accent-red);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 4px;
}

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

.btn-roofing-primary,
.btn-roofing-outline,
.btn-roofing-primary:hover,
.btn-roofing-primary:focus,
.btn-roofing-outline:hover,
.btn-roofing-outline:focus {
    text-shadow: none;
    background-image: none;
}

.btn-roofing-outline {
    display: inline-block;
    background-color: transparent;
    color: var(--white);
    padding: 0 30px;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 40px;
    height: 44px;
    border: 2px solid var(--white);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

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

/* --------------------------------------------------------------------------
   Section 2: Authority Intro (White Background)
   -------------------------------------------------------------------------- */
.roofing-authority {
    background-color: var(--white);
    padding: 30px 0;
}

.roofing-authority h2 {
    color: var(--charcoal-primary);
    text-align: center;
    margin: 0 0 1em;
}

.roofing-authority .authority-text {
    margin: 0 auto;
    text-align: center;
    font-size: 2.0rem;
    font-weight: 500;
    color: var(--charcoal-soft);

    line-height: 3.0rem;
}

.roofing-authority .authority-text p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Section 3: Why Roofs Fail (Dark Background)
   -------------------------------------------------------------------------- */
.roofing-why-fail {
    background-color: var(--charcoal-dark);
}

.roofing-why-fail h2 {
    color: var(--white);
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 1.5em;

    line-height: 1.0rem;
}

.roofing-why-fail .icon-boxes {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 30px;
    margin-bottom: 25px;
}

@media (min-width: 576px) {
    .roofing-why-fail .icon-boxes {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .roofing-why-fail .icon-boxes {
        grid-template-columns: repeat(5, 1fr);
        gap: 20px;
    }
}

.icon-box {
    text-align: center;
    padding: 25px 15px;
}

.icon-box .icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-box .icon-wrapper img {
    max-width: 100%;
    max-height: 100%;
    filter: brightness(0) invert(1);
}

.icon-box h4 {
    color: var(--white);
    font-size: 1.8rem;
    font-weight: 500;
    line-height: 2.5rem;
    font-family: 'Inter', sans-serif;
    margin-bottom: 25px;
}

.icon-box p {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 2.5rem;
    margin-bottom: 0;
}

.roofing-why-fail .closing-statement {
    text-align: center;
    color: var(--white);
    font-size: 1.8rem;
    font-weight: 500;
    margin: 0 auto;
}

.roofing-why-fail .cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.roofing-why-fail .cta-buttons .btn-roofing-primary {
    font-size: 1.6rem;
    font-weight: 600;

    line-height: 40px;
}

/* --------------------------------------------------------------------------
   Section 4: Complete Roofing System (White Background)
   -------------------------------------------------------------------------- */
.roofing-system {
    background-color: var(--white);
}

.roofing-system h2 {
    color: var(--charcoal-primary);
    font-size: 2.0rem;
    font-weight: 600;
    text-align: center;
    margin: 0 0 1.5em;

    line-height: 1.0rem;
}

.roofing-system .system-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

@media (min-width: 992px) {
    .roofing-system .system-content {
        flex-direction: row;
        align-items: center;
    }
}

.roofing-system .system-diagram {
    flex: 1;
}

.roofing-system .system-diagram img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
}

.roofing-system .system-checklist {
    flex: 1;
}

.roofing-system .checklist-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.roofing-system .checklist-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background-color: var(--charcoal-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    margin-top: 2px;
}

.roofing-system .checklist-icon svg {
    width: 16px;
    height: 16px;
    fill: var(--white);
}

.roofing-system .checklist-text {
    color: var(--body-text);
    font-size: 1.6rem;
    font-weight: 500;

    line-height: 3.0rem;
}

.roofing-system .checklist-text strong {
    color: var(--charcoal-primary);
}

.roofing-system .system-closing {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--body-text);
    margin: 50px auto 0;
    line-height: 2.5rem;
}

.roofing-system .system-closing .residential-roofing {
    color: var(--accent-red);
    text-decoration: none;
    background-image: none;
}

.roofing-system .system-closing .residential-roofing:hover {
    color: var(--accent-red-hover);
    text-decoration: underline;
}

.roofing-system .cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.roofing-system .cta-buttons .btn-roofing-primary {
    font-size: 1.6rem;
    font-weight: 600;

    line-height: 40px;
}

/* --------------------------------------------------------------------------
   Section 5: Services Side by Side
   -------------------------------------------------------------------------- */
.roofing-services {
    background-color: var(--light-gray);
}

.roofing-services h2 {
    color: var(--charcoal-primary);
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 1.5em;

    line-height: 1rem;
}

.roofing-services .services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

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

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

.service-card img {
    width: 100%;
    height: auto;
    margin-bottom: 25px;
}

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

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

    line-height: 3.0rem;
}

.service-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.service-card ul li {
    position: relative;
    padding-left: 25px;
    color: var(--body-text);
    font-size: 1.6rem;
    font-weight: 400;

    line-height: 3.0rem;
}

.service-card ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 13px;
    width: 8px;
    height: 8px;
    background-color: var(--charcoal-dark);
    border-radius: 50%;
}

.service-card .service-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;
    margin-top: 25px;
}

.service-card .service-link:hover {
    color: var(--accent-red-hover);
    text-decoration: underline;
}

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

.roofing-services .services-closing {
    text-align: center;
    color: var(--charcoal-primary);
    font-size: 1.8rem;
    font-weight: 600;
    max-width: 800px;
    margin: 40px auto 0 auto;
}

.roofing-services .cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.roofing-services .cta-buttons .btn-roofing-primary {
    font-size: 1.6rem;
    font-weight: 600;

    line-height: 40px;
}

/* --------------------------------------------------------------------------
   Section 6: Installation Process (Light Gray)
   -------------------------------------------------------------------------- */
.roofing-process {
    background-color: var(--white);
}

.roofing-process h2 {
    color: var(--charcoal-primary);
    font-size: 2.0rem;
    font-weight: 600;
    text-align: center;
    margin: 0 0 1.5em;

    line-height: 1.0rem;
}

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

@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: var(--border-color);
        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='%23AAAAAA' 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;
        z-index: 3;
    }
}

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

.process-step .step-number {
    width: 60px;
    height: 60px;
    background-color: var(--charcoal-dark);
    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 .step-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
}

.process-step .step-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--charcoal-primary);
}

.process-step h4 {
    color: var(--charcoal-primary);
    font-size: 1.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    margin-bottom: 25px;
    line-height: 2.5rem;
}

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

.roofing-process .process-closing {
    text-align: center;
    color: var(--body-text);
    font-size: 1.8rem;
    font-weight: 500;
    margin: 0 auto;
}

.roofing-process .cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.roofing-process .cta-buttons .btn-roofing-primary {
    font-size: 1.6rem;
    font-weight: 600;

    line-height: 40px;
}


/* --------------------------------------------------------------------------
   Section 7: FAQ + Locations (Two Columns)
   -------------------------------------------------------------------------- */
.roofing-faq {
    background-color: var(--light-gray);
}

.faq-locations-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 60px;
}

@media (min-width: 992px) {
    .faq-locations-grid {
        grid-template-columns: 1fr 1.5fr;
        gap: 80px;
    }
}

/* FAQ Accordion */
.faq-section h2 {
    color: var(--charcoal-primary);
    text-align: center;
    font-size: 2.0rem;
    font-weight: 600;
    margin: 0 0 1.5em;

    line-height: 1rem;
}

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

.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-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);
    transition: transform 0.3s ease;
}

.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 7: FAQ + Locations (Two Columns)
   -------------------------------------------------------------------------- */
.roofing-locations {
    background-color: var(--white);
}

.locations-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 60px;
}

@media (min-width: 992px) {
    .locations-grid {
        grid-template-columns: 1fr 1.5fr;
        gap: 80px;
    }
}

.locations-section h2 {
    color: var(--charcoal-primary);
    text-align: center;
    font-size: 2.0rem;
    font-weight: 600;
    margin: 0 0 1.5em;

    line-height: 1.0rem;
}

.locations-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.locations-grid a {
    display: block;
    padding: 10px 25px;
    background-color: #ededed;
    color: var(--charcoal-soft);
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    background-image: none;
    text-shadow: none;
    border-radius: 4px;
}

.locations-grid a:hover {
    background-color: #dedede;
}

.locations-section .cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.locations-section .cta-buttons .view-all-link {
    color: var(--accent-red);
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    background-image: none;
    text-shadow: none;
}

.locations-section .view-all-link:hover {
    text-decoration: underline;
}

.locations-section .view-all-link svg {
    margin-left: 8px;
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* --------------------------------------------------------------------------
   Section 8: Final CTA (Dark Background)
   -------------------------------------------------------------------------- */
.roofing-final-cta {
    background-color: var(--charcoal-dark);
    text-align: center;
    padding: 80px 0;
}

.roofing-final-cta h2 {
    color: var(--white);
    font-size: 2.0rem;
    font-weight: 600;
    margin: 0 0 3.5rem;

    line-height: 1.0rem;
}

.roofing-final-cta .cta-subtext {
    color: var(--white);
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 2em;

    line-height: 3.0rem;
}

.roofing-final-cta .cta-subtext .financing-link {
    color: var(--white);
    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;
}

.roofing-final-cta .cta-subtext .financing-link:hover {
    color: var(--white);
    text-decoration: underline;
}

.roofing-final-cta .cta-subtext .financing-link svg {
    margin-left: 8px;
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.roofing-final-cta .cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 3.5rem;
}

.roofing-final-cta .cta-buttons .btn-roofing-primary {
    font-size: 1.6rem;
    font-weight: 600;

    line-height: 40px;
}

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

    .roofing-section {
        padding: 60px 0;
    }

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

    .btn-roofing-primary,
    .btn-roofing-outline {
        width: 100%;
        text-align: center;
    }

    .roofing-hero .hero-buttons {
        flex-direction: column;
    }

    .service-card {
        padding: 20px;
    }

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

    .locations-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.roofing-page .text-center { text-align: center; }
.roofing-page .mb-0 { margin-bottom: 0; }
.roofing-page .mt-4 { margin-top: 2rem; }
