/* === SMART TOP BAR === */
.smart-top-bar {
    font-size: clamp(0.6rem, 1.2vw, 0.82rem);
    text-align: center;
    padding: 0;
}

/* === SMART HEADER (3+6+3 row) === */
.smart-header,
.smart-header.row {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
}
.smart-header .sp-column,
.smart-header > [class*="col-"] {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* === HEADER LEFT (LOGO) === */
.header-left {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.header-left img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* === HEADER CENTER (5 LINES SLOGAN) === */
.header-center {
    text-align: center;
    width: 100%;
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    line-height: 1.5;
}
.header-center p,
.header-center span,
.header-center div {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
}

/* === HEADER RIGHT (LOGIN ICON) === */
.header-right {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.header-right a { line-height: 1; }
.header-right i,
.header-right .fa {
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
}

/* === SMART MENU — altezza ridotta via line-height === */
/*.smart-menu .sp-megamenu-wrapper {
    position: relative;
}*/
.sp-megamenu-parent > li > a,
.sp-megamenu-parent > li > span {
    line-height: 36px !important;
}


/* === LOGIN LINK STYLES === */
.custom-user-login .login-action-link {
    color: #ffffff;
    transition: all 0.3s ease-in-out;
}
.custom-user-login .login-action-link:hover {
    color: #e0e0e0;
    opacity: 0.9;
}
.custom-user-login .login-action-link:hover .icon-login {
    transform: scale(1.1);
}
.custom-user-login .text-login {
    font-size: 1rem;
}

/* === LABEL MODALE LOGIN === */
#loginModal label {
    color: #212529 !important;
}

/* === NASCONDI WEBAUTHN/PASSKEY === */
.plg_system_webauthn_login_button,
button[data-webauthn-form],
button[data-webauthn-url],
button[data-webauthn],
svg#Passkey,
#icon-passkey {
    display: none !important;
}

/* === HAMBURGER — linee bianche globali === */
#offcanvas-toggler .burger-icon span {
    background-color: #ffffff !important;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1200px) {
    .header-center { font-size: clamp(0.75rem, 1.4vw, 1rem); }
}

@media (max-width: 992px) {
    .header-center { font-size: clamp(0.65rem, 2vw, 0.95rem); }
    .smart-top-bar { font-size: clamp(0.6rem, 1.8vw, 0.82rem); }

    /* La row diventa position relative per ancorare il login */
    #sp-smart-header .row {
        position: relative !important;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
    }

    /* sp-logo occupa tutta la larghezza in cima */
    #sp-logo {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* header-left: logo centrato, hamburger assoluto a sinistra */
    .sp-logo .header-left,
    .header-left {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100%;
        position: relative !important;
    }

    /* Hamburger: assoluto a sinistra dentro header-left */
    #offcanvas-toggler {
        position: absolute !important;
        left: 2% !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 10;
    }
    #offcanvas-toggler .burger-icon span {
        background-color: #ffffff !important;
    }

    /* Logo div centrato */
    .header-left .logo,
    .header-left img {
        margin: 0 auto;
    }

    /* Slogan: sotto il logo, larghezza piena */
    #sp-aispa {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        order: 3;
    }

    /* Login: assoluto in alto a destra, allineato all'hamburger */
    #sp-modale-login {
        position: absolute !important;
        top: 28px !important;
        right: 6% !important;
        width: auto !important;
        height: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        padding: 0 !important;
        /* altezza uguale a sp-logo per allinearsi verticalmente */
        bottom: auto !important;
    }
}

@media (max-width: 768px) {
    .header-center { font-size: clamp(0.6rem, 2.5vw, 0.85rem); }
    .smart-top-bar { font-size: clamp(0.55rem, 2.5vw, 0.8rem); }
    .header-right i { font-size: clamp(1rem, 3.5vw, 1.4rem); }
}

@media (max-width: 576px) {
    .header-center { font-size: clamp(0.5rem, 3.2vw, 0.75rem); }
    .smart-top-bar { font-size: clamp(0.5rem, 3.5vw, 0.75rem); }
    .header-right i { font-size: clamp(1rem, 4.5vw, 1.3rem); }
}

/* ─── Wrapper ───────────────────────────────── */
.region-menu-wrap {
    position: relative;
    text-align: left;
    /* overflow è gestito dalle media query qui sotto */
}

/* ─── Lista livello 1 ───────────────────────── */
.region-menu.level-1 {
    list-style: none;
    padding: 0;
    margin: 0;
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                opacity   0.32s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

.region-menu.level-1 > li {
    border-bottom: 1px solid #ececec;
    margin: 0;
}

/* ─── Toggle (voci con figli) ───────────────── */
.region-toggle {
    width: 100%;
    background: #fff;
    border: none;
    margin: 0;
    padding: 10px 14px;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #222;
    line-height: 1.2;
    text-align: left;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: background .2s, color .2s;
}

.region-toggle:hover {
    background: #f8f8f8;
    color: #ff6600;
}

.region-toggle__label {
    text-align: left;
}

.region-toggle__arrow {
    margin-left: auto;
    font-size: 18px;
    line-height: 1;
    color: #aaa;
    transition: transform 0.25s ease, color 0.2s;
}

/* ─── Voci dirette (senza figli) ────────────── */
.region-item--direct {
    border-bottom: 1px solid #ececec;
}

.region-direct-link {
    display: flex !important;
    align-items: center;
    width: 100%;
    padding: 10px 14px !important;
    font-size: 16px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    line-height: 1.2 !important;
    text-align: left;
    transition: background .2s, color .2s;
    box-sizing: border-box;
}

.region-direct-link:hover {
    background: #f8f8f8;
    color: #ff6600;
}

/* ─── Separatori ─────────────────────────────── */
.region-item--separator {
    border-bottom: 1px solid #ececec;
}

.region-separator {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 14px !important;
    font-size: 16px;
    font-weight: 900;
    color: #111;
    line-height: 1.2 !important;
    text-align: left;
    box-sizing: border-box;
    cursor: default;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #f5f5f5;
    border-top: 2px solid #d0d0d0;
    margin-top: -1px;
}

.region-separator:first-child {
    border-top: none;
    margin-top: 0;
}

/* ─── Pannello sottomenu (slide da destra) ──── */
.region-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    background: #fafafa;
    transform: translateX(105%);   /* fuori schermo a destra */
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    z-index: 20;
    overflow-y: auto;
}

.region-panel.is-open {
    transform: translateX(0);
}

/* ─── Bottone Indietro ──────────────────────── */
.region-back {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #ff6600;
    background: #fff;
    border: none;
    border-bottom: 1px solid #ececec;
    cursor: pointer;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: background .2s;
}

.region-back:hover {
    background: #fff4ee;
}

/* ─── Lista livello 2 ───────────────────────── */
.region-menu.level-2 {
    list-style: none;
    padding: 0;
    margin: 0;
}

.region-menu.level-2 > li {
    border-bottom: 1px solid #ececec;
}

.region-menu.level-2 a {
    display: inline-block !important;
    padding: 8px 25px !important;
    font-size: 14px;
    line-height: 1.2;
    color: #555;
    text-decoration: none;
    text-align: left;
    transition: background .2s, color .2s;
}

.region-menu.level-2 a:hover {
    background: #f1f1f1;
    color: #ff6600;
}

/* =====================================================
   MENU COMPORTAMENTO DESKTOP VS MOBILE
   ===================================================== */

/* COMPORTAMENTO MOBILE (Drill-down nativo) - Meno di 992px */
@media (max-width: 991px) {
    .region-menu-wrap {
        overflow: hidden;
    }

    .region-panel {
        min-height: auto;
        height: auto;
    }
  /* padding destro e sinistro */
  #sp-component {
         padding-left: 10% !important;
        padding-right: 10% !important;
    }
  /* fine padding */

  /* in alternativa  al precedente
   #sp-component {
        padding-left: clamp(12px, 5vw, 32px) !important;
        padding-right: clamp(12px, 5vw, 32px) !important;
    }
*/


  
    /* Sposta il livello 1 a sx quando un pannello è aperto */
    .region-menu-wrap.panel-open > .region-menu.level-1 {
        transform: translateX(-25%);
        opacity: 0.35;
        pointer-events: none;
        user-select: none;
    }
}

/* COMPORTAMENTO DESKTOP (Fly-out laterale) - 992px e superiori */
@media (min-width: 992px) {
    .region-menu-wrap {
        overflow: visible !important;
    }

    .region-panel {
        left: 100%; /* Posiziona a destra del genitore */
        width: 250px; /* Larghezza fissa per il sottomenu */
        min-height: auto;
        height: auto;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
        transform: translateX(-15px);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
        z-index: 1000;
        border-left: 1px solid #ececec; /* Bordo separatore opzionale */
    }

    .region-panel.is-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* Il menu principale rimane fermo e cliccabile su desktop */
    .region-menu-wrap.panel-open > .region-menu.level-1 {
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        user-select: auto !important;
    }
    
    /* Nascondo il bottone "indietro" su desktop perché il menu principale resta visibile */
    .region-back {
        display: none;
    }
 
}

/* === FIX RESPONSIVE TROMBINOSCOPE PER HELIX ULTIMATE === */
.te_trombinoscope .personlist.row {
    display: flex;
    flex-wrap: wrap;
}

/* Su mobile forziamo l'impilamento al 100% scavalcando i CSS nativi del componente */
@media (max-width: 767px) {
    .te_trombinoscope .personlist.row .person {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 25px !important; /* Spazio tra una scheda e l'altra */
    }
}

/* =====================================================
   CENTRATURA MENU HELIX ULTIMATE (Solo Desktop)
   ===================================================== */
@media (min-width: 992px) {
    /* Centra il contenitore della colonna e il wrapper del megamenu */
    #sp-menu > .sp-column,
    #sp-menu .sp-megamenu-wrapper {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }

    /* Assicura che la lista dei link UL stia al centro */
    #sp-menu .sp-megamenu-wrapper .sp-megamenu-parent {
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }
}

/* =====================================================
   CENTRATURA SMART TOP BAR
   ===================================================== */
.smart-top-bar .row,
.smart-top-bar .sp-column,
.smart-top-bar [class*="col-"] {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
}

/* Assicura che i moduli dentro la top bar non abbiano margini che sbilanciano la centratura */
.smart-top-bar .sp-module {
    margin: 0 auto !important;
    text-align: center !important;
}

/* =====================================================
   RIDUZIONE SPAZIO SOTTO HEADER (Solo Mobile)
   ===================================================== */
@media (max-width: 991px) {
    /* Rimuove o riduce il padding top della riga principale sotto l'header */
    #sp-main-body {
        padding-top: 10px !important; /* Metti 0px se lo vuoi incollato */
    }

    /* Se hai una riga Page Title (Titolo Pagina), riduce anche quella */
    #sp-page-title {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    /* Se usi SP Page Builder dentro l'articolo, a volte la prima sezione ha un padding */
    .sp-page-builder .sppb-section:first-child {
        padding-top: 10px !important;
    }
}

/* === FIX STABILITÀ TOP BAR === */
.smart-top-bar {
    font-size: 12px !important;
    line-height: 1.4;
    text-align: center;
    padding: 0;
}

.smart-top-bar * {
    font-size: inherit !important;
    line-height: inherit;
}


/* === FIX: scritta centrale stabile (niente 17->18 tra home e pagine) === */
.header-center{
  font-size: 17px !important;
  line-height: 1.5;
}

.header-center p,
.header-center span,
.header-center div{
  font-size: inherit !important;
  line-height: inherit !important;
}

@media (max-width: 992px){
  .header-center{ font-size: 16.5px !important; }
}
@media (max-width: 768px){
  .header-center{ font-size: 16px !important; }
}
@media (max-width: 576px){
  .header-center{ font-size: 15.2px !important; }
}
@media (max-width: 420px){
  .header-center{ font-size: 14.6px !important; }
}

/* =====================================================
   COMPONENTE CENTRALE — MAX 80% su desktop senza sidebar
   ===================================================== */
@media (min-width: 992px) {
    #sp-main-body:not(:has(#sp-left .sp-module)):not(:has(#sp-right .sp-module)) #sp-component {
        max-width: 80% !important;
        flex: 0 0 80% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

@media (max-width: 991px) {
    #sp-component {
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}


/* =====================================================
   COMPONENTE CENTRALE — Bilanciamento con sidebar attiva
   ===================================================== */
@media (min-width: 992px) {

    /* Sidebar SINISTRA presente: aggiungi margine destro equivalente */
    #sp-main-body:has(#sp-left .sp-module) #sp-component {
        padding-right: 10% !important;
    }

    /* Sidebar DESTRA presente: aggiungi margine sinistro equivalente */
    #sp-main-body:has(#sp-right .sp-module) #sp-component {
        padding-left: 10% !important;
    }

    /* Entrambe le sidebar presenti: nessun padding extra (layout già bilanciato) */
    #sp-main-body:has(#sp-left .sp-module):has(#sp-right .sp-module) #sp-component {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* =====================================================
   FOOTER — RIGA 100%, MODULI CENTRATI, COLONNE DISTANZIATE
   ===================================================== */
#sp-footer {
    width: 100% !important;
	padding-top: 40px !important;
    padding-bottom: 20px !important;
}

#sp-footer .row {
    max-width: none !important;
    width: 100% !important;
    --bs-gutter-x: 5rem !important;
    justify-content: center !important;
}

#sp-footer .sp-column {
    text-align: center !important;
}

#sp-footer .sp-column .sp-module,
#sp-footer .sp-column .moduletable {
    text-align: center !important;
}

#sp-footer .sp-column .sp-module .sp-module-title {
    text-align: center !important;
}

#sp-footer .sp-column .sp-module-content,
#sp-footer .sp-column .moduletable .sp-module-content {
    text-align: center !important;
}

#sp-footer .sp-column .sp-module-content img,
#sp-footer .sp-column .sp-module-content iframe,
#sp-footer .sp-column .sp-module-content figure,
#sp-footer .sp-column .sp-module-content canvas,
#sp-footer .sp-column .sp-module-content video,
#sp-footer .sp-column .sp-module-content svg {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

#sp-footer .sp-column .sp-module-content table,
#sp-footer .sp-column .moduletable .sp-module-content table {
    margin-left: auto !important;
    margin-right: auto !important;
}

#sp-footer .sp-column .sp-module-content ul,
#sp-footer .sp-column .sp-module-content ol,
#sp-footer .sp-column .moduletable ul,
#sp-footer .sp-column .moduletable ol {
    display: inline-block !important;
    text-align: left !important;
    padding-left: 1.5rem !important;
}

#sp-footer .sp-column .sp-module-content > div,
#sp-footer .sp-column .sp-module-content > p,
#sp-footer .sp-column .sp-module-content > section,
#sp-footer .sp-column .sp-module-content > form {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* === FOOTER MENU ACCORDION === */
#sp-footer .footer-menu-wrap {
    width: 100% !important;
    text-align: center !important;
}

#sp-footer .footer-menu,
#sp-footer .sp-column .moduletable .footer-menu {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-block !important;
    text-align: left !important;
}

#sp-footer .footer-menu.level-2,
#sp-footer .sp-column .moduletable .footer-menu.level-2 {
    padding-left: 0.75rem !important;
}

#sp-footer .footer-menu > li,
#sp-footer .sp-column .moduletable .footer-menu > li {
    margin-bottom: 2px !important;
}

#sp-footer .footer-menu > li > a,
#sp-footer .footer-menu details summary {
    display: block !important;
    padding: 4px 0 !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    color: inherit !important;
}

#sp-footer .footer-menu details,
#sp-footer .sp-column .moduletable .footer-menu details {
    display: block !important;
}

#sp-footer .footer-menu details summary {
    cursor: pointer !important;
    list-style: none !important;
}

#sp-footer .footer-menu details summary::-webkit-details-marker {
    display: none !important;
}

#sp-footer .footer-menu details summary::before {
    content: '+' !important;
    display: inline-block !important;
    width: 1rem !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #aaa !important;
    text-align: center !important;
}

#sp-footer .footer-menu details[open] > summary::before {
    content: '−' !important;
}

#sp-footer .footer-menu details summary a,
#sp-footer .sp-column .moduletable .footer-menu details summary a {
    display: inline !important;
    color: inherit !important;
    font-size: inherit !important;
}

#sp-footer .footer-menu.level-2 a,
#sp-footer .sp-column .moduletable .footer-menu.level-2 a {
    font-size: 12px !important;
    padding: 2px 0 !important;
    display: block !important;
}

/* =====================================================
   FINDER SEARCH — RISULTATI ELEGANTI A CARD
   ===================================================== */
.com-finder__results-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 1.5rem 0 !important;
}

.com-finder__results-list .result__item {
    margin-bottom: 1.25rem !important;
    list-style: none !important;
}

.com-finder__results-list .result__card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.com-finder__results-list .result__card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-color: #d4d4d4;
}

.com-finder__results-list .result__card-body {
    padding: 1.25rem 1.5rem;
}

.com-finder__results-list .result__title {
    margin: 0 0 0.5rem !important;
    font-size: 1.1rem;
    line-height: 1.4;
}

.com-finder__results-list .result__title-link {
    color: #0044cc;
    text-decoration: none;
    font-weight: 600;
}

.com-finder__results-list .result__title-link:hover {
    text-decoration: underline;
}

.com-finder__results-list .result__title-url {
    display: block;
    font-size: 0.78rem;
    font-weight: 400;
    color: #0a7e0a;
    word-break: break-all;
    margin-top: 2px;
    font-style: normal;
}

.com-finder__results-list .result__description {
    margin: 0 0 0.6rem !important;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #444;
}

.com-finder__results-list .result__taxonomy {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.com-finder__results-list .result__taxonomy-item {
    display: inline-block;
    font-size: 0.78rem;
    color: #666;
    background: #f4f4f4;
    padding: 2px 10px;
    border-radius: 4px;
}

.com-finder__results-list .result__taxonomy-item span {
    font-weight: 600;
    color: #444;
}

.com-finder__results-header {
    margin-bottom: 1rem;
}

.com-finder__results-count {
    font-size: 1rem;
    color: #555;
    margin: 0;
}

.com-finder__pagination .pagination {
    justify-content: center;
}

.com-finder__navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.5rem;
}

.com-finder__counter {
    font-size: 0.88rem;
    color: #777;
}

