/* ============================================================
   cristiancpz_026 — Template CSS
   Based on cristiancpz with modernized design, CSS Grid + Flexbox,
   accessibility (WCAG 2.1 AA), and Bootstrap 4 class compatibility.
   ============================================================ */

/* ----- 1. CUSTOM PROPERTIES ----- */
:root {
    /* Corporate colors */
    --color-primary: #012060;
    --color-primary-dark: #001040;
    --color-primary-light: #1a3a7a;
    --color-gold: #c3983d;
    --color-gold-light: #f1dc76;
    --color-gold-dark: #a7752a;
    --color-white: #ffffff;
    --color-black: #1a1a1a;
    --color-gray-100: #f8f9fa;
    --color-gray-200: #e9ecef;
    --color-gray-300: #dee2e6;
    --color-gray-400: #ced4da;
    --color-gray-500: #adb5bd;
    --color-gray-600: #6c757d;
    --color-gray-700: #495057;
    --color-gray-800: #343a40;
    --color-gray-900: #212529;
    --color-danger: #dc3545;
    --color-success: #28a745;
    --color-warning: #ffc107;
    --color-info: #17a2b8;
    --color-whatsapp: #25d366;

    /* Typography */
    --font-headings: 'Ubuntu', sans-serif;
    --font-body: 'Raleway', sans-serif;
    --font-size-base: clamp(0.938rem, 1vw + 0.5rem, 1rem);
    --font-size-sm: 0.875rem;
    --font-size-xs: 0.75rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --line-height-base: 1.7;
    --line-height-headings: 1.3;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Layout */
    --container-max: 1200px;
    --header-height: auto;
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-sm: 0.25rem;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --focus-ring: 0 0 0 3px rgba(1,32,96,0.3);
    --transition-base: 0.2s ease-in-out;

    /* Gold gradient */
    --gold-gradient: linear-gradient(180deg, var(--color-gold), var(--color-gold-light));
    --gold-gradient-text: linear-gradient(var(--color-gold), var(--color-gold-light));
}

/* ----- 2. RESET & BASE ----- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    font-weight: 500;
    line-height: var(--line-height-base);
    color: var(--color-gray-900);
    background-color: var(--color-white);
    text-align: left;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ----- 3. TYPOGRAPHY ----- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.menu > li > a {
    font-family: var(--font-headings);
    font-weight: 500;
    line-height: var(--line-height-headings);
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
    text-align: left;
}

/* Menu secondario (submenu) negli articoli — in linea senza bullet */
.menu.submenu {
    padding: 0;
    margin: 0 0 1rem 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}
.menu.submenu > li {
    list-style: none;
    margin: 0;
}
.menu.submenu > li > a {
    display: block;
    padding: 0.15rem 0.5rem;
    font-size: var(--font-size-sm);
    border: 1px solid var(--color-primary);
    border-radius: var(--border-radius);
    color: var(--color-primary);
    text-decoration: none;
    transition: background var(--transition-base), color var(--transition-base);
}
.menu.submenu > li > a:hover,
.menu.submenu > li > a:focus {
    background: var(--color-primary);
    color: var(--color-white);
}
.menu.submenu > li.active > a,
.menu.submenu > li.current > a {
    background: var(--color-primary);
    color: var(--color-white);
}

h1, .h1 { font-size: clamp(1.75rem, 2.5vw + 0.8rem, 2.5rem); }
h2, .h2 { font-size: clamp(1.1rem, 2.5vw + 0.2rem, 1.5rem); }
h3, .h3 { font-size: clamp(1rem, 2vw + 0.2rem, 1.25rem); margin-top: var(--spacing-xl); }
h4, .h4 { font-size: clamp(1.05rem, 1.2vw + 0.3rem, 1.25rem); margin-top: var(--spacing-lg); color: var(--color-primary); }
h5, .h5 { font-size: clamp(1rem, 1vw + 0.2rem, 1.1rem); }
h6, .h6, .rilievo { font-size: clamp(0.95rem, 0.8vw + 0.2rem, 1.05rem); color: var(--color-primary); }

h2.name { font-size: clamp(1.2rem, 2.5vw + 0.3rem, 1.6rem); }
h2 > a { font-size: clamp(1.1rem, 2.5vw + 0.2rem, 1.5rem); }

p { margin-top: 0; margin-bottom: var(--spacing-md); }
p.rilievo { color: var(--color-primary); font-size: 1.05rem; }

b, strong { font-weight: 700; }

a {
    color: #007bff;
    text-decoration: none;
    transition: color var(--transition-base);
    overflow-wrap: break-word;
    word-wrap: break-word;
}
a:hover {
    color: var(--color-gold-dark);
    text-decoration: underline;
}
/* Link hover inside main: darker (not gold) for readability on white backgrounds */
main a:hover {
    color: #0056b3;
}
a:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
    border-radius: 2px;
}

small, .small { font-size: 85%; }

ul, ol { padding-left: 1.5rem; }

blockquote {
    border-left: 4px solid var(--color-gold);
    padding-left: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    color: var(--color-gray-700);
    font-style: italic;
}

hr {
    border: 0;
    border-top: 1px solid var(--color-danger);
    width: 80%;
    clear: both;
    margin: var(--spacing-lg) auto;
}

/* ----- 4. CONTAINER ----- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
    width: 100%;
}
.container-fluid {
    width: 100%;
    padding-left: 5%;
    padding-right: 5%;
}

/* ----- 5. SKIP LINK (Accessibility) ----- */
.skip-link {
    position: absolute;
    top: -1000px;
    left: var(--spacing-md);
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    z-index: 10000;
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus {
    top: var(--spacing-sm);
    color: var(--color-white);
    text-decoration: none;
    outline: 2px solid var(--color-gold-light);
    outline-offset: 2px;
}

/* ----- 6. HEADER / SITE HEADER ----- */
.site-header {
    background: var(--color-primary);
    padding: var(--spacing-sm) 0;
    position: relative;
    z-index: 1000;
    border-bottom: 1px solid #dee2e6;
}

/* Hamburger toggle (mobile only) */
.nav-toggle {
    display: none;
    padding: 0.35rem 0.6rem;
    background: transparent;
    border: 1px solid var(--color-gold);
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-bottom: var(--spacing-sm);
}
.nav-toggle:focus {
    outline: 2px solid var(--color-gold-light);
    outline-offset: 2px;
}
.nav-toggle-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    content: '';
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(241,220,118,0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") center/1.5em no-repeat;
}

/* Header grid: 3 colonne ben distinte (social | logo | nav+lang) */
.header-grid {
    display: grid;
    grid-template-columns: 2fr 2fr 3fr;
    align-items: center;
    gap: var(--spacing-md);
}

/* Header cells */
.header-cell {
    display: flex;
    align-items: center;
}

/* Col 1: Social icons */
.header-social {
    display: flex;
    gap: 8px;
    align-items: center;
}
.header-social a {
    transition: color var(--transition-base), transform var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    /* Gradiente oro come nell'originale */
    background: linear-gradient(180deg, #f1dc76, #c3983d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #c3983d;
}
.header-social a:hover {
    text-decoration: none;
    transform: scale(1.1);
    /* Hover: gradient più chiaro */
    background: linear-gradient(180deg, #fff, #f1dc76);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #f1dc76;
}
.header-social .fa-2x { font-size: 2em; margin: 0; }

/* Col 2: Logo */
.header-logo {
    justify-content: center;
}
.header-logo a { text-decoration: none; }
.header-logo img.logo {
    max-width: 180px;
    height: auto;
    display: block;
}

/* Col 3: Menu + Lingua */
.header-nav-area {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}
/* Nav menu occupa tutta la prima riga */
.header-nav-area > .header-menu {
    flex: 0 0 100%;
}

/* Header menu wrapper: flex per tenere menu, ricerca e lingua in riga */
.header-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Menu list (Joomla output: ul.menu) */
.header-menu ul.menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    text-transform: uppercase;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
}
.header-menu ul.menu > li {
    position: relative;
    list-style: none;
}

/* Nav items / links — effetto sfumato oro come template originale */
.header-menu ul.menu > li > a,
.header-menu ul.menu > li > span {
    display: block;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-headings);
    font-weight: 500;
    font-size: 1rem;
    border-radius: var(--border-radius-sm);
    transition: background var(--transition-base), color var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    /* Gradiente oro come nell'originale */
    background: linear-gradient(180deg, #f1dc76, #c3983d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Fallback per browser che non supportano */
    color: #c3983d;
}
.header-menu ul.menu > li > a:hover,
.header-menu ul.menu > li > a:focus {
    text-decoration: underline;
}
.header-menu ul.menu > li.active > a,
.header-menu ul.menu > li.current > a {
    text-decoration: underline;
}

/* Dropdown toggle indicator */
.header-menu .dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.3em;
    vertical-align: 0.15em;
    content: '';
    border-top: 0.3em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
}

/* Dropdown menu (submenu) — bordo colore template originale #4d90fe */
.header-menu ul.menu ul.dropdown-menu,
.header-menu ul.menu ul.nav-child {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #000049;
    border: 1px solid #4d90fe;
    border-radius: var(--border-radius);
    padding: var(--spacing-xs) 0;
    min-width: 220px;
    z-index: 1050;
    list-style: none;
    box-shadow: var(--shadow-lg);
}

/* Ultima voce menu: dropdown allineato a destra (non esce dallo schermo) */
.header-menu ul.menu > li:last-child > ul.dropdown-menu,
.header-menu ul.menu > li:last-child > ul.nav-child {
    left: auto;
    right: 0;
}

/* Show dropdown on click (classe .open aggiunta via JS) */
.header-menu ul.menu li.open > ul.dropdown-menu,
.header-menu ul.menu li.open > ul.nav-child {
    display: block;
}

/* Dropdown items */
.header-menu ul.menu ul.dropdown-menu li {
    display: block;
}
.header-menu ul.menu ul.dropdown-menu a,
.header-menu ul.menu ul.dropdown-menu span {
    display: block;
    padding: 0.4rem 1rem;
    font-size: var(--font-size-base);
    font-weight: 400;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background var(--transition-base);
    text-decoration: none;
    /* Gradiente oro come menu principale */
    background: linear-gradient(180deg, #f1dc76, #c3983d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #c3983d;
}
.header-menu ul.menu ul.dropdown-menu a:hover,
.header-menu ul.menu ul.dropdown-menu a:focus {
    color: var(--color-white);
    -webkit-text-fill-color: var(--color-white);
    text-decoration: none;
}

/* Bandiere sottomenu (es. NEWS) allineate a sinistra del testo */
.header-menu ul.menu ul.dropdown-menu a img {
    display: inline;
    vertical-align: middle;
    margin-right: 7px;
}
.header-menu ul.menu ul.dropdown-menu a .image-title,
.header-menu ul.menu ul.dropdown-menu span.image-title {
    display: inline;
    vertical-align: middle;
}

/* GTranslate select in header */
.header-lang {
    display: flex;
    align-items: center;
}
.header-lang select.notranslate,
.header-lang .goog-te-combo {
    padding: 0.25rem;
    margin: 0;
    width: auto;
    max-width: 160px;
    border: 1px solid var(--color-gray-400);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
}

/* Wrapper search + lingua */
.header-nav-area #mod-finder-searchform {
    max-width: 360px;
    display: flex;
    align-items: center;
}
.header-nav-area .header-lang {
    max-width: 360px;
}
.header-nav-area #mod-finder-searchform .finder {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}
.header-nav-area #mod-finder-searchform .finder input#mod-finder-searchword {
    flex: 1 1 auto;
    min-width: 60px;
    width: auto;
    max-width: none;
}
/* Desktop: larghezza fissa input search e spazio riservato lingua */
@media (min-width: 992px) {
    .header-nav-area #mod-finder-searchform .finder input#mod-finder-searchword {
        width: 240px;
        max-width: 240px;
    }
    .header-nav-area .header-lang {
        min-width: 140px;
    }
}
.header-nav-area #mod-finder-searchform .finder button.btn {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0;
    border: 1px solid #17a2b8;
    border-radius: var(--border-radius-sm);
    background: transparent;
    color: #17a2b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-base), color var(--transition-base);
    font-size: 1rem;
}
.header-nav-area #mod-finder-searchform .finder button.btn:hover {
    background: #17a2b8;
    color: #fff;
}
.header-nav-area .header-lang select.notranslate,
.header-nav-area .header-lang .goog-te-combo {
    max-width: 160px;
}
/* Su mobile: search e lingua in colonna, piena larghezza */
@media (max-width: 991.98px) {
    .header-nav-area #mod-finder-searchform,
    .header-nav-area .header-lang {
        flex: 1;
        width: 100%;
    }
    .header-nav-area .header-lang select.notranslate,
    .header-nav-area .header-lang .goog-te-combo {
        width: 100%;
        max-width: none;
    }
}

/* Altezza uniforme per input, bottone e select */
.header-nav-area .finder input.form-control,
.header-nav-area .finder button.btn,
.header-lang select.notranslate,
.header-lang .goog-te-combo {
    height: 32px;
    font-size: var(--font-size-sm);
    line-height: 1.2;
    box-sizing: border-box;
}
.header-nav-area .finder input.form-control {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--color-gray-400);
    border-radius: var(--border-radius-sm);
    background: rgba(255,255,255,0.9);
    color: var(--color-gray-800);
}

/* Mobile: menu sempre visibile e in riga (nessun hamburger) */
@media (max-width: 991.98px) {
    .container {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }
    .header-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    .header-cell {
        justify-content: center;
    }
    .header-nav-area {
        flex-direction: column;
        width: 100%;
    }
    .header-menu ul.menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    .header-menu ul.menu > li > a,
    .header-menu ul.menu > li > span {
        padding: 0.3rem 0.5rem;
        font-size: 0.875rem;
    }
    .header-menu ul.menu > li:first-child > a,
    .header-menu ul.menu > li:first-child > span {
        padding-left: 0;
    }
    .header-menu ul.menu > li:last-child > a,
    .header-menu ul.menu > li:last-child > span {
        padding-right: 0;
    }
    /* Submenu mobile: allineato a sinistra, se esce dal viewport lo riposiziona JS */
    .header-menu ul.menu ul.dropdown-menu {
        position: absolute;
        left: 0;
        transform: none;
        white-space: normal;
        max-width: calc(100vw - 20px);
    }
    .header-menu ul.menu li:hover > ul.dropdown-menu,
    .header-menu ul.menu li:focus-within > ul.dropdown-menu {
        display: none;
    }
    .header-menu ul.menu li.open > ul.dropdown-menu {
        display: block;
    }
    /* Ultima voce: dropdown allineato a destra anche su mobile */
    .header-menu ul.menu > li:last-child > ul.dropdown-menu,
    .header-menu ul.menu > li:last-child > ul.nav-child {
        left: auto;
        right: 0;
    }
}

/* Desktop: nav in riga */
@media (min-width: 992px) {
    .header-menu ul.menu {
        flex-direction: row;
    }
}

/* ----- 7. JUMBOTRON / PAGE HERO ----- */
.jumbotron {
    padding: 2rem 1rem;
    margin-bottom: 0;
    background-color: var(--color-primary);
    border-radius: 0;
}
.jumbotron-fluid {
    padding-right: 0;
    padding-left: 0;
    border-radius: 0;
}
.jumbotron h1,
.jumbotron .lead {
    color: var(--color-gold);
    font-family: var(--font-headings);
    font-weight: 500;
    font-size: clamp(1rem, 2vw + 0.4rem, 1.4rem);
    margin: 0;
    text-align: left;
    line-height: 1.4;
}
.jumbotron .lead {
    font-size: clamp(0.9rem, 1.5vw + 0.3rem, 1.25rem);
    font-weight: 400;
}
/* Gold gradient global */
.txt-dorato {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--color-gold-light);
}
.jumbotron .txt-dorato {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: var(--color-gold-light);
}

/* ----- 8. SITE MAIN ----- */
.site-main {
    min-height: 400px;
    padding-top: var(--spacing-lg);
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: var(--spacing-lg);
}
.breadcrumb {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-gray-100);
    border-radius: var(--border-radius);
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    font-size: var(--font-size-sm);
}
.breadcrumb li { display: inline; }
.breadcrumb li + li::before {
    content: '/';
    padding: 0 var(--spacing-sm);
    color: var(--color-gray-500);
}
.breadcrumb a { color: var(--color-primary); }
.breadcrumb .active { color: var(--color-gray-600); }

/* ----- 9. MAIN CONTENT & SIDEBARS (HTML5/WCAG) ----- */

/* Content layout grid: semantic alternative to .row > .col-* */
.content-layout {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xl);
}
.content-layout.layout-full .content-main {
    flex: 0 0 100%;
    max-width: 100%;
}
.content-layout.layout-left .sidebar:first-child {
    flex: 0 0 280px;
    max-width: 280px;
}
.content-layout.layout-left .content-main {
    flex: 1 1 0;
    min-width: 0;
}
.content-layout.layout-right .content-main {
    flex: 1 1 0;
    min-width: 0;
}
.content-layout.layout-right .sidebar:last-child {
    flex: 0 0 280px;
    max-width: 280px;
}
.content-layout.layout-both .sidebar {
    flex: 0 0 240px;
    max-width: 240px;
}
.content-layout.layout-both .content-main {
    flex: 1 1 0;
    min-width: 0;
}

/* Content main column */
.content-main {
    min-height: 300px;
    padding-left: 15px;
    padding-right: 15px;
}

/* Sidebar */
.sidebar {
    min-width: 0;
    padding-left: 15px;
    padding-right: 15px;
}
.sidebar > div {
    margin-bottom: var(--spacing-lg);
}
.sidebar h3 {
    font-size: 1.1rem;
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-gold);
    padding-bottom: var(--spacing-sm);
    margin-top: 0;
}
.sidebar ul {
    list-style: none;
    padding-left: 0;
}
.sidebar ul li {
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--color-gray-200);
}
.sidebar ul li a {
    color: var(--color-primary-light);
    font-size: var(--font-size-sm);
}

/* Section modules (HTML5 semantic replacement for .row wrappers) */
/* Grid: 4 columns, .col-* classes are overridden (no Bootstrap layout needed) */
.section-module {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-bottom: var(--spacing-lg);
}
/* Nullify col-* flex/width when inside section-module (we use grid) */
.section-module > [class*="col-"] {
    flex: none;
    max-width: none;
    width: auto;
    padding: 0 15px;
}
/* Elements inside section-module without col-* class take full width */
.section-module > :not([class*="col-"]) {
    grid-column: 1 / -1;
}

/* Banner module */
.banner { text-align: center; }
/* Banner Canarie Italia: niente zoom */
.banner img[alt*="Canarie Italia"] {
    pointer-events: none;
    transform: none !important;
}

/* ----- 11. FOOTER ----- */
.site-footer {
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-2xl) 0 0;
    position: relative;
    font-size: var(--font-size-sm);
    font-weight: bold;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid rgba(255,255,255,0.15);
    margin-bottom: var(--spacing-xl);
}
.footer-grid > [class*="col-"] {
    flex: none;
    max-width: none;
    padding: 0 15px;
}

hr.txt-dorato {
  border-top: 1px solid;
  width: 30%;
}

/* Colonne moduli */
.footer-grid > * h3 {
    color: var(--color-gold);
    font-size: 1.05rem;
    margin-top: 0;
    border-bottom: 1px solid var(--color-gold);
    padding-bottom: var(--spacing-sm);
    font-family: var(--font-headings);
}
.footer-grid > * a {
    color: var(--color-gold);
}
.footer-grid > * a:hover {
    color: var(--color-white);
    text-decoration: underline;
}
.footer-grid > * ul {
    list-style: none;
    padding-left: 0;
}
.footer-grid > * ul li {
    padding: var(--spacing-xs) 0;
}

/* Terza colonna: social in riga + banner */
.footer-social {
    text-align: center;
}
.footer-social a {
    color: var(--color-gold);
    display: inline-block;
    margin: 0 4px;
}
.footer-social > a:hover {
    color: var(--color-gold-light);
    transform: scale(1.1);
}
.footer-social img {
    background: #fff;
    padding: 0.25rem 1rem;
    max-width: 100%;
    height: auto;
}

/* Footer info (company centrato) */
.footer-info {
    text-align: center;
    padding-bottom: var(--spacing-sm);
    line-height: 1.8;
}

/* Powered a sinistra */
.powered {
    font-size: smaller;
    text-align: left;
    padding-bottom: var(--spacing-lg);
}
a.powered {
    font-weight: bold;
    display: inline-block;
    transform: skewX(340deg);
    color: var(--color-white);
    text-decoration: none;
    font-size: unset;
    border: 1px solid var(--color-white);
    border-radius: 5px;
    padding: 0.1rem 0.4rem;
}
.pwb {
    background: var(--color-white);
    color: var(--color-primary);
    font-weight: inherit;
    border-radius: 4px 0 0 4px;
    padding: 0.18rem 0.2rem;
}
a.powered:hover {
    background: rgba(255,255,255,0.1);
    color: var(--color-white);
    text-decoration: none;
}

/* ----- 12. WHATSAPP FLOAT ----- */
.whatsapp-float {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 999;
}
.whatsapp-float > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    font-size: 1.8em;
    color: var(--color-white);
    background: var(--color-whatsapp);
    border-radius: 50%;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}
.whatsapp-float > a:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
    color: var(--color-white);
}
.whatsapp-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-white);
    color: var(--color-gray-800);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    white-space: nowrap;
    border: 2px solid transparent;
    border-image: var(--gold-gradient) 1;
    transition: opacity var(--transition-base), visibility var(--transition-base);
    pointer-events: none;
}
.whatsapp-float:hover .whatsapp-tooltip {
    visibility: visible;
    opacity: 1;
}

/* ----- 13. BACK TO TOP ----- */
.back-to-top {
    position: fixed;
    bottom: 18px;
    right: 20px;
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--color-primary);
    color: var(--color-gold);
    border: 2px solid var(--color-gold);
    border-radius: 50%;
    z-index: 999;
    transition: background var(--transition-base), transform var(--transition-base);
    text-decoration: none;
    font-size: 1.1rem;
}
.back-to-top:hover {
    background: var(--color-primary-light);
    color: var(--color-gold-light);
    transform: translateY(-3px);
    text-decoration: none;
}
.back-to-top:focus-visible {
    outline: 2px solid var(--color-gold-light);
    outline-offset: 2px;
}

/* ----- 14. BLOG / ARTICLES / CATEGORY GRID ----- */
.blog {
    float: none;
    width: 100%;
}
.blog-featured { width: 100%; }

.item-page { margin-bottom: var(--spacing-xl); }

/* Article images */
.item-image {
    margin-bottom: var(--spacing-md);
}
.item-image img,
.blog-card-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    display: block;
}

/* Article body */
[itemprop="articleBody"] { width: 100%; }
[itemprop="articleBody"] img,
.item-page img,
.blog img,
.blog-featured img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
}

/* --- Category card grid (CSS Grid) --- */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: var(--spacing-xl);
}

/* Single card */
.blog-card {
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: box-shadow var(--transition-base);
}
.blog-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.blog-card .item-image {
    margin: 0;
    line-height: 0;
}
.blog-card .item-image img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 0;
}

/* Card body */
.blog-card-body {
    padding: 0.75rem 1rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-title {
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    margin: 0 0 0.35rem;
    line-height: 1.3;
}
.blog-card-title a {
    color: var(--color-primary);
    text-decoration: none;
}
.blog-card-title a:hover {
    text-decoration: underline;
}

/* Card meta (date, category) */
.blog-card-meta {
    font-size: var(--font-size-xs);
    color: var(--color-gray-600);
    margin: 0 0 0.5rem;
    padding: 0;
    list-style: none;
}
.blog-card-meta dd {
    display: inline;
    margin-right: var(--spacing-sm);
}
.blog-card-meta dd + dd::before {
    content: '\00B7';
    margin-right: var(--spacing-sm);
}
.blog-card-meta a {
    color: var(--color-gray-600);
    text-decoration: underline;
}
.blog-card-meta a:hover {
    color: var(--color-primary);
}

/* Card intro text */
.blog-card-intro {
    font-size: var(--font-size-sm);
    line-height: 1.5;
    flex: 1;
    margin-bottom: 0.75rem;
}
.blog-card-intro h3 {
    font-weight: 400;
    font-size: clamp(0.85rem, 1.1vw + 0.1rem, 1rem);
    margin-top: 0;
    margin-bottom: 0.4rem;
}

/* Card readmore */
.blog-card-readmore {
    display: block;
    width: 100%;
    padding: 0.5rem;
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--border-radius);
    font-size: var(--font-size-xs);
    font-family: var(--font-headings);
    text-decoration: none;
    transition: background var(--transition-base);
    margin-top: auto;
    box-sizing: border-box;
    text-align: center;
}
.blog-card-readmore:hover {
    background: var(--color-primary-light);
    color: var(--color-white);
}

/* Cat-children */
.cat-children { margin-bottom: var(--spacing-xl); }

/* Links list (replacing nav-tabs) */
.blog-links-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--spacing-xl);
}
.blog-links-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--color-gray-300);
}
.blog-links-list li:last-child {
    border-bottom: none;
}
.blog-links-list a {
    color: var(--color-primary);
    text-decoration: none;
}
.blog-links-list a:hover {
    text-decoration: underline;
}

/* Article info block */
dl.article-info {
    font-size: var(--font-size-sm);
    color: var(--color-gray-600);
    margin: var(--spacing-sm) 0 var(--spacing-md);
}
dl.article-info dd {
    display: inline;
    margin-right: var(--spacing-md);
}
dl.article-info dd::before { content: '| '; }
dl.article-info dd:first-child::before { content: ''; }

/* Tags */
.btn-group { display: inline-flex; }
.tags {
    margin: var(--spacing-md) 0;
    padding: 0;
    list-style: none;
}
.tags li {
    display: inline;
    list-style: none;
}
.tags .label {
    display: inline-block;
    padding: 0.3em 0.7em;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-white);
    background: var(--color-primary);
    border-radius: var(--border-radius-sm);
    margin-right: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
    text-decoration: none;
}
.tags a {
    color: var(--color-white);
    text-decoration: none;
}
.tags a:hover {
    color: var(--color-gold-light);
    text-decoration: none;
}

/* ----- 15. PAGINATION ----- */
.pagination {
    display: flex;
    justify-content: center;
    margin: var(--spacing-xl) 0;
    list-style: none;
    padding-left: 0;
}
ul.pagination {
    margin: var(--spacing-xl) auto;
    justify-content: center;
}
.pagination li,
.page-item {
    margin: 0 2px;
}
.pagination a,
.page-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--color-primary);
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-base);
    text-decoration: none;
    font-size: var(--font-size-sm);
}
.pagination a:hover,
.page-link:hover {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}
.pagination .active a,
.pagination .active .page-link,
.page-item.active .page-link {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}
.pagination .disabled a,
.page-item.disabled .page-link {
    color: var(--color-gray-500);
    cursor: default;
    background: var(--color-gray-100);
}

.counter {
    text-align: center;
    color: var(--color-gray-600);
    font-size: var(--font-size-sm);
    margin: var(--spacing-xl) 0;
}

/* ----- 16. FORMS ----- */
.form-group {
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
}
.form-control,
.inputbox {
    display: block;
    width: 100%;
    height: 32px;
    padding: 0.25rem 0.5rem;
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    line-height: 1.2;
    color: var(--color-gray-900);
    background: var(--color-white);
    border: 1px solid var(--color-gray-400);
    border-radius: var(--border-radius-sm);
    box-sizing: border-box;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.form-control:focus,
.inputbox:focus {
    border-color: var(--color-primary);
    box-shadow: var(--focus-ring);
    outline: none;
}
.form-control-file {
    display: block;
    width: 100%;
}
.form-check-input {
    margin-right: var(--spacing-xs);
}
textarea.form-control,
textarea.inputbox {
    height: auto;
    min-height: 100px;
    resize: vertical;
}

/* Buttons */
.btn,
button.btn,
input[type="submit"].btn,
a.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-headings);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    transition: all var(--transition-base);
    user-select: none;
}
.btn-primary,
.btn,
.btn-primary:hover,
input.btn-inverse {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}
.btn-primary:hover,
.btn:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
    color: var(--color-white);
    text-decoration: none;
}
.btn:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

/* ----- 17. TABLES ----- */
.table {
    width: 100%;
    max-width: 100%;
    margin-bottom: var(--spacing-md);
    border-collapse: collapse;
}
.table th,
.table td {
    padding: var(--spacing-sm);
    vertical-align: top;
    border-top: 1px solid var(--color-gray-300);
    text-align: left;
}
.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid var(--color-gray-300);
    background: var(--color-gray-100);
}
.table-striped tbody tr:nth-of-type(odd) {
    background: var(--color-gray-100);
}
.table-bordered {
    border: 1px solid var(--color-gray-300);
}
.table-bordered th,
.table-bordered td {
    border: 1px solid var(--color-gray-300);
}
.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Category table */
table.category {
    width: 100%;
}

/* ----- 18. ALERTS & MESSAGES ----- */
.alert,
.message {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
}
.alert-info {
    color: #0c5460;
    background: #d1ecf1;
    border-color: #bee5eb;
}
.alert-success {
    color: #155724;
    background: #d4edda;
    border-color: #c3e6cb;
}
.alert-warning {
    color: #856404;
    background: #fff3cd;
    border-color: #ffeeba;
}
.alert-danger {
    color: #721c24;
    background: #f8d7da;
    border-color: #f5c6cb;
}

/* System messages */
#system-message {
    margin-bottom: var(--spacing-lg);
}

/* ----- 19. BADGES & LABELS ----- */
.badge,
.label {
    display: inline-block;
    padding: 0.25em 0.6em;
    font-size: 75%;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--border-radius-sm);
}
.badge-warning,
.label-warning {
    color: var(--color-gray-900);
    background: var(--color-warning);
}
.badge-info { background: var(--color-info); color: var(--color-white); }
.badge-success { background: var(--color-success); color: var(--color-white); }
.badge-danger { background: var(--color-danger); color: var(--color-white); }
.label { border-radius: var(--border-radius-sm); }

/* ----- 20. NAVS & LISTS (Bootstrap compat) ----- */
.nav {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}
.nav-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--color-primary-light);
    text-decoration: none;
    transition: color var(--transition-base);
}
.nav-link:hover {
    color: var(--color-gold-dark);
    text-decoration: none;
}
.nav-tabs {
    border-bottom: 1px solid var(--color-gray-300);
}
.nav-tabs .nav-link {
    border: 1px solid transparent;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    margin-bottom: -1px;
}
.nav-tabs .nav-link:hover {
    border-color: var(--color-gray-200) var(--color-gray-200) var(--color-gray-300);
}
.nav-stacked {
    flex-direction: column;
}
.nav-stacked .nav-link {
    border-radius: 0;
    border-bottom: 1px solid var(--color-gray-200);
}
.nav-pills .nav-link {
    border-radius: var(--border-radius);
}

/* List group */
.list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
}
.list-group-item {
    position: relative;
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
}
.list-group-item:first-child {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}
.list-group-item:last-child {
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

/* Search results — stile eredità cristiancpz */
.search-results {
    list-style: none;
    padding-left: 0;
}
.search-results .list-group-item {
    border: none !important;
    position: relative;
}
.search-results .list-group-item::after {
    content: '';
    position: absolute;
    width: 60vw;
    height: 1px;
    left: 12vw;
    display: block;
    clear: both;
    background-color: #dc3545;
    bottom: 0;
}
.result-title a {
    color: var(--color-primary, #0056b3);
    text-decoration: none;
}
.result-title a:hover {
    text-decoration: underline;
}
.result-text {
    margin: 0.25rem 0;
    font-size: var(--font-size-sm, 0.875rem);
    color: var(--color-gray-900, #222);
}
.result-url {
    font-size: 0.8rem;
    color: var(--color-gray-700, #555);
    word-break: break-all;
}

/* ----- 24. PAGE HEADER ----- */
.page-header {
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-gray-300);
    padding-bottom: var(--spacing-sm);
}

/* ----- 25. FIGURE & CAPTION ----- */
figure {
    margin: 0 0 var(--spacing-lg);
    position: relative;
    float: left;
}
figcaption {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-style: italic;
    font-size: 0.9rem;
    text-align: left;
    color: var(--color-gray-600);
}

/* ----- 26. IMAGE HELPERS ----- */
img {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
}
.img-fluid {
    max-width: 100%;
    height: auto;
}
.img-left {
    margin: var(--spacing-xs) var(--spacing-md) var(--spacing-xs) 0;
    float: left;
}
.img-right {
    margin: var(--spacing-xs) 0 var(--spacing-xs) var(--spacing-md);
    float: right;
}
.img-circle { border-radius: 50%; }
.img-thumbnail {
    padding: 0.25rem;
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--border-radius);
}
figure.img-left { margin: var(--spacing-xs) var(--spacing-md) var(--spacing-xs) 0; float: left; }
figure.img-right { margin: var(--spacing-xs) 0 var(--spacing-xs) var(--spacing-md); float: right; }

/* ----- 27. EMBED RESPONSIVE ----- */
.embed-responsive {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
}
.embed-responsive::before {
    display: block;
    content: '';
}
.embed-responsive-16by9::before { padding-top: 56.25%; }
.embed-responsive-4by3::before { padding-top: 75%; }
.embed-responsive iframe,
.embed-responsive embed,
.embed-responsive object,
.embed-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.blog iframe { max-width: 100%; }

/* ----- 28. GRID COMPATIBILITY (Bootstrap 4) ----- */
/* Flexbox-based grid for article content compatibility */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}
.row-fluid {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}
.row > [class*="col-"],
.row-fluid > [class*="col-"] {
    position: relative;
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

/* col- (all breakpoints) */
.col-1  { flex: 0 0 8.33333%;  max-width: 8.33333%; }
.col-2  { flex: 0 0 16.66667%; max-width: 16.66667%; }
.col-3  { flex: 0 0 25%;       max-width: 25%; }
.col-4  { flex: 0 0 33.33333%; max-width: 33.33333%; }
.col-5  { flex: 0 0 41.66667%; max-width: 41.66667%; }
.col-6  { flex: 0 0 50%;       max-width: 50%; }
.col-7  { flex: 0 0 58.33333%; max-width: 58.33333%; }
.col-8  { flex: 0 0 66.66667%; max-width: 66.66667%; }
.col-9  { flex: 0 0 75%;       max-width: 75%; }
.col-10 { flex: 0 0 83.33333%; max-width: 83.33333%; }
.col-11 { flex: 0 0 91.66667%; max-width: 91.66667%; }
.col-12 { flex: 0 0 100%;      max-width: 100%; }

/* col-sm- (≥576px) */
@media (min-width: 576px) {
    .col-sm-1  { flex: 0 0 8.33333%;  max-width: 8.33333%; }
    .col-sm-2  { flex: 0 0 16.66667%; max-width: 16.66667%; }
    .col-sm-3  { flex: 0 0 25%;       max-width: 25%; }
    .col-sm-4  { flex: 0 0 33.33333%; max-width: 33.33333%; }
    .col-sm-5  { flex: 0 0 41.66667%; max-width: 41.66667%; }
    .col-sm-6  { flex: 0 0 50%;       max-width: 50%; }
    .col-sm-7  { flex: 0 0 58.33333%; max-width: 58.33333%; }
    .col-sm-8  { flex: 0 0 66.66667%; max-width: 66.66667%; }
    .col-sm-9  { flex: 0 0 75%;       max-width: 75%; }
    .col-sm-10 { flex: 0 0 83.33333%; max-width: 83.33333%; }
    .col-sm-11 { flex: 0 0 91.66667%; max-width: 91.66667%; }
    .col-sm-12 { flex: 0 0 100%;      max-width: 100%; }
}

/* col-md- (≥768px) */
@media (min-width: 768px) {
    .col-md-1  { flex: 0 0 8.33333%;  max-width: 8.33333%; }
    .col-md-2  { flex: 0 0 16.66667%; max-width: 16.66667%; }
    .col-md-3  { flex: 0 0 25%;       max-width: 25%; }
    .col-md-4  { flex: 0 0 33.33333%; max-width: 33.33333%; }
    .col-md-5  { flex: 0 0 41.66667%; max-width: 41.66667%; }
    .col-md-6  { flex: 0 0 50%;       max-width: 50%; }
    .col-md-7  { flex: 0 0 58.33333%; max-width: 58.33333%; }
    .col-md-8  { flex: 0 0 66.66667%; max-width: 66.66667%; }
    .col-md-9  { flex: 0 0 75%;       max-width: 75%; }
    .col-md-10 { flex: 0 0 83.33333%; max-width: 83.33333%; }
    .col-md-11 { flex: 0 0 91.66667%; max-width: 91.66667%; }
    .col-md-12 { flex: 0 0 100%;      max-width: 100%; }
}

/* col-lg- (≥992px) */
@media (min-width: 992px) {
    .col-lg-1  { flex: 0 0 8.33333%;  max-width: 8.33333%; }
    .col-lg-2  { flex: 0 0 16.66667%; max-width: 16.66667%; }
    .col-lg-3  { flex: 0 0 25%;       max-width: 25%; }
    .col-lg-4  { flex: 0 0 33.33333%; max-width: 33.33333%; }
    .col-lg-5  { flex: 0 0 41.66667%; max-width: 41.66667%; }
    .col-lg-6  { flex: 0 0 50%;       max-width: 50%; }
    .col-lg-7  { flex: 0 0 58.33333%; max-width: 58.33333%; }
    .col-lg-8  { flex: 0 0 66.66667%; max-width: 66.66667%; }
    .col-lg-9  { flex: 0 0 75%;       max-width: 75%; }
    .col-lg-10 { flex: 0 0 83.33333%; max-width: 83.33333%; }
    .col-lg-11 { flex: 0 0 91.66667%; max-width: 91.66667%; }
    .col-lg-12 { flex: 0 0 100%;      max-width: 100%; }
}

/* col-xl- (≥1200px) */
@media (min-width: 1200px) {
    .col-xl-1  { flex: 0 0 8.33333%;  max-width: 8.33333%; }
    .col-xl-2  { flex: 0 0 16.66667%; max-width: 16.66667%; }
    .col-xl-3  { flex: 0 0 25%;       max-width: 25%; }
    .col-xl-4  { flex: 0 0 33.33333%; max-width: 33.33333%; }
    .col-xl-5  { flex: 0 0 41.66667%; max-width: 41.66667%; }
    .col-xl-6  { flex: 0 0 50%;       max-width: 50%; }
    .col-xl-7  { flex: 0 0 58.33333%; max-width: 58.33333%; }
    .col-xl-8  { flex: 0 0 66.66667%; max-width: 66.66667%; }
    .col-xl-9  { flex: 0 0 75%;       max-width: 75%; }
    .col-xl-10 { flex: 0 0 83.33333%; max-width: 83.33333%; }
    .col-xl-11 { flex: 0 0 91.66667%; max-width: 91.66667%; }
    .col-xl-12 { flex: 0 0 100%;      max-width: 100%; }
}

/* Clearfix */
.clearfix::after {
    display: block;
    clear: both;
    content: '';
}

/* ----- 29. UTILITY CLASSES ----- */
/* Text */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }
.text-muted { color: var(--color-gray-600); }
.text-info { color: var(--color-info); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-primary { color: var(--color-primary); }
.text-white { color: var(--color-white); }

/* Float */
.pull-left, .float-left { float: left; }
.pull-right, .float-right { float: right; }
.float-none { float: none; }

/* Display */
.d-none { display: none; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Visibility */
.hidden { display: none; }
.invisible { visibility: hidden; }
.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Backgrounds */
.bg-primary { background-color: var(--color-primary) !important; }
.bg-white { background-color: var(--color-white); }
.bg-light { background-color: var(--color-gray-100); }
.bg-dark { background-color: var(--color-gray-800) !important; }
.bg-info { background-color: var(--color-info); }
.bg-success { background-color: var(--color-success); }
.bg-warning { background-color: var(--color-warning); }
.bg-danger { background-color: var(--color-danger); }
.bg-faded { background: rgba(0,0,0,0.05); }

/* Spacing utilities */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }
.mb-4 { margin-bottom: var(--spacing-xl); }
.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }
.p-4 { padding: var(--spacing-xl); }
.px-1 { padding-left: var(--spacing-sm); padding-right: var(--spacing-sm); }
.px-2 { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
.px-3 { padding-left: var(--spacing-lg); padding-right: var(--spacing-lg); }
.px-4 { padding-left: var(--spacing-xl); padding-right: var(--spacing-xl); }
.py-1 { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-2 { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.py-3 { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }
.py-4 { padding-top: var(--spacing-xl); padding-bottom: var(--spacing-xl); }
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* Width */
.w-100 { width: 100%; }
.w-50 { width: 50%; }

/* Borders */
.border { border: 1px solid var(--color-gray-300); }
.border-top { border-top: 1px solid var(--color-gray-300); }
.border-bottom { border-bottom: 1px solid var(--color-gray-300); }
.rounded { border-radius: var(--border-radius); }
.rounded-circle { border-radius: 50%; }

/* Shadows */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-md); }

/* ----- 30. NEWSFLASH (mod_articles_news) ----- */
.newsflash {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}
.newsflash-vert {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--spacing-lg);
    padding: 0;
    margin: 0 0 var(--spacing-xl);
    list-style: none;
}
.newsflash-vert.bg-light {
    background: transparent;
}
.newsflash-item {
    list-style: none;
    border: 1px solid var(--color-gray-300);
    border-radius: var(--border-radius, 6px);
    padding: var(--spacing-lg);
    background: var(--color-white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    display: flex;
    flex-direction: column;
    container-type: inline-size;
}
.newsflash-item * { max-width: 100%; }
/* Card preview: smaller fonts */
.newsflash-item .newsflash-title {
    font-size: clamp(0.9rem, 1.2vw + 0.2rem, 1.05rem);
}
.newsflash-item h2 {
    font-size: clamp(0.9rem, 1.3vw + 0.2rem, 1.1rem);
}
.newsflash-item p {
    font-size: clamp(0.85rem, 0.8vw + 0.3rem, 0.95rem);
}
/* Container query: tighter fonts in narrow cards */
@container (max-width: 320px) {
    .newsflash-item .newsflash-title {
        font-size: 0.85rem;
    }
    .newsflash-item h2 {
        font-size: 0.85rem;
    }
}
.newsflash-image {
    margin-bottom: var(--spacing-sm);
}
.newsflash-title {
    padding: 0;
    margin-top: var(--spacing-sm);
    font-family: var(--font-headings);
}
.newsflash-title a {
    color: var(--color-primary);
}
.newsflash-title a:hover {
    color: var(--color-gold-dark);
}
/* Newsflash card: keep images inside card */
.newsflash-item img,
.img-news {
    width: 100%;
    max-width: 100%;
    border-radius: var(--border-radius, 4px);
}
/* Readmore generico (modulo newsflash homepage, ecc.) */
a.readmore {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-primary);
    color: var(--color-white);
    border-radius: var(--border-radius);
    font-family: var(--font-headings);
    font-size: var(--font-size-sm);
    transition: background var(--transition-base);
    text-decoration: none;
    float: right;
}
a.readmore:hover {
    background: var(--color-primary-light);
    color: var(--color-white);
}
/* Readmore inside cards: align right, no full width */
.newsflash-item a.readmore {
    align-self: flex-end;
    float: none;
    margin-top: auto;
}
/* Override col-* width classes when inside grid */
.newsflash-item.col-md-6,
.newsflash-item.col-md-3 {
    flex: none;
    max-width: none;
    padding: var(--spacing-lg); /* keep card padding consistent */
}

/* Mobile: newsflash stacks in single column */
@media (max-width: 767.98px) {
    .newsflash-vert {
        grid-template-columns: 1fr;
    }
}

/* Latest news */
.latestnews {
    padding: 0 var(--spacing-md);
    background: var(--color-gray-100);
    border-radius: var(--border-radius);
    list-style: none;
}
.latestnews > li > a { color: var(--color-danger); }
.latestnews li {
    list-style: none;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-gray-300);
}
.latestnews li:last-child { border-bottom: none; }

/* ----- 31. GTRANSLATE ----- */
select.notranslate {
    padding: var(--spacing-xs);
    margin: var(--spacing-xs) 7px 0 0;
    width: 300px;
    max-width: 100%;
    border: 1px solid var(--color-gray-400);
    border-radius: var(--border-radius-sm);
}

/* ----- 32. IMMOBILIARE OVERRIDE ----- */
/* CSS Grid con stili originali del template cristiancpz */
.rete-immobiliare.col-12 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 20px;
    row-gap: 10px;
    margin: 0 auto 3rem;
    background-color: #ffed00;
    padding: 1.5rem 15px 1.5rem;
}
/* Il titolo si estende su tutte le colonne */
.rete-immobiliare.col-12 > h3,
.rete-immobiliare.col-12 > h3.col-12 {
    grid-column: 1 / -1;
    flex: none;
    max-width: 100%;
    padding: 0;
    margin: 0;
}
.vetrina-imm {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    float: none;
    width: 100%;
    flex-grow: 1;
}
/* Annulla classi Bootstrap sui figli diretti della grid */
.rete-immobiliare.col-12 > .vetrina-imm.col-md-4 {
    flex: none;
    max-width: 100%;
    padding: 0;
}
.desc-imm {
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    flex-grow: 1;
}
.imm-price {
    background-color: #F99500;
    width: 100%;
    padding: 5px 0;
    margin-top: auto;
    float: none;
    transition: background-color 0.2s ease;
}
.imm-price:hover {
    background-color: var(--color-primary);
}
/* Annulla btn-primary Bootstrap su imm-price */
.rete-immobiliare .imm-price.btn-primary {
    background-color: #F99500;
    border: none;
}
.rete-immobiliare .imm-price.btn-primary:hover {
    background-color: var(--color-primary);
    border: none;
}
.imm-price a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}
.imm-price a:hover {
    text-decoration: none;
    color: #fff;
}
/* Stili originali per immagini e caption */
.rete-immobiliare .img-news {
    width: 100%;
    border: 2px solid #3a5795;
    border-radius: 0;
}
.rete-immobiliare .img-news-cap {
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: #ffed00;
    font-weight: bold;
    width: 190px;
    padding: 5px 10px;
    font-size: 1.5rem;
    color: #000;
    border-top: 2px solid #3a5795;
    border-right: 2px solid #3a5795;
}
.rete-immobiliare figure {
    position: relative;
    margin: 0;
}

/* Mobile: 1 colonna */
@media (max-width: 767.98px) {
    .rete-immobiliare.col-12 {
        grid-template-columns: 1fr;
    }
    .newsflash-vert {
        grid-template-columns: 1fr;
    }
    .home #section-position-2,
    .page-home #section-position-2 {
        grid-template-columns: 1fr;
    }
}

/* ----- 33. COL-BLOG SEPARATOR ----- */
.col-blog { margin-bottom: var(--spacing-xl); }
.sepa { position: relative; }
.sepa:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    width: 50%;
    border-bottom: 1px solid var(--color-primary);
}

/* Vertical separator for blog columns */
.vsepa + .vsepa,
.col-blog:nth-child(2n) {
    border-left: 2px solid;
    border-image: linear-gradient(to bottom, rgba(0,0,0,0) 5%, var(--color-danger) 50%, rgba(0,0,0,0) 90%) 1 100%;
}

/* ----- 34. RESPONSIVE ----- */
@media (max-width: 991.98px) {
    /* Sidebar columns stack on tablet */
    .content-layout {
        flex-direction: column;
    }
    .content-layout .sidebar,
    .content-layout .content-main {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    .content-layout .sidebar {
        margin-bottom: var(--spacing-md);
    }

    .jumbotron { padding: 1.5rem 1rem; }
}

@media (max-width: 767.98px) {
    .site-main { padding: var(--spacing-lg) 0; }

    /* Section modules: single column on mobile */
    .section-module {
        grid-template-columns: 1fr;
    }
    #section-position-4 {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
    }

    /* Footer single column on mobile */
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .header-logo img.logo {
        max-width: 140px;
    }

    .jumbotron { padding: 1rem; }

    .blog iframe { max-width: 100%; }

    /* Tabelle clima: stack verticali, celle orizzontali */
    .clima-wrapper table,
    table.clima {
        display: block;
        width: 100%;
        margin-bottom: var(--spacing-md);
    }
    .clima-wrapper table tbody,
    table.clima tbody {
        display: block;
        width: 100%;
    }
    .clima-wrapper table tr,
    table.clima tr {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        border-bottom: 1px solid var(--color-gray-300);
        padding: var(--spacing-xs) 0;
    }
    .clima-wrapper table td,
    table.clima td {
        flex: 1 1 50%;
        padding: var(--spacing-xs);
        box-sizing: border-box;
        border: none;
    }
    .clima-wrapper table td:first-child,
    table.clima td:first-child {
        font-weight: 600;
        color: var(--color-primary);
    }
}

@media (max-width: 480px) {
    .header-social { gap: 6px; }

    li.hidden-phone { display: none; }
    .newsflash {
        grid-template-columns: 1fr;
    }

    footer { font-size: var(--font-size-sm); }
}

/* ----- 35. ACCESSIBILITY ENHANCEMENTS ----- */
/* Focus visible for keyboard users */
:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}
:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    html { scroll-behavior: auto; }
}

/* High contrast mode adjustments */
@media (forced-colors: active) {
    .btn, .navbar-toggler, .back-to-top, .whatsapp-float > a {
        border: 2px solid currentColor;
    }
}

/* Print styles */
@media print {
    header.navbar,
    .jumbotron,
    .whatsapp-float,
    .back-to-top,
    .footer-social,
    .breadcrumbs { display: none; }
    .site-main { padding: 0; }
    .section-module { margin-bottom: 0; }
    .container, .container-fluid { max-width: 100%; padding: 0; }
    a[href]::after { content: ' (' attr(href) ')'; font-size: 0.8em; }
    a[href^="#"]::after { content: ''; }
}

/* ----- 36. MODULE SPECIFIC OVERRIDES ----- */
/* Login form */
.login {
    margin: 0 auto;
    max-width: 330px;
    padding-top: var(--spacing-md);
}

/* Language switcher inline */
.lang-inline {
    list-style: none;
    margin: 0;
    padding: 0;
}
.lang-inline > li {
    display: inline;
    margin-left: 8px;
}

/* Autocomplete */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    float: left;
    min-width: 10rem;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 1rem;
    color: var(--color-gray-900);
    text-align: left;
    list-style: none;
    background: var(--color-white);
    border: 1px solid var(--color-gray-400);
    border-radius: var(--border-radius);
}
.autocomplete-suggestion {
    display: block;
    width: 100%;
    padding: 0.25rem 1.5rem;
    clear: both;
    font-weight: 400;
    color: var(--color-gray-900);
    text-align: inherit;
    white-space: nowrap;
    background: transparent;
    border: 0;
}
.autocomplete-suggestion:hover,
.autocomplete-suggestion:focus {
    color: var(--color-gray-800);
    text-decoration: none;
    background: var(--color-gray-100);
}
.autocomplete-suggestion.active,
.autocomplete-suggestion:active {
    color: var(--color-white);
    background: var(--color-primary);
}

/* TOC links */
.toclink { padding: 0.3rem; }
.toclink.active { color: var(--color-danger); }

/* Link add */
.link_add {
    border-top: 2px solid var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}

/* Submenu */
.nav-child { margin-bottom: var(--spacing-md); float: left; }
.nav-child > li { border: 1px solid var(--color-primary); margin: 2px; }
.nav-child > li > a { padding: 0 5px; }
.nav-child > li.active { color: var(--color-danger); border-bottom: 3px solid; }

/* Category description */
.category-desc { margin-bottom: var(--spacing-lg); }

/* Items more */
.items-more { margin: var(--spacing-xl) 0; }

/* Blog heading hierarchy fix */
.subheading-category { font-weight: 400; }

/* Unpublished state */
.system-unpublished {
    opacity: 0.7;
    background: var(--color-gray-100);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
}

/* Finder search module */
#mod-finder-searchform .form-control {
    display: inline-block;
    width: auto;
    min-width: 200px;
}
#mod-finder-searchform .btn {
    vertical-align: top;
}

/* Vote/rating stars */
.content_rating { display: flex; align-items: center; gap: var(--spacing-sm); }
.content_vote { display: flex; align-items: center; gap: var(--spacing-sm); }

/* Pagination nav */
.pagenav { text-decoration: none; }
.pager.pagenav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}
.pager.pagenav .previous,
.pager.pagenav .next {
    flex: 1 1 auto;
    min-width: 0;
}
.pager.pagenav .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Contact form specific */
.contact-form .form-actions { margin-top: var(--spacing-md); }

/* AcyMailing newsletter override */
.acymailing_module,
.acymailing_module div {
    padding: unset;
    margin: unset;
}
.subbutton:hover { border-color: #004064; }
/* Bottone Iscriviti nel footer: sfondo bianco, hover invertito con bordo bianco */
.footer-grid .subbutton.btn-primary,
.footer-grid input.button.subbutton {
    background: #fff;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.footer-grid .subbutton.btn-primary:hover,
.footer-grid input.button.subbutton:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: #fff;
}
input.btn-inverse {
    color: var(--color-white) !important;
    background: #444;
    border-color: #373737;
}
input.btn-inverse:hover {
    background: #2b2b2b;
    border-color: #191919;
}
.landing-newsl {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 15px;
}

/* ChronoForms */
.chrono_credits { display: none; }

/* ----- PROSSIMI EVENTI BUSINESS: fixed fuori container (≥1720px) solo homepage ----- */
/* Nascosto via JS quando si superano le prime 2 section (effetto sticky-like) */
@media (min-width: 1720px) {
    .page-home #section-position-2 > .moduletable:last-child {
        position: fixed;
        left: calc(50% + 580px);
        top: 180px;
        z-index: 1000;
        width: auto;
        transition: opacity 0.4s ease, visibility 0.4s ease;
        max-width: 320px
    }
    .page-home #section-position-2 > .moduletable:last-child.pe-hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

/* Sotto 1720px: griglia 2fr 1fr 1fr 1fr — news prime 3 colonne, PE 4a colonna (solo homepage) */
@media (max-width: 1719.98px) {
    .page-home #section-position-2 {
        display: grid;
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: var(--spacing-lg);
        align-items: start;
    }
    .page-home #section-position-2 > .moduletable:first-child {
        grid-column: 1 / 4;
        max-width: none !important;
        width: auto !important;
        padding: 0 !important;
    }
    .page-home #section-position-2 > .moduletable:last-child {
        grid-column: 4;
        max-width: none !important;
        width: auto !important;
        padding: 0 !important;
    }
    .page-home #section-position-2 h3 {
        min-height: 3.2rem;
    }
}

/* Nelle pagine diverse dalla homepage, PE occupa tutta la larghezza */
body:not(.page-home) #section-position-2 > .moduletable:last-child {
    grid-column: 1 / -1;
    max-width: none !important;
    width: auto !important;
}

/* Tablet (768-991px): 3 colonne — prima news, seconda news, PE (terza news nascosta) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .page-home #section-position-2 {
        grid-template-columns: 2fr 1fr 1fr;
        gap: var(--spacing-lg);
        align-items: stretch;
    }
    .page-home #section-position-2 > .moduletable:first-child {
        grid-column: 1 / 3;
        max-width: none;
        width: auto;
        padding: 0;
    }
    .page-home #section-position-2 > .moduletable:last-child {
        grid-column: 3;
        max-width: none;
        width: auto;
        padding: 0;
    }
    .page-home .newsflash-vert {
        grid-template-columns: 2fr 1fr;
    }
    .page-home .newsflash-vert .newsflash-item:nth-child(3) {
        display: none;
    }
    .page-home #section-position-2 > .moduletable {
        display: flex;
        flex-direction: column;
    }
    .page-home #section-position-2 > .moduletable:first-child > *:not(h3) {
        flex: 1;
    }
    .page-home #section-position-2 ul.latestnews {
        margin-top: 0;
    }
}

/* Mobile: sezioni homepage e newsflash a 1 colonna, PE dopo */
@media (max-width: 767.98px) {
    .page-home #section-position-2 {
        grid-template-columns: 1fr !important;
    }
    .page-home #section-position-2 > .moduletable {
        grid-column: auto !important;
    }
    .newsflash-vert {
        grid-template-columns: 1fr !important;
    }
}

/* --- End of template.css --- */

/* Tabelle meteo clima */
.table-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.table-container.second-table {
    grid-template-columns: 1fr 1fr;
}

.table-container .table-header {
    display: contents;
    background-color: #f0f0f0;
}

.table-container .header-cell {
    padding: 10px;
    font-weight: bold;
    text-align: center;
    background-color: #ddd;
    border: 1px solid #ccc;
}

.table-container .table-row {
    display: contents;
}

.table-container .row-header {
    padding: 10px;
    font-weight: bold;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
}

.table-container .row-data {
    padding: 10px;
    border: 1px solid #ccc;
    text-align: center;
}

.first-table, .second-table {
  width: 50%;
  float: left;
  padding: 20px;
}

/* Interrompe il float per tutti gli elementi successivi alla seconda tabella */
.second-table ~ * {
    clear: both;
}

/* Responsività */
@media (max-width: 768px) {

    .first-table, .second-table {
        width: 100%;
        float: none;
        padding: 10px 0;
    }

    .table-container .header-cell,
    .table-container .row-header,
    .table-container .row-data {
        text-align: left;
        padding: 8px;
    }
}
/* fine tabella meteo clima */