/*
 * ResineRoma Mobile Repair 1.0.0
 * Add-on for resineroma-site-builder/assets/css/resineroma.css v1.8.7.
 * All corrections use existing ResineRoma classes; no generic WP page restyle.
 * Full rollback: deactivate this plugin.
 */

/* The published Lavori markup uses rr-work-hub-grid (singular), but the
 * Site Builder 1.8.7 stylesheet uses rr-works-hub-grid (plural). Reconnect
 * the intended desktop/tablet/mobile grid without changing saved blocks. */
body .rr-page .rr-work-hub-grid {
    display: grid !important;
    width: 100% !important;
    max-width: 1180px !important;
    min-width: 0 !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 24px !important;
    align-items: stretch !important;
    margin-inline: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}
body .rr-page .rr-work-hub-grid > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}
body .rr-page .rr-work-hub-card {
    min-width: 0 !important;
    box-sizing: border-box !important;
}
body .rr-page .rr-work-hub-copy,
body .rr-page .rr-work-hub-image {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
body .rr-page .rr-work-hub-copy h2 {
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
}

/* Photographic editorial section: original WordPress media, no external assets. */
body .rr-page .rrm-showcase {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(56px, 7vw, 88px) 24px;
    box-sizing: border-box;
    background: #eeebe5;
    color: #24231f;
}
body .rr-page .rrm-showcase,
body .rr-page .rrm-showcase * { box-sizing: border-box; }
body .rr-page .rrm-showcase-inner {
    width: min(1180px, 100%);
    max-width: 1180px;
    margin: 0 auto;
}
body .rr-page .rrm-showcase-head {
    max-width: 760px;
    margin-bottom: 34px;
}
body .rr-page .rrm-kicker {
    margin: 0 0 12px;
    color: #575047;
    font: 700 12px/1.4 Arial, sans-serif;
    letter-spacing: .17em;
}
body .rr-page .rrm-showcase h2 {
    margin: 0 0 14px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.3rem, 4.5vw, 3.4rem);
    font-weight: 400;
    letter-spacing: -.03em;
    line-height: 1.05;
}
body .rr-page .rrm-showcase-head > p:last-child {
    margin: 0;
    max-width: 58ch;
    color: #534e48;
    font-size: 1.05rem;
    line-height: 1.55;
}
body .rr-page .rrm-showcase-grid {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}
body .rr-page .rrm-showcase-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    background: #fffdfa;
    border: 1px solid #d9d3ca;
}
body .rr-page .rrm-showcase-media {
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #ddd6cd;
}
body .rr-page .rrm-showcase-image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    body .rr-page .rrm-showcase-media:hover .rrm-showcase-image { transform: scale(1.035); }
}
body .rr-page .rrm-showcase-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 23px 22px 24px;
}
body .rr-page .rrm-showcase-copy h3 {
    margin: 0 0 12px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.5rem, 2.2vw, 1.85rem);
    line-height: 1.12;
    overflow-wrap: break-word;
}
body .rr-page .rrm-showcase-copy h3 a {
    color: inherit;
    text-decoration: none;
}
body .rr-page .rrm-showcase-copy p {
    margin: 0 0 22px;
    color: #625d56;
    font-size: 15px;
    line-height: 1.55;
}
body .rr-page .rrm-showcase-link {
    width: fit-content;
    margin-top: auto;
    color: #24231f;
    font-size: 15px;
    font-weight: 700;
    text-underline-offset: 4px;
}
body .rr-page .rrm-showcase-more {
    margin: 28px 0 0 !important;
    text-align: right;
}
body .rr-page .rrm-showcase-more a {
    color: #24231f;
    font-weight: 700;
    text-underline-offset: 4px;
}
body .rr-page .rrm-showcase a:focus-visible {
    outline: 3px solid #77634c;
    outline-offset: 4px;
}

@media (max-width: 1023px) {
    body .rr-page .rr-work-hub-grid,
    body .rr-page .rrm-showcase-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    body .rr-page .rr-work-hub-grid { gap: 18px !important; }
}

@media (max-width: 767px) {
    /* The Site Builder sets .rr-page.alignfull to width:100% and margin:0,
       overriding Gutenberg's full-bleed breakout. On phones that makes the
       whole page inherit the narrow, padded content column. */
    body .entry-content > .rr-page.alignfull {
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    body .rr-page > .alignfull,
    body .rr-page > .rr-section,
    body .rr-page > .rr-guide-hero,
    body .rr-page > .rr-contact-hero,
    body .rr-page > .rr-hero-cover {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }
    body .rr-page .rr-section,
    body .rr-page .rr-work-hub,
    body .rr-page .rr-works-hub-section {
        padding: 54px 0 !important;
        box-sizing: border-box !important;
    }
    body .rr-page .rr-section-inner,
    body .rr-page .rr-works-hub-section > .wp-block-group,
    body .rr-page .rr-home-contact-inner {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: clamp(16px, 5vw, 22px) !important;
        padding-right: clamp(16px, 5vw, 22px) !important;
        box-sizing: border-box !important;
    }
    body .rr-page .rr-section-title,
    body .rr-page .rr-card-grid,
    body .rr-page .rr-works-hub-grid,
    body .rr-page .rr-work-hub-grid,
    body .rr-page .rr-guide-grid,
    body .rr-page .rr-home-guide-grid,
    body .rr-page .rr-highlight-grid,
    body .rr-page .rr-gallery-grid,
    body .rr-page .rr-gallery-grid-four,
    body .rr-page .rr-gallery-grid-six,
    body .rr-page .rr-work-feature-grid,
    body .rr-page .rr-work-process-grid,
    body .rr-page .rr-work-detail-gallery,
    body .rr-page .rr-category-gallery,
    body .rr-page .rr-benefit-grid,
    body .rr-page .rr-contact-layout {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }
    body .rr-page .rr-card-grid,
    body .rr-page .rr-work-hub-grid,
    body .rr-page .rr-works-hub-grid,
    body .rr-page .rr-guide-grid,
    body .rr-page .rr-home-guide-grid,
    body .rr-page .rr-highlight-grid,
    body .rr-page .rr-gallery-grid,
    body .rr-page .rr-gallery-grid-four,
    body .rr-page .rr-gallery-grid-six,
    body .rr-page .rr-work-feature-grid,
    body .rr-page .rr-work-process-grid,
    body .rr-page .rr-work-detail-gallery,
    body .rr-page .rr-category-gallery,
    body .rr-page .rr-benefit-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: none !important;
        grid-auto-rows: auto !important;
        gap: 18px !important;
        align-items: stretch !important;
    }
    body .rr-page :is(
        .rr-card-grid, .rr-work-hub-grid, .rr-works-hub-grid, .rr-guide-grid,
        .rr-home-guide-grid, .rr-highlight-grid, .rr-gallery-grid,
        .rr-work-feature-grid, .rr-work-process-grid, .rr-work-detail-gallery,
        .rr-category-gallery, .rr-benefit-grid, .rr-contact-layout
    ) > * {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        grid-column: auto !important;
        grid-row: auto !important;
        box-sizing: border-box !important;
    }

    /* Unhide the HOME hero image: it is present in the DOM but covered by a
       near-opaque mobile gradient. Put a genuine photo above the copy. */
    body.home .rr-page .rr-hero-cover {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        min-height: 0 !important;
        height: auto !important;
        aspect-ratio: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #f4efe7;
    }
    body.home .rr-page .rr-hero-cover > .wp-block-cover__background,
    body.home .rr-page .rr-hero-cover > .wp-block-cover__gradient-background {
        display: none !important;
    }
    body.home .rr-page .rr-hero-cover > img.wp-block-cover__image-background {
        position: relative !important;
        display: block !important;
        inset: auto !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: clamp(250px, 74vw, 380px) !important;
        min-height: 0 !important;
        margin: 0 !important;
        object-fit: cover !important;
        object-position: 55% 61% !important;
        transform: none !important;
        z-index: 0 !important;
    }
    body.home .rr-page .rr-hero-cover > .wp-block-cover__inner-container {
        position: relative !important;
        z-index: 1 !important;
        flex: 0 1 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #f4efe7;
        box-sizing: border-box !important;
    }
    body.home .rr-page .rr-hero-inner {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 30px clamp(18px, 5vw, 24px) 36px !important;
        box-sizing: border-box !important;
    }
    body.home .rr-page .rr-hero-copy {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    body.home .rr-page .rr-hero-title {
        max-width: 100% !important;
        margin: 12px 0 20px !important;
        font-size: clamp(2.04rem, 8.7vw, 2.7rem) !important;
        line-height: 1.08 !important;
        letter-spacing: -.025em !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
        text-wrap: balance;
    }
    body.home .rr-page .rr-hero-copy > p:not(.rr-eyebrow) {
        margin: 0 !important;
        max-width: 52ch !important;
        font-size: 16px !important;
        line-height: 1.55 !important;
    }

    /* WordPress global padding + custom card padding must not accumulate. */
    body .rr-page :is(
        .rr-service-card, .rr-work-hub-card, .rr-guide-card,
        .rr-home-guide-card, .rr-work-feature-card, .rr-work-step-card,
        .rr-work-detail-card, .rr-contact-info, .rr-contact-form-box
    ) {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    body .rr-page .rr-service-card { padding: 22px 20px !important; }
    body .rr-page .rr-work-hub-copy {
        padding: 22px 20px !important;
        min-height: 0 !important;
        align-items: stretch !important;
    }
    body .rr-page .rr180-work-hub-text-card .rr-work-hub-copy {
        min-height: 0 !important;
        padding: 26px 20px !important;
    }
    body .rr-page .rr-work-hub-image img {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: clamp(210px, 57vw, 290px) !important;
        object-fit: cover !important;
    }
    body .rr-page .rr-work-hub-title,
    body .rr-page .rr-service-card h3,
    body .rr-page .rr-guide-card-copy h3,
    body .rr-page .rr-home-guide-copy h3,
    body .rr-page .rr-work-detail-caption h3 {
        max-width: 100% !important;
        font-size: clamp(1.4rem, 6.15vw, 1.76rem) !important;
        line-height: 1.13 !important;
        letter-spacing: -.018em !important;
        overflow-wrap: break-word !important;
        word-break: normal !important;
        hyphens: auto !important;
        text-wrap: pretty;
    }
    body .rr-page :is(
        .rr-work-hub-text, .rr-guide-card-copy p, .rr-home-guide-copy p,
        .rr-service-card p, .rr-work-detail-caption p
    ) {
        max-width: 100% !important;
        font-size: 16px !important;
        line-height: 1.52 !important;
        overflow-wrap: break-word !important;
    }
    body .rr-page .rr-guide-hero,
    body .rr-page .rr-works-hero,
    body .rr-page .rr-service-hero {
        padding: 42px 0 !important;
    }
    body .rr-page .rr-guide-hero-inner,
    body .rr-page .rr-contact-hero-inner {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 auto !important;
        padding: 0 clamp(18px, 5vw, 24px) !important;
        box-sizing: border-box !important;
    }
    body .rr-page .rr-guide-title,
    body .rr-page .rr-works-title,
    body .rr-page .rr-service-title,
    body .rr-page .rr-guide-index-title {
        max-width: 100% !important;
        margin: 12px 0 20px !important;
        font-size: clamp(2.04rem, 8.6vw, 2.65rem) !important;
        line-height: 1.08 !important;
        letter-spacing: -.025em !important;
        overflow-wrap: break-word !important;
        word-break: normal !important;
        hyphens: auto !important;
        text-wrap: balance;
    }
    body .rr-page .rr-guide-lead {
        width: 100% !important;
        max-width: 58ch !important;
        margin: 0 !important;
        font-size: 16px !important;
        line-height: 1.52 !important;
    }
    body .rr-page .rr-guide-article,
    body .rr-page .rr-work-subpage-article,
    body .rr-page .rr-service-article,
    body .rr-page .rr-legal-article {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    body .rr-page .rr-section-title h2,
    body .rr-page .rr-home-contact h2,
    body .rr-page .rr-faq-column h2,
    body .rr-page .rr-cta-box h2 {
        max-width: 100% !important;
        font-size: clamp(1.85rem, 8vw, 2.35rem) !important;
        line-height: 1.1 !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }
    body .rr-page .rr-buttons {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-top: 24px !important;
        box-sizing: border-box !important;
    }
    body .rr-page .rr-buttons > .wp-block-button {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    body .rr-page .rr-buttons .wp-block-button__link {
        display: flex !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 50px;
        margin: 0 !important;
        padding: 13px 15px !important;
        align-items: center;
        justify-content: center;
        text-align: center !important;
        box-sizing: border-box !important;
        font-size: clamp(.93rem, 3.9vw, 1.03rem) !important;
        line-height: 1.32 !important;
        overflow-wrap: break-word !important;
    }
    body .rr-page :is(.rr-guide-card-image img, .rr-home-guide-image img,
        .rr-highlight figure img, .rr-work-detail-image img,
        .rr-category-gallery-image img, .rr-work-subpage-main-image img) {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 380px !important;
        object-fit: cover !important;
    }
    body .rr-page .rr-contact-info,
    body .rr-page .rr-contact-form-box {
        padding: 22px 18px !important;
    }
    body .rr-page .rr-contact-form {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    body .rr-page .rr-contact-form :is(input, textarea, select, button) {
        box-sizing: border-box !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    body .rr-page .rr-home-contact-links :is(p, a),
    body .rr-page .rr-contact-point :is(p, a),
    body .rr-site-footer :is(p, a) {
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }
    body .rr-page .rrm-showcase {
        padding: 56px 0 !important;
    }
    body .rr-page .rrm-showcase-inner {
        padding: 0 clamp(16px, 5vw, 22px) !important;
    }
    body .rr-page .rrm-showcase-head { margin-bottom: 26px; }
    body .rr-page .rrm-showcase h2 {
        font-size: clamp(2rem, 8.5vw, 2.55rem) !important;
    }
    body .rr-page .rrm-showcase-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px;
    }
    body .rr-page .rrm-showcase-copy { padding: 20px; }
    body .rr-page .rrm-showcase-image { height: 100% !important; }
    body .rr-page .rrm-showcase-more { text-align: left; }
    body .rr-site-header .rr-header-inner,
    body .rr-site-footer .rr-footer-inner {
        width: 100% !important;
        max-width: 100% !important;
        padding-inline: clamp(16px, 5vw, 24px) !important;
        box-sizing: border-box !important;
    }
    body .rr-site-footer .rr-footer-columns {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 25px !important;
    }
}

@media (max-width: 359px) {
    body .rr-page .rr-work-hub-title,
    body .rr-page .rr-service-card h3,
    body .rr-page .rr-guide-card-copy h3 { font-size: 1.34rem !important; }
    body .rr-page .rr-hero-title,
    body .rr-page .rr-guide-title,
    body .rr-page .rr-works-title { font-size: 2rem !important; }
    body .rr-page .rrm-showcase-copy { padding: 18px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    body .rr-page .rrm-showcase-image { transition: none; }
}
