@charset "utf-8";

:root {
    --bp-phone: 480px;
    --bp-tablet: 768px;
    --bp-desktop: 1024px;
    --bp-wide: 1280px;
    --container-max: 1200px;
    --page-gutter: clamp(0.8rem, 3vw, 1.5rem);
    --tap-target: 44px;
    --navbar-height: clamp(4.5rem, 12vw, 5.25rem);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100%;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    font-size: clamp(0.95rem, 0.3vw + 0.9rem, 1rem);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

main,
section,
header,
footer,
article,
aside {
    width: 100%;
    max-width: 100%;
}

.container {
    width: min(100%, var(--container-max));
    margin-inline: auto;
    padding-inline: var(--page-gutter);
}

img,
svg,
picture,
video,
canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

iframe {
    display: block;
    max-width: 100%;
    border: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
li,
a {
    overflow-wrap: anywhere;
}

h1 {
    font-size: clamp(1.8rem, 6vw, 3.4rem);
    line-height: 1.15;
}

h2 {
    font-size: clamp(1.45rem, 4vw, 2.4rem);
    line-height: 1.2;
}

h3 {
    font-size: clamp(1.15rem, 3vw, 1.6rem);
    line-height: 1.3;
}

p,
li {
    font-size: clamp(0.95rem, 0.35vw + 0.9rem, 1.05rem);
    line-height: 1.65;
}

a,
button,
input,
select,
textarea {
    font: inherit;
    
}

a,
button,
[role="button"] {
    touch-action: manipulation;
  
}

:where(.nav-links a, .cta, .cta-button, .download-btn, .btn-main, .btn-event, .faq-header, .carousel-btn, .owl-dot, button, [type="button"], [type="submit"]) {
    min-width: var(--tap-target);
    min-height: var(--tap-target);
}

/* ===== NAVBAR ===== */
.navbar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: 100%;
    border-bottom: 2px solid #E22D2D;
    background: #ffffff;
    border-radius: 0;
    z-index: 1000;
    transition: all 0.35s ease;
}

.navbar.scrolled {
    top: 0.75rem;
    width: min(92%, 1100px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.2);
    border-radius: 999px;
}

.nav-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: var(--navbar-height);
    padding: 0.75rem clamp(0.85rem, 2.8vw, 2rem);
}

.logo {
    width: clamp(7.25rem, 16vw, 9rem);
    height: clamp(2.7rem, 6vw, 3.25rem) !important;
    object-fit: cover;
    object-position: center;
    transition: width 0.35s ease, height 0.35s ease;
}

.navbar.scrolled .logo {
    width: clamp(6.25rem, 13vw, 7.5rem);
    height: clamp(2.35rem, 5vw, 2.75rem) !important;
}

.nav-inner > a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--tap-target);
}

.hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tap-target);
    height: var(--tap-target);
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
}

.hamburger-lines {
    position: relative;
    width: 1.35rem;
    height: 2px;
    border-radius: 999px;
    background: #dc2626;
    display: block;
    transition: transform 0.2s ease;
}

.hamburger-lines::before,
.hamburger-lines::after {
    content: "";
    position: absolute;
    left: 0;
    width: 1.35rem;
    height: 2px;
    border-radius: 999px;
    background: #dc2626;
    transition: transform 0.2s ease, top 0.2s ease, opacity 0.2s ease;
}

.hamburger-lines::before {
    top: -7px;
}

.hamburger-lines::after {
    top: 7px;
}

.hamburger[aria-expanded="true"] .hamburger-lines {
    transform: rotate(45deg);
}

.hamburger[aria-expanded="true"] .hamburger-lines::before {
    top: 0;
    transform: rotate(90deg);
}

.hamburger[aria-expanded="true"] .hamburger-lines::after {
    top: 0;
    opacity: 0;
}

.nav-links {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: var(--page-gutter);
    right: var(--page-gutter);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0.75rem;
    list-style: none;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
    box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.45);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.24s ease, opacity 0.2s ease;
}

.nav-links.nav-open {
    max-height: min(70vh, 28rem);
    opacity: 1;
    pointer-events: auto;
}

.nav-links li {
    width: 100%;
}

.nav-links a {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.65rem 0.75rem;
    border-radius: 0.75rem;
    text-decoration: none;
    color: rgba(15, 23, 42, 0.85);
    font-size: clamp(0.9rem, 1.8vw, 1rem);
    font-weight: 700;
    line-height: 1.2;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-links a:hover {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
}

.cta {
    background: #dc2626 !important;
    color: #ffffff !important;
    border: 0;
    border-radius: 999px;
    padding: 0.65rem 1.1rem;
}

.cta:hover {
    background: #b91c1c;
    box-shadow: 0 0 10px #e3001b;
}

.navbar-spacer {
    height: var(--navbar-height);
}

/* ===== MEDIA WRAPPERS ===== */
.media-16x9,
.map-placeholder {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.media-16x9 > iframe,
.media-16x9 > video,
.map-placeholder iframe {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

/* ===== GLOBAL LAYOUT SAFETY ===== */
.wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    height: auto;
}

.col-image {
    min-height: clamp(14rem, 40vw, 24rem);
}

.main-layout,
.info-grid,
.journal-grid,
.about-floating-cards,
.info-columns-container,
.values-grid,
.footer-content,
.faq-grid,
.grid-organigramma,
.testimonials-carousel {
    width: 100%;
    max-width: 100%;
}

.main-layout,
.info-grid,
.journal-grid,
.about-floating-cards,
.info-columns-container,
.values-grid,
.footer-content,
.faq-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1rem, 3vw, 2rem);
}

.news-card,
.news-entry,
.cf-container,
.due-colonne,
.avis-stats-grid,
.meteo-grid {
    display: flex;
    flex-wrap: wrap;
}

.news-card {
    align-items: flex-start;
}

.news-thumb,
.news-entry__thumb {
    width: min(38vw, 7rem);
    min-width: 0;
}

.hero-section {
    min-height: clamp(18rem, 60vw, 38rem);
    height: auto;
}

.hero-text,
.hero-content,
.featured-article__content,
.col-content,
.column-body {
    padding: clamp(1rem, 3vw, 2.5rem);
}

.hero-clean {
    padding-block: clamp(4rem, 10vw, 6rem);
    background-attachment: scroll;
}

.avis-section {
    width: min(100%, 70rem);
    margin-inline: auto;
}

.avis-counter-wrapper,
.avis-suffix-percent::after {
    font-size: clamp(1.9rem, 5.5vw, 2.5rem);
}

.meteo-item {
    width: clamp(4.2rem, 22vw, 6.2rem);
    height: clamp(4.2rem, 22vw, 6.2rem);
    font-size: clamp(0.72rem, 2.4vw, 0.95rem);
}

.vita-testimonials-frame {
    min-height: 620px;
}

.section-title {
    font-size: clamp(1.1rem, 3vw, 1.7rem);
    white-space: nowrap;
}

@media (max-width: 479px) {
    .section-title {
        font-size: 1.2rem !important;
        align-text:left !important;
    }

    .section-title font {
        font-size: 2.2rem !important;
    }
}

.journal-brand h1 {
    font-size: clamp(2rem, 9vw, 4.1rem);
}

.featured-article__img {
    height: clamp(15rem, 56vw, 34rem);
}

.featured-article__content {
    left: clamp(1rem, 5vw, 3.1rem);
    right: clamp(1rem, 5vw, 3.1rem);
    bottom: clamp(1rem, 4vw, 3.1rem);
}

.featured-article__content h2 {
    font-size: clamp(1.4rem, 6vw, 3.2rem);
}

main[style] {
    width: min(100%, 56rem);
    margin-inline: auto !important;
    padding-inline: var(--page-gutter) !important;
}

@media (hover: none) {
    .testimonial-text {
        opacity: 1;
        max-height: 12rem;
    }

    .testimonial-card:hover,
    .card:hover,
    .value-card:hover,
    .faq:hover,
    .news-card:hover,
    .cf-card:hover {
        transform: none;
    }
}

@media (min-width: 480px) {
    .vita-testimonials-frame {
        min-height: 560px;
    }

    .news-thumb,
    .news-entry__thumb {
        width: min(32vw, 9rem);
    }
}

@media (min-width: 768px) {
    .hamburger {
        display: none;
    }

    .nav-links {
        position: static;
        left: auto;
        right: auto;
        top: auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: clamp(0.85rem, 1.8vw, 2rem);
        width: auto;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        max-height: none !important;
        overflow: visible;
        opacity: 1 !important;
        pointer-events: auto;
    }

    .nav-links li {
        width: auto;
    }

    .nav-links a {
        width: auto;
        padding: 0.5rem 0.25rem;
        background: transparent;
    }

    .cta {
        padding-inline: 1.25rem;
    }

    .main-layout {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    }

    .about-floating-cards,
    .grid-organigramma {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-content,
    .info-columns-container,
    .journal-grid,
    .faq-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .values-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vita-testimonials-frame {
        min-height: 520px;
    }
}

@media (min-width: 1024px) {
    .main-layout {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    }

    .info-grid {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    }

    .about-floating-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .journal-grid {
        grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
    }

    .footer-content {
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.8fr);
    }

    .wrapper {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        min-height: calc(100vh - var(--navbar-height));
    }
}

@media (min-width: 1280px) {
    .nav-inner {
        padding-inline: 2rem;
    }

    .info-grid,
    .main-layout,
    .journal-grid {
        gap: 2.5rem;
    }
}

/* ===== RESPONSIVE HARDENING ===== */
:where(body) {
    min-width: 0;
}

:where(.container, .section-inner, .faq-container, .max-w-7xl, .avis-right-column, .combined-widgets-container, #about) {
    width: min(100%, var(--container-max));
    max-width: 100%;
    margin-inline: auto;
    padding-inline: var(--page-gutter);
}

:where(.main-layout, .info-grid, .journal-grid, .about-floating-cards, .info-columns-container,
       .values-grid, .footer-content, .faq-grid, .grid-organigramma, .gallery-grid,
       .bilancio-grid, .cards-grid, .benefits-grid, .steps-grid, .intro-grid) > * {
    min-width: 0;
}

:where(.card, .value-card, .requirement-box, .info-column, .news-card, .news-entry, .sidebar-box,
       .activity-card, .benefit-card, .step-card, .bilancio-card, .faq, .cf-card) {
    max-width: 100%;
}

:where(.hero, .hero-section, #hero, .hero-clean, .hero-bilancio) {
    min-height: clamp(20rem, 62svh, 42rem);
    height: auto;
}

:where(.hero-text h1, .hero-content h1, .journal-brand h1) {
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

:where(.hero-text h1, .hero-content h1) {
    font-size: clamp(2rem, 9vw, 4rem);
}

:where(.hero-content p, .hero-text p, .section-lead) {
    font-size: clamp(1rem, 2.8vw, 1.25rem);
}

:where(.card, .requirement-box, .info-box, .sidebar-box, .activity-card, .benefit-card, .step-card,
       .intro-card, .cf-container, .cf-card, .footer-content, .faq-intro) {
    border-radius: clamp(0.75rem, 3vw, 1.5rem);
}

:where(.card, .requirement-box, .info-box, .sidebar-box, .activity-card, .benefit-card, .step-card,
       .intro-card, .cf-container, .cf-card, .column-body) {
    padding: clamp(1rem, 4vw, 2.5rem);
}

:where(.about-floating-cards, .info-columns-container, .values-grid, .gallery-grid,
       .bilancio-grid, .cards-grid, .benefits-grid, .steps-grid, .grid-organigramma,
       .journal-grid, .faq-grid) {
    gap: clamp(1rem, 3vw, 2rem);
}

:where(.news-card, .news-entry, .mini-event-item, .cf-container, .footer-social) {
    min-width: 0;
}

:where(.calendar-table, table) {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

:where(.calendar-table th, .calendar-table td) {
    padding-inline: 0.15rem;
}

:where(.calendar-controls) {
    gap: 0.5rem;
}

:where(.calendar-controls h3) {
    min-width: 0;
    text-align: center;
}

:where(.map-placeholder) {
    min-height: 16rem;
}

:where(.cinquex-mille-side-btn, .servizio-civile-side-btn) {
    max-width: calc(100vw - 1rem);
}

@media (max-width: 1180px) {
    footer.main-footer .footer-content {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.8fr) !important;
        gap: clamp(1.25rem, 3vw, 2.5rem) !important;
    }
}

@media (max-width: 900px) {
    :where(.main-layout, .info-grid, .journal-grid, .intro-grid, .info-columns-container,
           .footer-content, .faq-grid, .cf-container) {
        grid-template-columns: 1fr !important;
    }

    :where(.cf-container) {
        flex-direction: column;
        text-align: center;
    }

    :where(.cf-action) {
        width: 100%;
        justify-content: center;
    }

    footer.main-footer .footer-content {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 768px) {
    :root {
        --page-gutter: clamp(0.9rem, 4vw, 1.25rem);
    }

    :where(.hero, .hero-section, #hero, .hero-clean, .hero-bilancio) {
        min-height: clamp(18rem, 56svh, 34rem);
    }

    :where(.hero-section) {
        height: auto;
    }

    :where(.hero-text, .hero-content) {
        max-width: 100%;
        text-align: center;
    }

    :where(.avis-immagine-quadrati) {
        width: min(92%, 28rem) !important;
    }

    :where(.avis-section) {
        width: 100%;
    }

    :where(.combined-widgets-container) {
        padding-inline: var(--page-gutter);
    }

    :where(.blood-meteo, .donation-calendar-container) {
        min-width: 0;
        width: 100%;
    }

    :where(.meteo-grid) {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
    }

    :where(.meteo-item) {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        font-size: clamp(0.8rem, 3.5vw, 1rem);
    }

    :where(.news-card, .news-entry) {
        gap: 0.9rem;
    }

    :where(.news-thumb, .news-entry__thumb) {
        width: clamp(5.5rem, 30vw, 8rem) !important;
        min-width: 0 !important;
        height: auto;
        aspect-ratio: 4 / 3;
        flex: 0 0 clamp(5.5rem, 30vw, 8rem);
    }

    :where(.gallery-grid, .bilancio-grid, .grid-organigramma.presidenza-grid) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    :where(.top-left-logo img) {
        width: clamp(8rem, 34vw, 12rem);
    }

    :where(.page-nav-arrow) {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.1rem;
    }

    :where(.left-arrow) {
        left: 0.4rem;
    }

    :where(.right-arrow) {
        right: 0.4rem;
    }

    :where(.brand-slider) {
        width: 100%;
    }

    :where(.brand-title) {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }

    :where(.brand-group img) {
        height: clamp(4rem, 18vw, 6rem);
        margin-inline: clamp(1rem, 5vw, 2rem);
    }

    .hero-section,
    .hero,
    #hero,
    .hero-clean,
    .hero-bilancio {
        min-height: clamp(18rem, 56svh, 34rem);
        height: auto;
    }

    .hero-text h1,
    .hero-content h1 {
        font-size: clamp(2rem, 9vw, 3rem);
        letter-spacing: 0;
    }

    .avis-section {
        width: 100%;
    }

    .combined-widgets-container {
        padding-inline: var(--page-gutter);
    }

    .blood-meteo,
    .donation-calendar-container {
        min-width: 0;
        width: 100%;
    }

    .meteo-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
    }

    .meteo-item {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .news-thumb,
    .news-entry__thumb {
        width: clamp(5.5rem, 30vw, 8rem) !important;
        min-width: 0 !important;
        height: auto;
        aspect-ratio: 4 / 3;
        flex: 0 0 clamp(5.5rem, 30vw, 8rem);
    }

    .gallery-grid,
    .bilancio-grid,
    .grid-organigramma.presidenza-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 560px) {
    :where(.container, .section-inner, .faq-container, .max-w-7xl, .avis-right-column,
           .combined-widgets-container, #about) {
        padding-inline: var(--page-gutter);
    }

    :where(.masthead__meta, .pagination-container, .panel-meta, .calendar-controls) {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    :where(.news-entry, .mini-event-item) {
        flex-direction: column;
    }

    :where(.news-entry__thumb) {
        width: 100% !important;
        flex-basis: auto;
        min-height: 10rem;
    }

    :where(.meteo-grid) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    :where(.gallery-grid, .bilancio-grid, .grid-organigramma.presidenza-grid) {
        grid-template-columns: 1fr !important;
    }

    :where(.gallery-item) {
        height: clamp(12rem, 64vw, 18rem);
    }

    :where(.bilancio-card.featured .bilancio-poster, .poster-only .bilancio-poster, .bilancio-grid .bilancio-poster) {
        min-height: clamp(18rem, 115vw, 28rem) !important;
    }

    :where(.timeline) {
        padding-left: 2.2rem;
    }

    :where(.tl-dot) {
        left: -2.75rem;
    }

    :where(.faq-header) {
        align-items: flex-start;
    }

    :where(.faq-title) {
        padding-right: 1.8rem;
    }

    :where(.cinquex-mille-side-btn, .servizio-civile-side-btn) {
        top: auto;
        right: 0.75rem;
        bottom: 0.75rem;
        transform: none;
        padding: 0.7rem 0.85rem;
        border-radius: 999px;
        font-size: 0.85rem;
    }

    :where(.cinquex-mille-side-btn:hover, .servizio-civile-side-btn:hover,
           .cinquex-mille-side-btn:active, .servizio-civile-side-btn:active) {
        transform: none;
    }

    .news-entry,
    .mini-event-item {
        flex-direction: column;
    }

    .news-entry__thumb {
        width: 100% !important;
        flex-basis: auto;
        min-height: 10rem;
    }

    .meteo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-grid,
    .bilancio-grid,
    .grid-organigramma.presidenza-grid {
        grid-template-columns: 1fr !important;
    }

    .gallery-item {
        height: clamp(12rem, 64vw, 18rem);
    }

    .bilancio-card.featured .bilancio-poster,
    .poster-only .bilancio-poster,
    .bilancio-grid .bilancio-poster {
        min-height: clamp(18rem, 115vw, 28rem) !important;
    }

    .cinquex-mille-side-btn,
    .servizio-civile-side-btn {
        top: auto;
        right: 0.75rem;
        bottom: 0.75rem;
        transform: none;
        padding: 0.7rem 0.85rem;
        border-radius: 999px;
        font-size: 0.85rem;
    }

    .cinquex-mille-side-btn:hover,
    .servizio-civile-side-btn:hover,
    .cinquex-mille-side-btn:active,
    .servizio-civile-side-btn:active {
        transform: none;
    }
}

@media (max-width: 380px) {
    :where(.card, .requirement-box, .info-box, .sidebar-box, .activity-card, .benefit-card, .step-card,
           .intro-card, .cf-container, .cf-card, .column-body, .news-card) {
        padding: 0.95rem;
    }

    :where(.calendar-table th) {
        font-size: 0.65rem;
    }

    :where(.calendar-table td) {
        font-size: 0.85rem;
    }

    :where(.pagination) {
        flex-wrap: wrap;
    }
}

/* ===== SITE-WIDE MOBILE FIXES ===== */
.navbar {
    max-width: 100vw;
}

.nav-inner {
    width: min(100%, var(--container-max));
    margin-inline: auto;
}

.logo {
    object-fit: contain;
}

@media (max-width: 767px) {
    :root {
        --navbar-height: 4.75rem;
    }

    body.nav-menu-open {
        overflow: hidden;
    }

    .navbar,
    .navbar.scrolled {
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        width: 100% !important;
        transform: none !important;
        border-radius: 0 !important;
        border-left: 0 !important;
        border-right: 0 !important;
        background: #ffffff !important;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
        z-index: 2500;
    }

    .nav-inner {
        min-height: var(--navbar-height);
        padding: 0.6rem var(--page-gutter);
        flex-wrap: nowrap;
    }

    .nav-inner > a {
        flex: 0 1 auto;
        min-width: 0;
    }

    .logo,
    .navbar.scrolled .logo {
        width: clamp(6.5rem, 32vw, 8.5rem);
        height: 3rem !important;
    }

    .hamburger {
        flex: 0 0 var(--tap-target);
        position: relative;
        z-index: 2601;
    }

    .nav-links {
        position: fixed !important;
        top: calc(var(--navbar-height) + 0.45rem) !important;
        left: var(--page-gutter) !important;
        right: var(--page-gutter) !important;
        width: auto !important;
        max-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        z-index: 2600;
    }

    .nav-links.nav-open {
        max-height: calc(100svh - var(--navbar-height) - 1.2rem) !important;
        padding: 0.85rem !important;
    }

    .nav-links a {
        justify-content: center;
        min-height: 3rem;
        line-height: 1.2;
    }

    .navbar-spacer {
        height: var(--navbar-height);
    }
}

footer.main-footer {
    overflow: hidden;
}

footer.main-footer .footer-content,
.footer-content {
    width: min(100%, var(--container-max)) !important;
    max-width: 100% !important;
    margin-inline: auto !important;
}

footer.main-footer .footer-info,
footer.main-footer .footer-map-block,
footer.main-footer .footer-social,
footer.main-footer .footer-credits {
    min-width: 0;
}

footer.main-footer iframe,
footer.main-footer .map-placeholder {
    max-width: 100% !important;
}

@media (max-width: 900px) {
    footer.main-footer {
        padding: clamp(2rem, 8vw, 3rem) var(--page-gutter) !important;
    }

    footer.main-footer .footer-content,
    .footer-content {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1.5rem !important;
        text-align: center;
    }

    footer.main-footer .footer-social {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 560px) {
    footer.main-footer .map-placeholder {
        display: none !important;
    }

    footer.main-footer .footer-info p,
    footer.main-footer .footer-info a {
        overflow-wrap: anywhere;
    }
}

/* Home news and newsletter cards keep image left, text right on phones. */
.news-card,
.news-entry {
    flex-wrap: nowrap;
}

.news-body,
.news-entry__body {
    min-width: 0;
}

@media (max-width: 560px) {
    .news-card,
    .news-entry {
        flex-direction: row !important;
        align-items: flex-start;
    }

    .news-thumb,
    .news-entry__thumb {
        width: clamp(5.75rem, 29vw, 7rem) !important;
        min-width: clamp(5.75rem, 29vw, 7rem) !important;
        min-height: 0 !important;
        height: auto !important;
        aspect-ratio: 4 / 3;
        flex: 0 0 clamp(5.75rem, 29vw, 7rem) !important;
    }

    .news-body h3,
    .news-entry__body h4 {
        font-size: clamp(0.9rem, 3.8vw, 1.05rem);
        line-height: 1.25;
    }
}

/* News detail panel must sit above the mobile navbar and expose a clear back action. */
.panel-overlay {
    z-index: 3000 !important;
}

.detail-panel {
    z-index: 3001 !important;
    height: 100dvh;
    max-height: 100dvh;
    overscroll-behavior: contain;
}

@media (max-width: 640px) {
    .detail-panel {
        width: 100vw !important;
    }

    .panel-header {
        padding-top: max(14px, env(safe-area-inset-top));
    }

    .panel-close-btn {
        width: auto !important;
        min-width: 6.5rem;
        height: 2.6rem !important;
        padding: 0 0.9rem;
        border-radius: 999px !important;
        gap: 0.45rem;
    }

    .panel-close-btn::after {
        content: "Indietro";
        font-size: 0.9rem;
        font-weight: 800;
    }

    .panel-body {
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
}

/* ===== FINAL RESPONSIVE STABILIZERS ===== */
html,
body {
    min-width: 320px;
}

body.nav-menu-open,
body.news-panel-open {
    touch-action: none;
}

.navbar {
    isolation: isolate;
}

.nav-inner {
    max-width: var(--container-max);
}

.nav-links {
    min-width: 0;
}

.nav-links a {
    white-space: normal;
}

.hero-section {
    width: 100%;
    overflow: hidden;
}

.hero-video {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
}

footer.main-footer .footer-address {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
    color: #ffffff;
    font-weight: 700;
    line-height: 1.45;
}

footer.main-footer .footer-address span,
footer.main-footer .footer-address strong {
    overflow-wrap: anywhere;
}

footer.main-footer .footer-social {
    min-width: 0;
}

.panel-overlay,
.detail-panel {
    position: fixed !important;
}

.detail-panel {
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
}

.panel-close-btn {
    min-width: var(--tap-target);
    min-height: var(--tap-target);
}

.panel-text,
.panel-title,
.panel-meta {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 1024px) {
    .nav-inner {
        padding-inline: var(--page-gutter) !important;
    }

    .footer-content {
        grid-auto-flow: row;
    }
}

@media (max-width: 900px) {
    footer.main-footer .footer-address {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 767px) {
    .nav-links {
        display: flex !important;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-0.35rem);
        transition: max-height 0.28s ease, opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.28s;
    }

    .nav-links.nav-open {
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0s;
    }

    .nav-links li,
    .nav-links a {
        max-width: 100%;
    }

    .nav-links a {
        padding-inline: 0.7rem !important;
        font-size: 0.96rem !important;
    }

    .hero-section {
        min-height: auto !important;
        height: auto !important;
        aspect-ratio: 16 / 9;
        display: block !important;
        background: #000;
    }

    .hero-video {
        position: absolute !important;
        inset: 0 !important;
        object-fit: contain !important;
        background: #000;
    }

    .detail-panel {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
    }

    .panel-header {
        min-height: calc(var(--tap-target) + env(safe-area-inset-top));
        gap: 0.75rem;
    }

    .panel-section-label {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 560px) {
    .container {
        padding-inline: var(--page-gutter) !important;
    }

    .hero-section {
        aspect-ratio: 4 / 3;
    }

    .insta-side .news-thumb,
    .news-thumb,
    .news-entry__thumb {
        border-radius: 0.75rem !important;
    }

    footer.main-footer {
        padding-inline: var(--page-gutter) !important;
    }

    footer.main-footer .footer-content {
        padding-inline: 0 !important;
    }

    footer.main-footer .footer-social {
        gap: 0.9rem !important;
        font-size: 1.7rem !important;
    }
}

@media (max-width: 390px) {
    :root {
        --page-gutter: 0.75rem;
    }

    .nav-links a {
        font-size: 0.9rem !important;
    }

    .news-card,
    .news-entry {
        gap: 0.75rem !important;
    }

    .news-thumb,
    .news-entry__thumb {
        width: 5.25rem !important;
        min-width: 5.25rem !important;
        flex-basis: 5.25rem !important;
    }
}