/* ============================================================
   ROYCE HEATING & AIR — SUBPAGE CONTENT
   Service detail pages, the Services page header, and the Helpful
   Info page. Measure and rhythm match the Company page
   (royce-company.css, article 58). Registered on outlines
   #Outline (32) and #Grid (34).
   ============================================================ */

/* The article column is centered by the inner wrappers, not the item-page */
html body.site-sub .item-page:has(.royce-service-page),
html body.site-sub .item-page:has(.royce-helpful-info),
html body.site-sub .item-page:has(.royce-services-intro) {
    max-width: none;
    padding: 0;
}

/* ---- Shared measure and vertical rhythm ---- */
html body .royce-service-page,
html body .royce-helpful-info,
html body .royce-services-intro {
    max-width: 880px;
    margin: 0 auto;
    font-family: var(--body-font-family);
    color: var(--royce-muted);
}
html body .royce-service-page { padding: 0 0 min(5vw, 4.5rem); }
html body .royce-helpful-info { padding: min(4vw, 3.5rem) 0 min(5vw, 4.5rem); }
html body .royce-services-intro {
    padding: min(4vw, 3.5rem) 0 min(2.5vw, 2rem);
    border-bottom: 1px solid rgba(var(--primary-color-rgb), .15);
}

/* Keep the Services grid on the same measure */
html body.itemid-111 .royce-services-grid {
    max-width: 880px;
    margin-inline: auto;
}

/* ---- Subpage page title: brand type, centered on the same measure ---- */
html body.site-sub .page-header h2 {
    font: 900 clamp(2rem, 4.4vw, 3.6rem)/1.05 var(--body-font-family);
    text-transform: uppercase;
    letter-spacing: -.045em;
    font-variant: normal;
    color: var(--royce-navy);
    margin: 0;
}
html body.site-sub .item-page:has(.royce-service-page) .page-header {
    max-width: 880px;
    margin: 0 auto;
    padding: min(4vw, 3.5rem) 0 min(2.5vw, 2rem);
    border-bottom: 1px solid rgba(var(--primary-color-rgb), .15);
}

/* ---- Services page header (kicker + h2) ---- */
html body .royce-services-intro h6 {
    font: 800 11px/1.5 var(--body-font-family);
    text-transform: uppercase;
    letter-spacing: .17em;
    color: var(--royce-orange);
    margin: 0 0 18px;
}
html body .royce-services-intro h2 {
    font: 900 clamp(2rem, 4.4vw, 3.6rem)/1.05 var(--body-font-family);
    text-transform: uppercase;
    letter-spacing: -.045em;
    font-variant: normal;
    color: var(--royce-navy);
    margin: 0 0 min(2vw, 1.75rem);
}
html body .royce-services-intro p {
    margin: 0;
}

/* ---- Helpful Info header (article h2) with divider ---- */
html body .royce-helpful-info > h2:first-child {
    margin: 0 0 min(2vw, 1.75rem);
    padding: 0 0 min(2.5vw, 2rem);
    border-bottom: 1px solid rgba(var(--primary-color-rgb), .15);
}

/* ---- Headings ---- */
html body .royce-helpful-info h2 {
    font: 900 clamp(2rem, 4.4vw, 3.6rem)/1.05 var(--body-font-family);
    text-transform: uppercase;
    letter-spacing: -.045em;
    font-variant: normal;
    color: var(--royce-navy);
}
html body :is(.royce-service-page, .royce-helpful-info) h3 {
    font: 900 clamp(1.4rem, 2.6vw, 2rem)/1.1 var(--body-font-family);
    text-transform: uppercase;
    letter-spacing: -.03em;
    color: var(--royce-navy);
    margin: min(2.6vw, 2.4rem) 0 14px;
}
html body :is(.royce-service-page, .royce-helpful-info) h4 {
    font: 800 15px/1.4 var(--body-font-family);
    color: var(--royce-navy);
    margin: 24px 0 10px;
}

/* ---- Body copy ---- */
html body :is(.royce-service-page, .royce-helpful-info) p {
    color: var(--royce-muted);
    font: 400 16px/1.95 var(--body-font-family);
    margin: 0 0 24px;
}
html body :is(.royce-service-page, .royce-helpful-info) > p:first-of-type {
    font-size: 18px;
    line-height: 1.8;
    color: var(--royce-navy);
}
html body .royce-service-page .service-lead {
    border-left: 3px solid var(--royce-orange);
    padding-left: 16px;
    margin-bottom: min(3vw, 2.75rem);
}

/* ---- Lists ---- */
html body :is(.royce-service-page, .royce-helpful-info) ul {
    margin: 0 0 24px;
    padding-left: 0;
    list-style: none;
}
html body :is(.royce-service-page, .royce-helpful-info) li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 10px;
    font: 400 16px/1.7 var(--body-font-family);
    color: var(--royce-muted);
}
html body :is(.royce-service-page, .royce-helpful-info) li::before {
    content: '\f00c';
    position: absolute;
    left: 0;
    top: .18em;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 13px;
    color: var(--royce-orange);
}

@media (min-width: 40rem) {
    html body .royce-helpful-info .troubleshoot-checklist {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 24px;
    }
}

@media (max-width: 50.99rem) {
    html body .royce-service-page,
    html body .royce-helpful-info,
    html body .royce-services-intro,
    html body.site-sub .item-page:has(.royce-service-page) .page-header {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    html body :is(.royce-service-page, .royce-helpful-info) h3 {
        font-size: clamp(1.2rem, 5vw, 1.6rem);
    }
    html body :is(.royce-service-page, .royce-helpful-info) p,
    html body :is(.royce-service-page, .royce-helpful-info) li {
        font-size: 15px;
        line-height: 1.85;
    }
    html body :is(.royce-service-page, .royce-helpful-info) > p:first-of-type {
        font-size: 16px;
    }
}

/* ============================================================
   SERVICES GRID — custom card grid (replaces the theme grid)
   Wrapper class set on module 150 (moduleclass_sfx "royce-services-grid").
   ============================================================ */
html body .royce-services-grid .g-particle { margin: 0; padding: 0; }
html body .royce-services-grid .g-content-array.g-joomla-articles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
html body .royce-services-grid .g-grid,
html body .royce-services-grid .g-block {
    width: auto !important;
    max-width: none;
    margin: 0 !important;
    display: block;
}
html body .royce-services-grid .g-content { margin: 0; padding: 0; }
html body .royce-services-grid .g-array-item { position: relative; display: block; margin: 0; }
html body .royce-services-grid .g-array-item-image {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 16px 28px -22px #071a3a99;
}
html body .royce-services-grid .g-array-item-image img {
    display: block;
    width: 100%;
    height: clamp(190px, 22vw, 240px);
    object-fit: cover;
    transition: transform .6s cubic-bezier(.22, .61, .36, 1);
}
html body .royce-services-grid .g-array-item-image::after {
    content: '';
    position: absolute;
    inset: 30% 0 0;
    background: linear-gradient(transparent, #071a3ae6);
    pointer-events: none;
}
html body .royce-services-grid .g-array-item-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    margin: 0;
}
html body .royce-services-grid .g-item-title {
    margin: 0;
    padding: 0 22px 20px;
    border: 0;
    font-variant: normal;
}
html body .royce-services-grid .g-item-title a {
    display: inline-block;
    color: #fff;
    font: 800 15px/1.3 var(--body-font-family);
    text-transform: uppercase;
    letter-spacing: .03em;
    text-decoration: none;
    border-left: 3px solid var(--royce-orange);
    padding-left: 12px;
}
html body .royce-services-grid .g-array-item-text { display: none; }
html body .royce-services-grid .g-array-item:hover .g-array-item-image img { transform: scale(1.06); }
html body .royce-services-grid .g-item-title a:focus-visible { outline: 3px solid var(--royce-orange); outline-offset: 4px; }

@media (max-width: 62rem) {
    html body .royce-services-grid .g-content-array.g-joomla-articles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 40rem) {
    html body .royce-services-grid .g-content-array.g-joomla-articles { grid-template-columns: 1fr; }
    html body.itemid-111 .royce-services-grid { margin-inline: 1rem; }
}

/* ---- Center the Services grid (beat the theme's #g-mainbar .moduletable margin) ---- */
html body #g-mainbar .moduletable.royce-services-grid {
    max-width: 880px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- Space below the Services grid before the footer ---- */
html body #g-mainbar .moduletable.royce-services-grid {
    padding-bottom: 72px;
}

@media (max-width: 40rem) {
    html body #g-mainbar .moduletable.royce-services-grid {
        padding-bottom: 48px;
    }
}

/* ============================================================
   REVIEWS GRID — text cards in the Services grid language.
   Wrapper class set on the Reviews module
   (moduleclass_sfx "royce-reviews-grid"). Full width: no
   880px measure, unlike the Services grid.
   ============================================================ */
html body .royce-reviews-grid .g-particle { margin: 0; padding: 0; }
html body .royce-reviews-grid .g-content-array.g-joomla-articles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
html body .royce-reviews-grid .g-grid,
html body .royce-reviews-grid .g-block {
    width: auto !important;
    max-width: none;
    margin: 0 !important;
    display: block;
}
html body .royce-reviews-grid .g-content { margin: 0; padding: 0; }

html body .royce-reviews-grid .g-array-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    background: #fff;
    border-radius: 6px;
    border-left: 4px solid var(--royce-orange);
    box-shadow: 0 16px 28px -22px #071a3a99;
    padding: 28px 26px;
    transition: transform .35s cubic-bezier(.22, .61, .36, 1),
                box-shadow .35s cubic-bezier(.22, .61, .36, 1);
}
html body .royce-reviews-grid .g-array-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 34px -22px #071a3a99;
}

html body .royce-reviews-grid .g-array-item-text {
    order: 1;
    margin: 0;
    color: var(--royce-muted);
    font-size: 1rem;
    line-height: 1.7;
}
html body .royce-reviews-grid .g-array-item-text::before {
    content: "\201C";
    display: block;
    color: var(--royce-orange);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: 6px;
}
html body .royce-reviews-grid .g-array-item-title {
    order: 2;
    margin: 18px 0 0;
}
html body .royce-reviews-grid .g-item-title {
    margin: 0;
    padding: 0;
    border: 0;
    font-variant: normal;
}
html body .royce-reviews-grid .g-item-title a,
html body .royce-reviews-grid .g-item-title {
    color: var(--royce-navy);
    font: 800 14px/1.3 var(--body-font-family);
    text-transform: uppercase;
    letter-spacing: .04em;
    text-decoration: none;
}
html body .royce-reviews-grid .g-array-item-image,
html body .royce-reviews-grid .g-array-item-read-more { display: none; }

@media (max-width: 62rem) {
    html body .royce-reviews-grid .g-content-array.g-joomla-articles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 40rem) {
    html body .royce-reviews-grid .g-content-array.g-joomla-articles {
        grid-template-columns: 1fr;
    }
}

/* ---- Reviews page (menu item 121): remove the hero band ---- */
html body.itemid-121 #g-header .hero,
html body.itemid-121 #g-header #hero-grab {
    display: none !important;
}

/* ---- Reviews grid spacing (hero removed, so add top breathing room) ---- */
html body.itemid-121 #g-mainbar .moduletable.royce-reviews-grid {
    padding-top: 64px;
    padding-bottom: 72px;
}
@media (max-width: 40rem) {
    html body.itemid-121 #g-mainbar .moduletable.royce-reviews-grid {
        padding-top: 40px;
        padding-bottom: 48px;
    }
}

/* ---- Reviews page title (article 64), full width, brand type ---- */
html body.site-sub .item-page:has(.royce-reviews-intro) {
    max-width: none;
    padding: 0;
}
html body.itemid-121 .item-page .royce-reviews-intro {
    margin: 0 -0.625rem;
    padding: min(4vw, 3.5rem) 0 min(2.5vw, 2rem);
    border-bottom: 1px solid rgba(var(--primary-color-rgb), .15);
    font-family: var(--body-font-family);
}
html body.itemid-121 .royce-reviews-intro h2 {
    font: 900 clamp(2rem, 4.4vw, 3.6rem)/1.05 var(--body-font-family);
    text-transform: uppercase;
    letter-spacing: -.045em;
    font-variant: normal;
    color: var(--royce-navy);
    margin: 0;
}
/* The title now provides the top space, so trim the grid's top padding */
html body.itemid-121 #g-mainbar .moduletable.royce-reviews-grid {
    padding-top: 40px;
}
