/* style.css */

:root {
    --primary-color: #2E7D32;
    --primary-dark: #1B5E20;
    --text-heading: #1F2937;
    --text-body: #374151;
    --light-gray: #f8f9fa;
    --text-color: var(--text-body);
    --font-family: 'Poppins', sans-serif;
    --muted: #6B7280;
    --nav-shadow: 0 1px 2px rgba(0,0,0,0.45);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-xl: 0 12px 28px rgba(0,0,0,0.06);
    --shadow-2xl: 0 15px 30px rgba(0,0,0,0.1);
    --shadow-hover: 0 16px 32px rgba(0,0,0,0.1);
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    margin: 0 !important;
    padding-top: 0 !important;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    font-weight: 700;
}

.navbar {
    height: 50px;
    min-height: 50px;
    padding-top: 0;
    padding-bottom: 0;
    background-color: transparent;
    transition: background-color 200ms ease, box-shadow 200ms ease, color 200ms ease;
    z-index: 1020;
}

.section-title {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    font-weight: 800;
    margin: 2.5rem 0 2.5rem 0;
    position: relative;
    padding-bottom: 10px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
}

.page-title {
    font-weight: 800;
    margin-bottom: 1.25rem;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
    text-align: center !important;
    width: 100%;
}
.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
}

.card h5 {
    color: var(--text-heading);
    font-weight: 700;
}

.card .card-title {
    color: var(--text-heading);
    font-weight: 700;
    display: block;
    min-height: 3.2rem;
}

p, li, .lead { color: var(--text-body); }

.page-content {
    padding-top: 0;
    padding-bottom: 4rem;
}
.navbar-hidden {
    transform: translateY(-120%);
    transition: transform 260ms cubic-bezier(.2,.9,.2,1);
    will-change: transform;
}

.navbar-brand {
    font-weight: 700;
    text-shadow: var(--nav-shadow);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
}
.navbar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
}
.nav-link {
    font-weight: 700;
    transition: color 180ms ease, opacity 180ms ease, text-shadow 180ms ease;
    text-shadow: var(--nav-shadow);
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}
.navbar-nav .nav-link { margin: 0 22px; }
.navbar-nav .nav-item { margin: 0 4px; }

.navbar .nav-link:focus { outline: none; box-shadow: none; }
.navbar .nav-link:focus-visible {
    box-shadow: 0 0 0 4px rgba(56,142,60,0.12);
    border-radius: 6px;
}

.navbar-scrolled {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.10);
}
.navbar-scrolled .navbar-brand,
.navbar-scrolled .nav-link { text-shadow: none; }

.navbar .container {
    background-color: transparent;
    height: 50px;
}
.navbar .navbar-brand, .navbar .navbar-nav .nav-link {
    color: var(--primary-color);
}
.navbar .navbar-brand:hover,
.navbar .navbar-brand:focus,
.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link:focus,
.navbar .navbar-nav .nav-link:active {
    color: var(--primary-dark);
    font-weight: 700;
    opacity: 1;
    text-decoration: none;
}

.navbar-toggler {
    border: none;
    padding: 0.25rem 0.5rem;
    background: transparent;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
}

.navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='%23388E3C' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

.navbar-toggler .navbar-toggler-text {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
    line-height: 1;
}

.navbar-toggler .navbar-toggler-text.d-md-none {
    display: inline-block;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(72, 180, 97, 0.12);
    outline: none;
}

@media (max-width: 991.98px) {
    .navbar,
    .navbar .container {
        flex-wrap: nowrap;
    }

    .navbar .container {
        max-width: 100%;
        gap: 0.5rem;
    }

    .navbar-brand {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    .navbar-brand span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: clamp(0.78rem, 3.4vw, 1rem);
    }

    .navbar-toggler {
        flex: 0 0 auto;
        margin-left: auto;
        min-width: 44px;
        min-height: 44px;
        justify-content: center;
    }

    .navbar-collapse {
        position: absolute;
        top: 50px;
        left: 12px;
        right: 12px;
        margin-top: 0.75rem;
        padding: 0.75rem 0.9rem;
        border-radius: 8px;
        background: #fff;
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        box-shadow: var(--shadow-lg);
        z-index: 1040;
    }

    .navbar-collapse .navbar-nav {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.25rem;
    }

    .navbar-nav .nav-link {
        margin: 0;
        width: 100%;
        padding: 0.6rem 0.75rem;
        text-shadow: none;
        display: block;
        white-space: nowrap;
        text-align: right;
    }

    .navbar-nav .nav-item {
        margin: 0;
    }
}

@media (max-width: 575.98px) {
    .navbar-logo {
        width: 34px;
        height: 34px;
    }

    .navbar-toggler .navbar-toggler-text.d-md-none {
        display: none;
    }
}

.hero-home {
    background-image: url('../immagini/comuni/HERO_home-800w.jpg');
    background-image: image-set(url('../immagini/comuni/HERO_home-800w.webp') type('image/webp'), url('../immagini/comuni/HERO_home-800w.jpg') type('image/jpeg'));
}
.hero-about {
    background-image: url('../immagini/comuni/HERO_about-800w.jpg');
    background-image: image-set(url('../immagini/comuni/HERO_about-800w.webp') type('image/webp'), url('../immagini/comuni/HERO_about-800w.jpg') type('image/jpeg'));
}
.hero-services {
    background-image: url('../immagini/comuni/HERO_services-800w.jpg');
    background-image: image-set(url('../immagini/comuni/HERO_services-800w.webp') type('image/webp'), url('../immagini/comuni/HERO_services-800w.jpg') type('image/jpeg'));
}
.hero-blog {
    background-image: url('../immagini/comuni/HERO_blog-800w.jpg');
    background-image: image-set(url('../immagini/comuni/HERO_blog-800w.webp') type('image/webp'), url('../immagini/comuni/HERO_blog-800w.jpg') type('image/jpeg'));
}
.hero-contact {
    background-image: url('../immagini/comuni/HERO_contact-800w.jpg');
    background-image: image-set(url('../immagini/comuni/HERO_contact-800w.webp') type('image/webp'), url('../immagini/comuni/HERO_contact-800w.jpg') type('image/jpeg'));
}

@media (min-width: 768px) {
    .hero-home { background-image: url('../immagini/comuni/HERO_home-1200w.jpg'); background-image: image-set(url('../immagini/comuni/HERO_home-1200w.webp') type('image/webp'), url('../immagini/comuni/HERO_home-1200w.jpg') type('image/jpeg')); }
    .hero-about { background-image: url('../immagini/comuni/HERO_about-1200w.jpg'); background-image: image-set(url('../immagini/comuni/HERO_about-1200w.webp') type('image/webp'), url('../immagini/comuni/HERO_about-1200w.jpg') type('image/jpeg')); }
    .hero-services { background-image: url('../immagini/comuni/HERO_services-1200w.jpg'); background-image: image-set(url('../immagini/comuni/HERO_services-1200w.webp') type('image/webp'), url('../immagini/comuni/HERO_services-1200w.jpg') type('image/jpeg')); }
    .hero-blog { background-image: url('../immagini/comuni/HERO_blog-1200w.jpg'); background-image: image-set(url('../immagini/comuni/HERO_blog-1200w.webp') type('image/webp'), url('../immagini/comuni/HERO_blog-1200w.jpg') type('image/jpeg')); }
    .hero-contact { background-image: url('../immagini/comuni/HERO_contact-1200w.jpg'); background-image: image-set(url('../immagini/comuni/HERO_contact-1200w.webp') type('image/webp'), url('../immagini/comuni/HERO_contact-1200w.jpg') type('image/jpeg')); }
}

@media (min-width: 1200px) {
    .hero-home { background-image: url('../immagini/comuni/HERO_home-1600w.jpg'); background-image: image-set(url('../immagini/comuni/HERO_home-1600w.webp') type('image/webp'), url('../immagini/comuni/HERO_home-1600w.jpg') type('image/jpeg')); }
    .hero-about { background-image: url('../immagini/comuni/HERO_about-1600w.jpg'); background-image: image-set(url('../immagini/comuni/HERO_about-1600w.webp') type('image/webp'), url('../immagini/comuni/HERO_about-1600w.jpg') type('image/jpeg')); }
    .hero-services { background-image: url('../immagini/comuni/HERO_services-1600w.jpg'); background-image: image-set(url('../immagini/comuni/HERO_services-1600w.webp') type('image/webp'), url('../immagini/comuni/HERO_services-1600w.jpg') type('image/jpeg')); }
    .hero-blog { background-image: url('../immagini/comuni/HERO_blog-1600w.jpg'); background-image: image-set(url('../immagini/comuni/HERO_blog-1600w.webp') type('image/webp'), url('../immagini/comuni/HERO_blog-1600w.jpg') type('image/jpeg')); }
    .hero-contact { background-image: url('../immagini/comuni/HERO_contact-1200w.jpg'); background-image: image-set(url('../immagini/comuni/HERO_contact-1200w.webp') type('image/webp'), url('../immagini/comuni/HERO_contact-1200w.jpg') type('image/jpeg')); }
}

#hero { overflow: hidden; }

.hero-home, .hero-about, .hero-services, .hero-blog, .hero-contact {
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    align-items: center;
}
.hero-content {
    position: relative;
    z-index: 1;
    padding-top: 0 !important;
}

.hero-home, .hero-about, .hero-services, .hero-blog, .hero-contact { position: relative; }
.hero-home::before, .hero-about::before, .hero-services::before, .hero-blog::before, .hero-contact::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.25) 60%);
    z-index: 0;
}
@media (max-width: 991.98px) { .hero-home, .hero-about, .hero-services, .hero-blog, .hero-contact { min-height: 90vh; } }
#hero .display-3 {
    color: #fff !important;
    margin: 0 auto;
    max-width: min(22ch, 100%);
    font-size: clamp(2rem, 5.4vw, 4rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-wrap: balance;
    text-shadow: 0 1px 4px rgba(0,0,0,0.55), 0 8px 24px rgba(0,0,0,0.35);
}

#hero .lead {
    color: rgba(255,255,255,0.9) !important;
    margin: 1rem auto 0;
    max-width: min(62ch, 100%);
    font-size: clamp(1.03rem, 0.8vw + 0.9rem, 1.35rem);
    line-height: 1.5;
    text-wrap: pretty;
    text-shadow: 0 1px 3px rgba(0,0,0,0.45), 0 5px 16px rgba(0,0,0,0.28);
}

@media (max-width: 575.98px) {
    #hero .display-3 {
        max-width: min(16ch, 100%);
        line-height: 1.12;
    }

    #hero .lead {
        max-width: min(34ch, 100%);
    }
}

main#main > section {
    background-color: var(--light-gray);
}

.card {
    background-color: #fff;
}

body:not(.home) main#main {
    background-color: var(--light-gray);
}
body:not(.home) main#main > section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}
footer {
    margin-top: 0;
}

#about .img-fluid { max-width: 350px; border: 5px solid #fff; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

#about .about-video-card {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}
#about .about-video-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-2xl);
}

#about .about-text-block {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    max-width: 720px;
    min-width: 0;
    margin: 0 auto;
}

#about .about-sync-row {
    align-items: center;
    justify-content: center;
    row-gap: 1.75rem;
}

#about .about-sync-row .about-video-card {
    flex: 0 0 auto;
}

#about .about-text-block .h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

#about .about-text-block p {
    margin-bottom: 0.75rem;
}

#about .about-text-block p:last-child {
    margin-bottom: 0;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    #about .about-video-card {
        max-width: 240px;
    }

    #about .about-text-block {
        max-width: 620px;
    }
}

@media (min-width: 992px) {
    #about .about-sync-row {
        align-items: flex-start;
    }

    #about .about-video-card {
        max-width: 320px;
    }

    #about .about-text-block {
        max-width: 560px;
        margin: 0;
    }
}

.about-section-alt {
    background: var(--light-gray);
}

.section-subtitle {
    max-width: 760px;
    color: var(--muted);
    margin-bottom: 0;
}

.about-card {
    border-radius: 18px;
    transition: transform 220ms ease, box-shadow 220ms ease;
}

.about-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 34px rgba(0,0,0,0.08) !important;
}

.about-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(76,175,80,0.12);
    color: var(--primary-dark);
    font-size: 1.5rem;
}

.about-panel {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.05);
}

.about-checklist li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
    color: var(--text-body);
}

.about-checklist li:last-child {
    margin-bottom: 0;
}

.about-checklist i {
    color: var(--primary-dark);
    font-size: 1.15rem;
    line-height: 1.4;
    flex-shrink: 0;
}

.about-cta-panel {
    background: #fff;
    border: 1px solid rgba(56,142,60,0.10);
}

.about-cta-panel .lead {
    color: var(--text-body);
}

#about-preview .row { align-items: center !important; }
#about-preview .about-preview-media { display: flex; }
#about-preview .about-preview-copy > .btn {
    display: table;
    margin-left: auto;
    margin-right: auto;
}

body.home #services-preview .card,
body.home #blog .card {
    background-color: #edf6ee !important;
    border: 1px solid rgba(46,125,50,0.20) !important;
    box-shadow: 0 8px 24px rgba(27,94,32,0.12) !important;
    color-scheme: only light;
}

#services .card,
#services-preview .card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
#services .card:hover,
#services-preview .card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important; }
.service-icon { width: 80px; color: var(--primary-color); display: block; margin: 0 auto 0.75rem; font-size: 56px; line-height: 1; }

#services .card .service-icon,
#services .card img:not(.service-article-image),
#services-preview .card .service-icon,
#services-preview .card img {
    display: block;
    margin: 0 auto 0.75rem;
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

.card .service-icon, .card img {
    max-width: 100%;
    height: auto;
}
.bi { color: var(--primary-color); }

#blog .card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
#blog .card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important; }
#blog .card-img-top { height: 200px; object-fit: cover; }

/* Blog page: editorial article list layout */
body.blog-page #blog .blog-article-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

body.blog-page #blog .blog-article-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    height: 260px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 1.25rem;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

body.blog-page #blog .blog-article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover) !important;
}

body.blog-page #blog .blog-article-image {
    display: block;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    height: 100%;
    object-fit: cover;
    border-radius: 16px 0 0 16px;
}

body.blog-page #blog .blog-article-content {
    padding: 0.85rem 1rem;
    display: grid !important;
    grid-template-rows: auto auto auto;
    align-items: center;
    row-gap: 0.1rem;
}

body.blog-page #blog .blog-article-content .card-title {
    align-self: start;
    margin-bottom: 0;
    min-height: auto;
    line-height: 1.2;
    font-size: 1.28rem;
    font-weight: 700;
}

body.blog-page #blog .blog-article-content .card-text {
    align-self: center;
    margin-bottom: 0;
    line-height: 1.45;
    font-size: 0.98rem;
    max-height: calc(1.45em * 5);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.blog-page #blog .blog-article-content .card-actions {
    justify-self: end;
    align-self: end;
    margin-top: 0;
}

body.blog-page #blog .blog-article-content .card-actions .btn {
    padding: 7px 18px;
    font-size: 0.9rem;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    body.blog-page #blog .blog-article-card {
        grid-template-columns: 235px 1fr;
        height: 235px;
        margin-bottom: 1rem;
    }

    body.blog-page #blog .blog-article-image {
        display: block;
        width: 235px;
        min-width: 235px;
        max-width: 235px;
        height: 100%;
    }

    body.blog-page #blog .blog-article-content {
        padding: 0.75rem 0.85rem;
        row-gap: 0.1rem;
    }

    body.blog-page #blog .blog-article-content .card-title {
        font-size: 1.15rem;
    }

    body.blog-page #blog .blog-article-content .card-text {
        font-size: 0.94rem;
        max-height: calc(1.45em * 4);
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }
}

@media (max-width: 767.98px) {
    body.blog-page #blog .blog-article-card {
        display: flex;
        flex-direction: column;
        height: auto;
        margin-bottom: 1rem;
    }

    body.blog-page #blog .blog-article-image {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: 220px;
        border-radius: 16px 16px 0 0;
    }

    body.blog-page #blog .blog-article-content {
        padding: 1.2rem 1.1rem 1.35rem;
    }

    body.blog-page #blog .blog-article-content .card-text {
        margin-bottom: 1rem;
        max-height: calc(1.45em * 4);
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }
}

body.blog-page .blog-article-modal .modal-content {
    border-radius: 16px;
}

body.blog-page .blog-article-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

body.blog-page .blog-article-modal .article-story-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    grid-template-areas: "copy media";
    gap: 1.5rem;
    align-items: center;
}

body.blog-page .blog-article-modal .article-story-section--reverse {
    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1fr);
    grid-template-areas: "media copy";
}

body.blog-page .blog-article-modal .article-story-section--full {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy";
}

body.blog-page .blog-article-modal .article-story-copy {
    grid-area: copy;
}

body.blog-page .blog-article-modal .article-story-copy h4 {
    margin-top: 0;
    margin-bottom: 0.55rem;
}

body.blog-page .blog-article-modal .article-story-media {
    grid-area: media;
    margin: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.45rem;
}

body.blog-page .blog-article-modal .article-story-media img {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: cover;
    border-radius: 18px;
}

body.blog-page .blog-article-modal .article-story-media figcaption {
    font-size: 0.88rem;
    line-height: 1.4;
    color: var(--text-body);
    text-align: center;
    padding: 0 0.35rem;
}

body.blog-page .blog-article-modal .article-story-section--full .article-story-copy {
    max-width: 100%;
}

body.blog-page .blog-article-modal .article-story-copy p:last-child {
    margin-bottom: 0;
}

@media (max-width: 991.98px) {
    body.blog-page .blog-article-modal .article-story-section,
    body.blog-page .blog-article-modal .article-story-section--reverse {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "media"
            "copy";
    }

    body.blog-page .blog-article-modal .article-story-media {
        max-width: 680px;
        justify-self: center;
    }
}

@media (max-width: 767.98px) {
    body.blog-page .blog-article-modal .modal-body {
        gap: 1.25rem;
    }

    body.blog-page .blog-article-modal .article-story-section {
        gap: 1rem;
    }

    body.blog-page .blog-article-modal .article-story-media img {
        max-height: 300px;
    }
}

/* Services page: editorial article list layout (same as blog) */
body.services-page #services .service-article-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

body.services-page #services .service-article-card {
    display: grid;
    grid-template-columns: 260px 1fr;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    height: auto;
    min-height: 200px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 1.25rem;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

body.services-page #services .service-article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover) !important;
}

body.services-page #services .service-article-image-wrap {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    height: auto;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px 0 0 16px;
    flex-shrink: 0;
}

body.services-page #services .service-article-image {
    display: block;
    width: 200px;
    height: 200px;
    object-fit: contain;
}

body.services-page #services .service-article-content {
    padding: 1rem 1rem;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.35rem;
}

body.services-page #services .service-article-content .card-title {
    align-self: start;
    margin-bottom: 0;
    min-height: auto;
    line-height: 1.2;
    font-size: 1.28rem;
    font-weight: 700;
}

body.services-page #services .service-article-content .card-text {
    align-self: center;
    margin-bottom: 0;
    line-height: 1.45;
    font-size: 0.98rem;
    max-height: calc(1.45em * 3);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 3.25rem;
}

body.services-page #services .service-article-content .card-actions .btn {
    padding: 7px 18px;
    font-size: 0.9rem;
}

body.services-page #services .service-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

body.services-page #services .service-card-head .card-title {
    margin-top: 0;
}



body.services-page #services .service-article-content .card-actions {
    justify-self: end;
    align-self: stretch;
    display: flex;
    justify-content: flex-end;
    margin-top: 0.1rem;
}

body.services-page #services .service-submenu {
    margin-top: 0.4rem;
    border-top: 1px solid rgba(0,0,0,0.08);
    padding-top: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

body.services-page #services .service-article-card:has(.service-submenu) {
    cursor: pointer;
}

body.services-page #services .service-article-card:has(.service-submenu) a,
body.services-page #services .service-article-card:has(.service-submenu) button {
    cursor: pointer;
}

body.services-page #services .service-submenu-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    column-gap: 0.7rem;
    align-items: start;
    background: rgba(255,255,255,0.58);
    border-radius: 10px;
    padding: 0.35rem 0.45rem;
}

body.services-page #services .service-submenu-media-spacer {
    width: 56px;
    min-height: 1px;
}

body.services-page #services .service-submenu-title {
    margin: 0;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.35;
    font-size: 1.05rem;
}

body.services-page #services .service-submenu-description {
    margin: 0.15rem 0 0;
    color: var(--text-body);
    font-size: 0.93rem;
    line-height: 1.45;
}

body.services-page #services .service-submenu-cta {
    display: none;
    justify-content: flex-end;
    margin-top: 0.2rem;
    width: 100%;
    padding-left: 0;
}

body.services-page #services .service-submenu-cta .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    text-align: center;
    white-space: nowrap;
    padding: 10px;
}

body.services-page #services .service-article-card.is-expanded {
    height: auto;
}

body.services-page #services .service-article-card.is-expanded .service-article-content .card-text {
    max-height: none;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
    text-overflow: initial;
}

body.services-page #services .service-article-card.is-expanded .service-submenu {
    animation: serviceSubmenuReveal 0.22s ease-out;
}

body.services-page #services .service-article-card.is-expanded .service-submenu-cta {
    display: flex;
}

body.services-page #services .service-submenu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(56,142,60,0.35);
    background: rgba(76,175,80,0.08);
    color: var(--primary-dark);
    transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

body.services-page #services .service-submenu-toggle:hover,
body.services-page #services .service-submenu-toggle:focus-visible {
    background: rgba(76,175,80,0.16);
    border-color: rgba(56,142,60,0.55);
    transform: translateY(-1px);
}

body.services-page #services .service-submenu-toggle:focus-visible {
    outline: 2px solid rgba(76,175,80,0.35);
    outline-offset: 2px;
}

body.services-page #services .service-submenu-toggle i {
    transition: transform 0.2s ease;
    font-size: 0.95rem;
}

body.services-page #services .service-article-card.is-expanded .service-submenu-toggle i {
    transform: rotate(180deg);
}

@keyframes serviceSubmenuReveal {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    body.services-page #services .service-article-card {
        grid-template-columns: 200px 1fr;
        min-height: 190px;
        margin-bottom: 1rem;
    }

    body.services-page #services .service-article-image-wrap {
        width: 200px;
        min-width: 200px;
        max-width: 200px;
        min-height: 190px;
        height: auto;
    }

    body.services-page #services .service-article-image {
        width: 110px;
        height: 110px;
    }

    body.services-page #services .service-article-content {
        padding: 0.85rem 0.85rem;
        row-gap: 0.1rem;
    }

    body.services-page #services .service-article-content .card-title {
        font-size: 1.15rem;
    }

    body.services-page #services .service-article-content .card-text {
        font-size: 0.94rem;
        max-height: calc(1.45em * 3);
        -webkit-line-clamp: 3;
        line-clamp: 3;
        padding-right: 2.6rem;
    }

    body.services-page #services .service-article-card.is-expanded {
        height: auto;
    }

}

@media (max-width: 767.98px) {
    body.services-page #services .service-article-card {
        display: flex;
        flex-direction: column;
        height: auto;
        margin-bottom: 1rem;
    }

    body.services-page #services .service-article-image-wrap {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: 200px;
        border-radius: 16px 16px 0 0;
    }

    body.services-page #services .service-article-image {
        width: 120px;
        height: 120px;
    }

    body.services-page #services .service-article-content {
        padding: 1.2rem 1.1rem 1.35rem;
    }

    body.services-page #services .service-article-content .card-text {
        margin-bottom: 1rem;
        max-height: calc(1.45em * 3);
        -webkit-line-clamp: 3;
        line-clamp: 3;
        padding-right: 0;
    }

    body.services-page #services .service-submenu-item {
        grid-template-columns: 36px minmax(0, 1fr);
        column-gap: 0.55rem;
        padding: 0.3rem 0.35rem;
    }

    body.services-page #services .service-submenu-media-spacer {
        width: 36px;
    }

    body.services-page #services .service-submenu-description {
        font-size: 0.9rem;
    }

    body.services-page #services .service-submenu-cta {
        padding-left: 0;
    }

    body.services-page #services .service-submenu-toggle {
        width: 32px;
        min-width: 32px;
        height: 32px;
    }

    body.services-page #services .service-submenu-cta .btn {
        width: auto;
    }
}

body.blog-page .blog-article-modal .modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

body.blog-page .blog-article-modal .modal-body {
    padding: 1.15rem 1.25rem 1.3rem;
}

body.blog-page .blog-article-modal .modal-body p,
body.blog-page .blog-article-modal .modal-body li {
    line-height: 1.62;
    color: var(--text-body);
}

body.blog-page .blog-article-modal .modal-body p {
    margin-bottom: 0.8rem;
}

body.blog-page .blog-article-modal .modal-body h4 {
    margin-top: 1.15rem;
    margin-bottom: 0.55rem;
    font-size: 1.2rem;
}

body.blog-page .blog-article-modal .modal-body ul {
    padding-left: 1.2rem;
    margin-bottom: 0.9rem;
}

input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 0.25rem rgba(76,175,80,0.18) !important; border-color: var(--primary-color) !important; }

/* -------------------------
   Componenti
   ------------------------- */
.btn-primary-theme, .btn-primary { 
    background-color: var(--primary-color); 
    border-color: var(--primary-color); 
    color: #fff; 
    font-weight: 700; 
    padding: 10px 30px; 
    border-radius: 8px;
    transition: background-color 0.18s ease, transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary-theme:hover, .btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(56,142,60,0.12);
}

/* Ensure focus outlines are accessible */
.btn:focus, .btn:active { outline: 3px solid rgba(76,175,80,0.18); outline-offset: 2px; }

/* Ensure Bootstrap 'primary' utilities follow the site theme (green) */
.text-primary, .text-primary:hover { color: var(--primary-color) !important; }

/* Inline body links */
a { color: var(--primary-color); text-decoration: none; }
a:hover, a:focus { color: var(--primary-dark); text-decoration: underline; }

/* Placeholder color */
::placeholder { color: var(--muted); opacity: 1; }
:-ms-input-placeholder { color: var(--muted); }
::-ms-input-placeholder { color: var(--muted); }

/* Focus outlines use theme green */
:focus { outline-color: var(--primary-color); }

*:not(svg) { color-scheme: light; }
.card .btn-lg { min-height: 56px; }
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-in.is-visible { opacity: 1; transform: translateY(0); }

/* Accessibility: visible keyboard focus and recognizable inline links. */
:focus-visible {
    outline: 3px solid var(--primary-dark) !important;
    outline-offset: 3px !important;
}

main p a:not(.btn),
main li a:not(.btn) {
    text-decoration: underline !important;
    text-underline-offset: 0.16em;
    text-decoration-thickness: 0.08em;
}

/* Honor the operating-system preference to reduce non-essential motion. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .fade-in {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Make cards with h-100 behave as vertical flex containers so actions can stick to bottom */
.card.h-100 {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.card.h-100 .card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}
.card-actions, .card .mt-auto {
    margin-top: auto;
}

/* Helper: make columns stretch so cards inside fill the column height
   Use by adding class `equalize` to the row containing cards (keeps selector scoped) */
.row.equalize > [class*="col-"] {
    display: flex;
    flex-direction: column;
}
.row.equalize > [class*="col-"] > .card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

#testimonials {
    overflow: visible;
}

.testimonial-card { background: #fff; border-radius: 16px; box-shadow: 0 2px 16px rgba(0,0,0,0.07); padding: 32px 40px; margin: 0 auto; max-width: 700px; width: 100%; height: 360px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.testimonial-text { font-size: 1.1rem; font-style: italic; margin-bottom: 1.2rem; display: -webkit-box; -webkit-line-clamp: 6; line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 768px) { .testimonial-text { -webkit-line-clamp: 5; line-clamp: 5; min-height: 6.5em; } }
.testimonial-author { font-weight: 600; margin-bottom: 0.5rem; color: var(--primary-dark); }
.testimonial-rating { font-size: 1.3rem; }
#testimonials .carousel-control-prev-icon, #testimonials .carousel-control-next-icon { background-color: var(--primary-color); border-radius: 50%; width: 2.5rem; height: 2.5rem; background-size: 50% 50%; }

/* Carousel control positioning */
#testimonialCarousel {
position: relative;
padding-left: 3.5rem;
padding-right: 3.5rem;
}

#testimonialCarousel .carousel-inner {
    height: 360px;
    overflow: hidden;
}

#testimonialCarousel .carousel-item {
    height: 360px;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

#testimonialCarousel .carousel-item > .testimonial-card {
    height: 100%;
}

#testimonialCarousel .testimonial-card {
    height: 360px;
}

#testimonialCarousel .carousel-control-prev,
#testimonialCarousel .carousel-control-next {
width: 48px;
height: 48px;
top: 50%;
transform: translateY(-50%);
opacity: 1;
background: none;
border: none;
}

#testimonialCarousel .carousel-control-prev { left: 0; }
#testimonialCarousel .carousel-control-next { right: 0; }

@media (max-width: 767.98px) {
#testimonialCarousel {
padding-left: 2.75rem;
padding-right: 2.75rem;
}

#testimonialCarousel .carousel-inner {
    height: 320px;
}

#testimonialCarousel .carousel-item {
    height: 320px;
}

#testimonialCarousel .testimonial-card {
    height: 320px;
    padding: 24px 22px;
}

#testimonialCarousel .testimonial-text {
    font-size: 1rem;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    min-height: 5.2em;
}
}

/* -------------------------
   Footer
   ------------------------- */
.footer-title { color: #fff !important; font-size: 1.15rem; font-weight: 700; }
#testimonials .container { max-width: 900px; width: 100%; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

@media (max-width: 767.98px) {
    .footer-custom .row,
    .footer-custom .row > [class*="col-"] {
        text-align: center !important;
    }

    .footer-custom a {
        overflow-wrap: anywhere;
    }
}

/* -------------------------
   Responsive
   ------------------------- */

/* Service/media responsive adjustments: scale icon-font and cap image height per breakpoint
   This keeps card headings aligned across rows without changing HTML structure. */
@media (min-width: 992px) {
    #about-preview .row {
        align-items: stretch !important;
    }

    #about-preview .about-preview-media {
        align-items: stretch;
        justify-content: center;
    }

    #about-preview .about-preview-media picture {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: center;
    }

    #about-preview .about-preview-media img {
        width: auto;
        height: 100%;
        max-height: 600px;
        object-fit: contain;
    }

    #about-preview .about-preview-copy {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    #about-preview .about-preview-copy > p {
        width: 100%;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 0;
        line-height: 1.75;
    }

    #about-preview .about-preview-copy > p + p {
        margin-top: 2rem;
    }

    #about-preview .about-preview-copy > .btn {
        margin-top: 2.5rem;
    }

    body.home #services-preview .card {
        background-color: #e3efe4 !important;
    }

    #services .card .service-icon,
    #services .card img:not(.service-article-image),
    #services-preview .card .service-icon,
    #services-preview .card img {
        max-height: 110px;
    }
    .service-icon { font-size: 72px; margin-bottom: 1rem; }

    body.home #services-preview .service-icon {
        width: 132px;
        max-height: 132px;
        border: 1px solid rgba(46,125,50,0.28);
        border-radius: 14px;
        box-shadow: 0 7px 18px rgba(27,94,32,0.16);
        filter: saturate(1.3) contrast(1.08);
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    #services .card .service-icon,
    #services .card img:not(.service-article-image),
    #services-preview .card .service-icon,
    #services-preview .card img {
        max-height: 92px;
    }
    .service-icon { font-size: 64px; margin-bottom: 0.9rem; }
}

@media (max-width: 767.98px) {
    #services .card .service-icon,
    #services .card img:not(.service-article-image),
    #services-preview .card .service-icon,
    #services-preview .card img {
        max-height: 64px;
    }
    .service-icon { font-size: 48px; margin-bottom: 0.5rem; }

    /* small screens: ensure equalize behavior disabled so cards stack naturally */
    .row.equalize > [class*="col-"] { display: block; }
    .row.equalize > [class*="col-"] > .card { flex: none; height: auto; }
    .card.h-100 { height: auto; }
}

/* Testimonial container tweaks for small screens kept below */
@media (max-width: 767.98px) { #testimonials .container { max-width: 100%; padding-left: 10px; padding-right: 10px; } }

/* Accessibility: Skip to content link */
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus, .skip-link:active { position: absolute; left: 1rem; top: 1rem; width: auto; height: auto; padding: 0.5rem 1rem; background: var(--primary-color); color: #fff; z-index: 1050; border-radius: 4px; text-decoration: none; }
