/*
Theme Name: Labsumo Child
Theme URI: https://www.labsumo.it/
Description: Child theme di Hello Elementor per il sito labsumo.it
Author: UBU Team
Author URI: https://www.ubu-team.com/
Template: hello-elementor
Version: 1.0.0
Text Domain: labsumo-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/

/* Stili custom Labsumo */

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.elementor .ls-tag:empty { display: none; }
/* chip categoria delle card materiali (testo da shortcode): nascosta se il materiale non ha categoria */
.elementor .ls-card-cat:empty,
.elementor .ls-excerpt-full:empty { display: none; }
/* riga badge+categoria della card materiali: nascosta se non ha nessun figlio con testo */
.elementor .ls-card-tags-inline:not(:has(> :not(:empty))) { display: none; }
/* chip con testo da campo (es. durata del webinar): nascosta se il campo è vuoto */
.elementor .ls-ev-chip:has(> .ls-ev-chip-txt:empty) { display: none; }
/* riquadro del testo nel dettaglio webinar: nascosto se l'editor è vuoto */
.elementor .ls-wb-body:not(:has(*)) { display: none; }

/* Badge-firma dei singoli: nascosto se il post non ha quell'associazione (shortcode vuoto) */
.elementor .ls-sig-badge:not(:has(> .ls-sig-eb:not(:empty))) { display: none; }

/* Header fisso su tutti i dispositivi (27–28 ott 2026). Lo sticky non ha mai funzionato perché il body ha overflow-x clip,
   quindi position fixed; qui anche l'offset del contenuto (altezza dell'header: 76px, 64px su mobile) e la barra admin.
   Gli ancoraggi in pagina (#id) restano visibili sotto l'header grazie a scroll-padding-top. */
body { padding-top: 76px !important; }
html { scroll-padding-top: 92px; }
.elementor-location-header > .e-con:first-child { position: fixed; top: 0; left: 0; right: 0; z-index: 100; }
body.admin-bar .elementor-location-header > .e-con:first-child { top: 32px; }
/* elementi sticky sotto l'header fisso (il kit ha già top: 100px = 76 header + 24): con la barra admin +32 */
body.admin-bar .ls-dash-side { top: 132px; }
@media (max-width: 782px) {
  body.admin-bar .elementor-location-header > .e-con:first-child { top: 46px; } /* la barra admin di WordPress è alta 46px sotto i 783px */
}
@media (max-width: 600px) {
  #wpadminbar { position: fixed; } /* sotto i 600px WordPress la rende absolute (scorre via): fissa, altrimenti resta un vuoto di 46px sopra l'header */
}
@media (max-width: 767px) {
  body { padding-top: 64px !important; }
  html { scroll-padding-top: 80px; }
}

/* Area riservata, modalità app per i loggati su mobile (classi body ls-logged / ls-area da inc/area-riservata.php).
   Le classi del kit (ls-tabbar*) danno lo stile; qui solo quando mostrare la tab bar, perché dipende dal body.
   Su desktop il segnale "loggato" è nell'header (bottone La mia area pieno + Esci), nessuna barra aggiuntiva. */
@media (max-width: 767px) {
  body.ls-logged .ls-tabbar { display: block; z-index: 1001; } /* sopra il menu a tutto schermo (1000): resta usabile anche a menu aperto */
  /* "La mia area" in fondo al menu aperto: da loggato è già nella tab bar. Il CSS personalizzato del widget Menu (49) lo forza
     visibile con !important e selettore :has(): questa regola deve avere specificità maggiore, per questo ripete quel selettore */
  body.ls-logged .elementor-element-7eebf4ad:has(.elementor-menu-toggle.elementor-active) a[data-id="64e45262"] { display: none !important; }
  body.ls-logged { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  body.ls-logged.ls-area .ls-dash-side { display: none; }
}
/* voce corrente della tab bar (il body ha ls-area-{slug} sulle pagine figlie; sulla dashboard solo ls-area) */
body.ls-area:not([class*=" ls-area-"]) .ls-tabbar-item:nth-child(1),
body.ls-area-survey .ls-tabbar-item:nth-child(2),
body.ls-area-eventi .ls-tabbar-item:nth-child(3),
body.ls-area-materiali .ls-tabbar-item:nth-child(4),
body.ls-area-webinar .ls-tabbar-item:nth-child(5) { color: #fff; }
body.ls-area:not([class*=" ls-area-"]) .ls-tabbar-item:nth-child(1)::before,
body.ls-area-survey .ls-tabbar-item:nth-child(2)::before,
body.ls-area-eventi .ls-tabbar-item:nth-child(3)::before,
body.ls-area-materiali .ls-tabbar-item:nth-child(4)::before,
body.ls-area-webinar .ls-tabbar-item:nth-child(5)::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--ls-magenta); }

/* voce corrente del pannello laterale (componente "Pannello area riservata", uguale su tutte le pagine dell'area):
   stessa logica della tab bar, stesso stile delle vecchie classi ls-dash-nav-active / ls-dash-nav-txt-active */
body.ls-area:not([class*=" ls-area-"]) .ls-dash-nav > .ls-dash-nav-item:nth-child(1),
body.ls-area-survey .ls-dash-nav > .ls-dash-nav-item:nth-child(2),
body.ls-area-eventi .ls-dash-nav > .ls-dash-nav-item:nth-child(3),
body.ls-area-materiali .ls-dash-nav > .ls-dash-nav-item:nth-child(4),
body.ls-area-webinar .ls-dash-nav > .ls-dash-nav-item:nth-child(5) { background-color: var(--ls-magenta); }
body.ls-area:not([class*=" ls-area-"]) .ls-dash-nav > .ls-dash-nav-item:nth-child(1) .ls-dash-nav-txt,
body.ls-area-survey .ls-dash-nav > .ls-dash-nav-item:nth-child(2) .ls-dash-nav-txt,
body.ls-area-eventi .ls-dash-nav > .ls-dash-nav-item:nth-child(3) .ls-dash-nav-txt,
body.ls-area-materiali .ls-dash-nav > .ls-dash-nav-item:nth-child(4) .ls-dash-nav-txt,
body.ls-area-webinar .ls-dash-nav > .ls-dash-nav-item:nth-child(5) .ls-dash-nav-txt { font-weight: 600; color: var(--ls-white); }

/* Card materiale compatta, solo nella dashboard (classe ls-mat-compact sull'item del Loop "Ultimi materiali"):
   stesso componente "Card materiale" della pagina Materiali, ma riga bassa da elenco di file, senza riassunto
   (si legge nella pagina Materiali), chip e bottone in linea. Qui perché le classi del kit non possono stilare i discendenti. */
.elementor .ls-mat-compact .ls-mat-card { align-items: center; }
.elementor .ls-mat-compact .ls-mat-body { padding: 14px 20px; gap: 4px; }
.elementor .ls-mat-compact .ls-mat-body .ls-card-title { font-size: 15px; }
.elementor .ls-mat-compact .ls-excerpt-full { display: none; }
.elementor .ls-mat-compact .ls-mat-side .ls-btn { margin-block-start: 0; }
.elementor .ls-mat-compact .ls-mat-side { flex: 0 0 auto; width: auto; flex-direction: row; align-items: center; gap: 8px; padding: 14px 20px 14px 0; border-left: 0; background: transparent; }
/* foto a filo nella riga compatta: 200 px 16:9 danno l'altezza alla riga (la classe ls-mat-thumb del kit è per la pagina Materiali, contain sta in ls-mat-thumb-img); su mobile niente foto: resta l'elenco */
.elementor .ls-mat-compact .ls-mat-thumb { flex: 0 0 200px; width: 200px; min-height: 0; aspect-ratio: 16 / 9; align-self: stretch; margin: 0; border-radius: 0; }
/* tablet: chip e bottone vanno sotto, sulla stessa riga non resterebbe spazio per il titolo */
@media (max-width: 1024px) {
  .elementor .ls-mat-compact .ls-mat-card { flex-wrap: wrap; }
  .elementor .ls-mat-compact .ls-mat-body { flex: 1 1 calc(100% - 200px); }
  .elementor .ls-mat-compact .ls-mat-side { flex: 1 1 100%; width: 100%; padding: 14px 20px; }
}
@media (max-width: 767px) {
  .elementor .ls-mat-compact .ls-mat-card { flex-wrap: nowrap; }
  .elementor .ls-mat-compact .ls-mat-side { padding: 14px 20px; flex-wrap: wrap; }
  .elementor .ls-mat-compact .ls-mat-thumb { display: none; }
}
