/* ==========================================================================
   Cardinal Roofing - Section Styles
   Replicates Oxygen Builder content sections for GeneratePress child theme
   ========================================================================== */

/* --- Service Cards --- */
.cr-service-card {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    background-size: cover;
    background-position: center;
    width: 330px;
    height: 220px;
    display: flex;
    align-items: flex-end;
    text-decoration: none;
    cursor: pointer;
    filter: grayscale(100%);
    padding: 10px;
}

.cr-service-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent, #222222 150px), linear-gradient(rgba(34,34,34,0.38), rgba(34,34,34,0.38));
    transition: background 0.3s ease;
}

.cr-service-card:hover .cr-service-card__overlay {
    background: linear-gradient(transparent, #222222 120px), linear-gradient(rgba(34,34,34,0.5), rgba(34,34,34,0.5));
}

.cr-service-card__content {
    position: relative;
    z-index: 2;
    padding: 20px;
    color: var(--cr-white);
    width: 100%;
    height: 100%;
    border: 1px solid #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
}

.cr-service-card h3 {
    font-size: 25px;
    margin: 0;
    font-weight: 600;
    color: var(--cr-white);
    line-height: 1;
    text-align: center;
}

.cr-service-card:hover {
    filter: grayscale(0);
    transform: scale(1.02);
    transition: filter 0.3s ease, transform 0.3s ease;
}

/* --- Service Grid --- */
.cr-services-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 40px;
}

/* --- Stats Section --- */
.cr-stats {
    background-image: linear-gradient(rgba(34,34,34,0.67), rgba(34,34,34,0.67)), url('https://cardinalroofpro.com/wp-content/uploads/2025/01/newhome-2400.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center 30%;
    padding: 75px 0 250px;
}

.cr-stats__heading {
    text-align: center;
    margin-bottom: 6px;
}

.cr-stats__heading .cr-section-subtitle {
    color: var(--cr-red);
    font-family: var(--cr-font);
    font-weight: 400;
    font-size: 22px;
    text-shadow: 3px 3px 6px #222222;
}

.cr-stats__heading h2 {
    color: var(--cr-white);
    font-weight: 500;
    line-height: 1.2;
}

.cr-stats__heading p {
    color: var(--cr-white);
    font-size: 15px;
}

.cr-stats__grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    color: var(--cr-white);
    max-width: var(--cr-max-width);
    margin: 40px auto 0;
    padding: 0 20px;
}

.cr-stat {
    text-align: center;
    width: 250px;
}

.cr-stat--hidden {
    display: none;
}

.cr-stat__divider {
    width: 3px;
    height: 100px;
    border-left: 3px solid var(--cr-light-gray);
}

.cr-stat__number {
    font-size: 48px;
    font-weight: 700;
    color: var(--cr-white);
    line-height: 1.1;
    margin-bottom: 5px;
}

.cr-stat__label {
    font-size: 22px;
    color: var(--cr-white);
    font-weight: 300;
    text-align: center;
}

/* --- Team Cards --- */
.cr-team-card {
    position: relative;
    width: 30%;
}

.cr-team-card img {
    width: 100%;
    object-fit: cover;
    height: 450px;
    display: block;
}

.cr-team-card__info {
    width: 75%;
    margin-top: -20%;
    margin-left: auto;
    margin-right: auto;
    background-color: var(--cr-dark-gray);
    color: var(--cr-white);
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.cr-team-card h3 {
    font-size: 18px;
    margin: 0;
    color: var(--cr-white);
}

.cr-team-card p {
    font-size: 22px;
    font-weight: 300;
    margin: 0;
    color: var(--cr-white);
}

/* --- Team Grid --- */
.cr-team-grid {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
    margin-top: 40px;
}

/* --- Feature Blocks --- */
.cr-feature {
    text-align: center;
    padding: 30px;
}

.cr-feature__icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    color: var(--cr-red);
}

.cr-feature__icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.cr-feature h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.cr-feature p {
    font-size: 15px;
    color: #666;
    margin: 0;
}

/* --- Feature Grid --- */
.cr-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* --- Why Choose Us --- */
.cr-why {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.cr-why__image {
    background-size: cover;
    background-position: center;
    min-height: 400px;
}

.cr-why__cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.cr-why__card {
    padding: 40px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.cr-why__card h3 {
    font-size: 18px;
    color: var(--cr-dark-gray);
    margin-bottom: 10px;
}

.cr-why__card p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.cr-why__card-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
    color: var(--cr-red);
}

.cr-why__card-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* --- Emergency CTA --- */
.cr-emergency {
    position: relative;
    background-size: cover;
    background-position: center 30%;
    display: block;
    text-align: center;
}

.cr-emergency__overlay {
    position: absolute;
    inset: 0;
    background: rgba(34, 34, 34, 0.67);
}

.cr-emergency__content {
    position: relative;
    z-index: 2;
    padding: 150px 20px;
    color: var(--cr-white);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cr-emergency__icon {
    color: var(--cr-white);
    margin-bottom: 20px;
}

.cr-emergency__icon svg {
    width: 85px;
    height: 85px;
    fill: currentColor;
}

.cr-emergency h2 {
    color: var(--cr-white);
    font-size: 55px;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 10px;
}

.cr-emergency__subheading {
    color: var(--cr-white);
    font-size: 30px;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 0;
}

.cr-emergency p {
    color: var(--cr-white);
    font-size: 18px;
    margin-bottom: 25px;
}

/* --- Location Cards --- */
.cr-location-card {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    background-size: cover;
    background-position: center;
    min-height: 250px;
    display: flex;
    align-items: flex-end;
    text-decoration: none;
}

.cr-location-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
    transition: background 0.3s ease;
}

.cr-location-card:hover .cr-location-card__overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.cr-location-card__content {
    position: relative;
    z-index: 2;
    padding: 25px;
    color: var(--cr-white);
    width: 100%;
}

.cr-location-card h3 {
    font-size: 22px;
    margin: 0;
    color: var(--cr-white);
    font-weight: 600;
}

/* --- Location Grid --- */
.cr-location-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* --- Locations Grid (icon-based cards) --- */
.cr-locations-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: var(--cr-max-width);
    margin: 30px auto 0;
}

.cr-locations-grid .cr-location-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    background: var(--cr-white);
    border: 1px solid rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: var(--cr-dark-gray);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    min-height: auto;
}

.cr-locations-grid .cr-location-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.cr-location-card__icon {
    color: var(--cr-red);
    margin-bottom: 15px;
}

.cr-location-card__icon svg {
    fill: currentColor;
}

.cr-locations-grid .cr-location-card h3 {
    color: var(--cr-dark-gray);
    font-size: 20px;
    margin: 0;
}

/* --- Services Grid (page variant, larger cards) --- */
.cr-services-grid--page {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: var(--cr-max-width);
    margin: 30px auto 0;
}

.cr-services-grid--page .cr-service-card {
    min-height: 350px;
}

/* --- Why Choose Us (content variant) --- */
.cr-why-choose {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: var(--cr-max-width);
    margin: 30px auto 0;
}

.cr-why-choose__left {
    width: 45%;
    gap: 10px;
}

.cr-why-choose__left .cr-section-subtitle {
    color: var(--cr-red);
    font-family: var(--cr-font);
    font-weight: 400;
    font-size: 22px;
}

.cr-why-choose__left h2 {
    font-weight: 500;
    line-height: 1.2;
}

.cr-why-choose__image {
    width: 100%;
    height: 274px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.cr-why-choose__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cr-why-choose__cards {
    width: 55%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.cr-value-card {
    width: 46%;
    background-color: #ffffff;
    height: 250px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 0px 17px 3px rgba(34,34,34,0.23);
}

.cr-value-card__icon {
    color: var(--cr-red);
    margin-bottom: 10px;
}

.cr-value-card__icon svg {
    width: 45px;
    height: 45px;
    max-width: 45px;
    max-height: 45px;
    fill: currentColor;
    display: block;
}

.cr-value-card h3 {
    font-size: 22px;
    color: var(--cr-dark-gray);
    margin-bottom: 10px;
    text-align: center;
}

.cr-value-card p {
    font-size: 14px;
    color: #666;
    margin: 0;
    text-align: center;
}

/* --- Feature Icon (used in columns) --- */
.cr-feature-icon {
    text-align: center;
    margin-bottom: 15px;
    color: var(--cr-red);
}

.cr-feature-icon svg {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
    fill: currentColor;
    display: block;
    margin: 0 auto;
}

/* --- Team Grid (full-width variant for About page) --- */
.cr-team-grid--full {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: var(--cr-max-width);
    margin: 30px auto 0;
}

/* --- Team Card Image (bg-image variant) --- */
.cr-team-card__image {
    width: 100%;
    height: 450px;
    background-size: cover;
    background-position: center;
    background-color: var(--cr-bg-gray);
}

/* --- Subtitle --- */
.cr-subtitle {
    font-size: 18px;
    color: var(--cr-light-gray);
    font-weight: 400;
}

/* --- Responsive: 1260px --- */
@media (max-width: 1260px) {
    .cr-team-card__image {
        height: 300px;
    }

    .cr-team-card img {
        height: 300px;
    }

    .cr-emergency h2 {
        font-size: 45px;
    }

    .cr-emergency__subheading {
        font-size: 24px;
    }
}

/* --- Responsive: Tablet (991px) --- */
@media (max-width: 991px) {
    .cr-stats__grid {
        flex-wrap: wrap;
        justify-content: center;
        gap: 30px;
    }

    .cr-stat__divider {
        display: none;
    }

    .cr-stat__number {
        font-size: 40px;
    }

    .cr-why,
    .cr-why-choose {
        flex-direction: column;
    }

    .cr-why-choose__left {
        width: 100%;
        text-align: left;
    }

    .cr-why-choose__cards {
        width: 100%;
        margin-top: 20px;
    }

    .cr-services-grid--page {
        grid-template-columns: repeat(2, 1fr);
    }

    .cr-team-grid--full {
        grid-template-columns: repeat(2, 1fr);
    }

    .cr-team-grid {
        flex-direction: column;
        align-items: center;
    }

    .cr-team-card {
        width: 50%;
    }

    .cr-emergency h2 {
        font-size: 36px;
    }
}

/* --- Responsive: Mobile (767px) --- */
@media (max-width: 767px) {
    .cr-team-grid {
        flex-direction: column;
        align-items: center;
    }

    .cr-team-card {
        width: 80%;
    }

    .cr-feature-grid {
        grid-template-columns: 1fr;
    }

    .cr-why__cards {
        grid-template-columns: 1fr;
    }

    .cr-why__card {
        padding: 30px;
    }

    .cr-location-grid,
    .cr-locations-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cr-emergency__content {
        padding: 80px 20px;
    }

    .cr-why-choose__cards {
        gap: 10px;
    }

    .cr-value-card {
        padding: 15px;
    }

    .cr-team-grid--full {
        grid-template-columns: 1fr;
    }

    .cr-team-card h3 {
        font-size: 30px;
    }

    .cr-team-card p {
        font-size: 20px;
    }
}

/* --- Responsive: Small (638px) --- */
@media (max-width: 638px) {
    .cr-stats__grid {
        flex-direction: column;
        gap: 30px;
    }

    .cr-stat__number {
        font-size: 36px;
    }
}

/* --- Responsive: Small Mobile (479px) --- */
@media (max-width: 479px) {
    .cr-service-card {
        width: 100%;
        height: 220px;
    }

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

    .cr-services-grid--page {
        grid-template-columns: 1fr;
    }

    .cr-team-card {
        width: 100%;
    }

    .cr-team-card__info {
        width: 94%;
    }

    .cr-value-card {
        width: 100%;
    }

    .cr-why__card {
        padding: 25px;
    }
}
