/* =====================================================================
   Spirito Trail – stile su T4 (Joomla 6)
   Replica dell'aspetto del vecchio template T3 "spiritotrail".
   Colori: rosso #d8001a, grigio scuro #222, nero footer #000.
   Font ospitati in locale (niente Google Fonts, per il GDPR).
   ===================================================================== */

/* ---------- Font locali ---------- */
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/oswald-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/oswald-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/oswald-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Oswald"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/oswald-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 300; font-display: swap; src: url("../fonts/fira-sans-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/fira-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/fira-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/fira-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/fira-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --st-red: #d8001a;
  --st-red-dark: #a30014;
  --st-dark: #222222;
  --st-grey: #555555;
  --st-grey-light: #999999;
  --st-line: #222222;
  --st-font-head: "Oswald", "Arial Narrow", sans-serif;
  --st-font-body: "Fira Sans", "Helvetica Neue", Arial, sans-serif;
}

body { font-family: var(--st-font-body); color: var(--st-grey); background: #fff; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: var(--st-font-head); color: #333; }
a { color: var(--st-red); }
a:hover, a:focus { color: var(--st-red-dark); }
img { max-width: 100%; height: auto; }

/* ---------- Header: barra scura fissa, logo a sinistra, menu a destra ---------- */
.t4-section.st-header, .st-header-block { background: var(--st-dark); }
.st-header-block .header-wrap { min-height: 56px; }
.st-header-block .navbar-brand img, .st-header-block .logo-img { max-height: 40px; width: auto; }
.st-header-block .t4-navbar .nav-link,
.st-header-block .t4-navbar .navbar-nav > li > a {
  font-family: var(--st-font-head); font-weight: 400; font-size: 18px;
  color: #fff; padding: 16px 12px; text-transform: none;
}
.st-header-block .t4-navbar .navbar-nav > li > a:hover,
.st-header-block .t4-navbar .navbar-nav > li.active > a { color: var(--st-red); background: none; }
.st-header-block .dropdown-menu { background: var(--st-dark); border: 0; border-radius: 0; padding: 8px 0; }
.st-header-block .dropdown-menu a, .st-header-block .dropdown-menu .dropdown-item {
  color: #fff; font-family: var(--st-font-head); font-size: 16px; background: none;
}
.st-header-block .dropdown-menu a:hover, .st-header-block .dropdown-menu .dropdown-item:hover { color: var(--st-red); background: none; }
.st-header-block .t4-header-r a { color: #fff; font-size: 20px; margin-left: 10px; }
.st-header-block .t4-header-r a:hover { color: var(--st-red); }
.st-header-block .navbar-toggler, .st-header-block .t4-offcanvas-toggle { color: #fff; border-color: rgba(255,255,255,.4); }

/* ---------- Titoli di pagina e articoli ---------- */
.page-header { border-bottom: 1px solid var(--st-line); margin-bottom: 30px; }
.page-header h1, .page-header h2, .page-header .page-title {
  color: var(--st-grey-light); font-size: 18px; text-transform: uppercase; margin-bottom: 6px;
}
.item-title, .article-title, .item-page h1, .item-page h2, .item-page .page-header h2 {
  text-transform: uppercase; color: #333;
}
.item-page .page-header h2, .item-page .item-title { font-size: 34px; color: #444; }
.article-info, .article-aside, .article-info-term, .published { color: var(--st-grey-light); font-size: 13px; }
.item-image img, .item-page .item-image img { width: 100%; margin-bottom: 30px; }
.com-content-article__body, .item-page [itemprop="articleBody"] { color: #333; }
.com-content-article__body h3 { font-size: 24px; line-height: 1.4; }
.com-content-article__body h4 { font-size: 18px; line-height: 1.4; }

/* ---------- Colonna destra: box scuri ---------- */
.t4-section.st-main { padding-top: 40px; padding-bottom: 40px; }
.st-sidebar .t4-module, .st-sidebar .moduletable { background: var(--st-dark); color: #fff; padding: 18px 20px 20px; margin-bottom: 15px; }
.st-sidebar .module-title, .st-sidebar .module-title span, .st-sidebar h3 {
  color: #fff; text-transform: uppercase; font-size: 22px; font-family: var(--st-font-head); margin-bottom: 12px;
}
.st-sidebar .module-title::before { content: "\2630"; margin-right: 6px; font-size: .85em; }
.st-sidebar a { color: #fff; }
.st-sidebar a:hover { color: var(--st-red); }
.st-sidebar .nav, .st-sidebar ul { list-style: none; padding: 0; margin: 0; }
.st-sidebar .nav > li > a, .st-sidebar ul > li > a {
  display: block; padding: 3px 0; text-transform: uppercase; font-family: var(--st-font-head); font-size: 16px; letter-spacing: -.3px;
}
/* il box Facebook resta su fondo bianco, come oggi */
.st-sidebar .t4-module:has(.fb-page), .st-sidebar .moduletable:has(.fb-page) { background: transparent; padding: 0; }

/* ---------- Footer nero a 5 colonne ---------- */
.t4-section.st-footnav { background: #000; color: #ccc; padding: 45px 0 35px; }
.st-footnav .module-title, .st-footnav h3 { color: #ccc; font-family: var(--st-font-head); font-size: 18px; text-transform: uppercase; margin-bottom: 18px; }
.st-footnav ul { list-style: none; padding: 0; margin: 0; }
.st-footnav ul > li > a { display: block; color: #ccc; font-size: 14px; padding: 8px 0; border-bottom: 1px solid #333; }
.st-footnav ul > li > a:hover { color: #fff; }
.st-footnav p { color: #fff; font-size: 14px; line-height: 1.55; }
.st-footnav p a { color: var(--st-red); }
.t4-section.st-footer { background: #000; color: #777; font-size: 13px; padding: 12px 0 25px; }

/* ---------- Tabelle (es. calendario gare) ---------- */
.com-content-article__body table th, .st-table th { background: var(--st-dark); color: #fff; font-family: var(--st-font-body); font-size: 13px; padding: 8px; }
.com-content-article__body table td, .st-table td { font-size: 13px; padding: 7px 8px; border-bottom: 1px solid #eee; }

/* ---------- Telefono: una colonna, niente scorrimento orizzontale ---------- */
html, body { overflow-x: hidden; }
@media (max-width: 991.98px) {
  .st-sidebar { margin-top: 30px; }
  .st-header-block .navbar-brand img, .st-header-block .logo-img { max-height: 32px; }
  .item-page .page-header h2, .item-page .item-title { font-size: 26px; }
  .com-content-article__body table { display: block; overflow-x: auto; }
}

/* ---------- v2: icone social nel menu (voci Facebook/Instagram con immagine) ---------- */
.st-header-block .t4-navbar a.facebook img,
.st-header-block .t4-navbar a.instagram img { height: 20px; width: auto; filter: brightness(0) invert(1); }
.st-header-block .t4-navbar a.facebook, .st-header-block .t4-navbar a.instagram { padding-left: 6px; padding-right: 6px; }
.st-header-block .t4-navbar a.facebook:hover img, .st-header-block .t4-navbar a.instagram:hover img { filter: none; opacity: .85; }
.st-header-block .t4-navbar .navbar-nav { gap: 2px; }

/* ---------- v2: immagine dell'articolo a tutta larghezza (come il vecchio sito) ---------- */
.com-content-article .item-image, .item-page .item-image,
.com-content-article figure.item-image, .item-page figure.left, .item-page figure.right {
  float: none !important; width: 100% !important; max-width: 100%; margin: 0 0 30px !important;
}
.com-content-article .item-image img, .item-page .item-image img { width: 100%; height: auto; }

/* =====================================================================
   v2: HOME
   ===================================================================== */
/* Foto grande con il logo "Run Different" */
.t4-section.st-hero { background: #3a3a2a url("../../../../images/spiritotrail/st-hero.jpg") center 40% / cover no-repeat; }
.st-hero .st-hero-inner { min-height: 540px; display: flex; align-items: center; justify-content: center; padding: 60px 15px 140px; }
.st-hero .st-hero-inner img { max-width: 360px; width: 70%; height: auto; }

/* Riquadro chiaro che "sale" sulla foto: slider + categorie */
.t4-section.st-home-top { margin-top: -110px; position: relative; z-index: 2; }
.st-home-top > .container, .st-home-top > .container-xxl { background: #ecebe4; padding: 14px; }
.st-home-top .row { --bs-gutter-x: 12px; }

/* Slider */
.st-slider-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.st-slider-track::-webkit-scrollbar { display: none; }
.st-slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; height: 210px; background: #222 center / cover no-repeat; color: #fff; text-decoration: none; }
.st-slide-caption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 22px; align-items: center; padding: 14px 18px; background: rgba(0,0,0,.55); }
.st-slide-title { font-family: var(--st-font-head); font-size: 24px; line-height: 1.05; text-transform: uppercase; color: #fff; flex: 0 0 34%; letter-spacing: -.5px; }
.st-slide-intro { font-size: 13px; line-height: 1.35; color: #eee; }
.st-slide:hover .st-slide-title { color: #fff; text-decoration: underline; }

/* Box scuro "Categorie" */
.st-box-dark .t4-module, .st-box-dark .moduletable { background: var(--st-dark); color: #fff; height: 100%; padding: 16px 20px; }
.st-box-dark .module-title { color: #fff; font-size: 20px; text-transform: none; }
.st-box-dark .module-title::before { content: "\2630"; margin-right: 6px; font-size: .85em; }
.st-box-dark ul { list-style: none; padding: 0; margin: 0; }
.st-box-dark ul > li > a { color: #fff; display: block; padding: 3px 0; font-family: var(--st-font-head); font-size: 16px; text-transform: uppercase; letter-spacing: -.3px; }
.st-box-dark ul > li > a:hover { color: var(--st-red); }

/* Barra FLASH + ricerca */
.t4-section.st-flash { padding-top: 14px; }
.st-flash .row { align-items: stretch; }
.st-flash-bar { display: flex; align-items: center; background: var(--st-red); color: #fff; height: 100%; min-height: 46px; overflow: hidden; }
.st-flash-label { font-family: var(--st-font-head); font-size: 30px; letter-spacing: -1px; text-transform: uppercase; padding: 0 16px; flex: 0 0 auto; }
.st-flash-viewport { overflow: hidden; flex: 1 1 auto; }
.st-flash-items { display: inline-flex; gap: 40px; white-space: nowrap; animation: st-flash-scroll 60s linear infinite; }
.st-flash-items a { color: #fff; font-family: var(--st-font-head); font-size: 15px; text-transform: uppercase; }
.st-flash-bar:hover .st-flash-items { animation-play-state: paused; }
@keyframes st-flash-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .st-flash-items { animation: none; } }
.st-flash .mod-finder, .st-flash form { background: var(--st-red); padding: 8px; height: 100%; display: flex; align-items: center; }
.st-flash input[type="search"], .st-flash input[type="text"] { width: 100%; border: 0; border-radius: 0; padding: 6px 10px; font-size: 14px; }
.st-flash .mod-finder label, .st-flash .btn { display: none; }

/* Griglia articoli */
.t4-section.st-main-home { padding-top: 30px; }
.st-card-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--st-line); padding-bottom: 6px; margin-bottom: 12px; }
.st-card-cat { font-family: var(--st-font-head); color: #b5b6b7; font-size: 15px; text-transform: uppercase; letter-spacing: -.3px; }
.st-badge { background: var(--st-red); color: #fff; font-family: var(--st-font-head); font-size: 12px; text-transform: uppercase; padding: 2px 9px; }
.st-card-title { font-size: 25px; line-height: 1.02; text-transform: uppercase; letter-spacing: -.5px; margin: 0 0 14px; }
.st-card-title a { color: #333; }
.st-card-title a:hover { color: var(--st-red); }
.st-card-date { font-size: 12px; color: var(--st-grey); margin-bottom: 4px; }
.st-card-intro { font-size: 13px; line-height: 1.35; color: var(--st-grey); margin-bottom: 12px; }
.st-card-img { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: #eee; }
.st-card-img img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; }
.st-card-img:hover img { opacity: .85; }

@media (max-width: 991.98px) {
  .st-hero .st-hero-inner { min-height: 300px; padding: 40px 15px 90px; }
  .t4-section.st-home-top { margin-top: -70px; }
  .st-slide { min-height: 315px; }
  .st-slide-caption { flex-direction: column; align-items: flex-start; gap: 6px; }
  .st-slide-title { flex: none; font-size: 21px; }
  .st-box-dark { margin-top: 12px; }
  .st-flash .mod-finder, .st-flash form { margin-top: 8px; }
}

/* ---------- v3: una sola icona menu su telefono (usiamo il megamenu, non il pannello laterale) ---------- */
.st-header-block .t4-offcanvas-toggle { display: none !important; }

/* ---------- v3: articolo come il vecchio sito (categoria, foto, titolo, data) ---------- */
.st-article-cat { font-family: var(--st-font-head); color: var(--st-grey-light); font-size: 18px; text-transform: uppercase; border-bottom: 1px solid var(--st-line); padding-bottom: 6px; margin-bottom: 22px; }
.item-page .page-header { border-bottom: 0; margin-bottom: 4px; }
.item-page .page-header h1, .item-page .page-header h2 { color: #444; font-size: 34px; text-transform: uppercase; letter-spacing: -.5px; }
.item-page .article-info { margin-bottom: 14px; }
.item-page .article-info .category-name { display: none; } /* la categoria è già sopra la foto */
@media (max-width: 991.98px) { .item-page .page-header h1, .item-page .page-header h2 { font-size: 26px; } }

/* ---------- v4: layout "team" (ASD, Oscar, Contest) e "archivio" (rivista per anno) ---------- */
.st-team-title { font-size: 26px; text-transform: uppercase; color: #444; margin-bottom: 8px; }
.st-team .category-desc { font-size: 13px; color: var(--st-grey); margin-bottom: 18px; }
.st-team-img { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #eee; margin-bottom: 14px; }
.st-team-img img { width: 100%; height: 100%; object-fit: cover; }
.st-team-item-title { font-size: 21px; text-transform: uppercase; letter-spacing: -.3px; line-height: 1.1; margin-bottom: 8px; }
.st-team-item-title a { color: #444; }
.st-team-item-title a:hover { color: var(--st-red); }
.st-team-intro { font-size: 12px; line-height: 1.4; color: var(--st-grey); }

.st-issue { margin-bottom: 36px; }
.st-issue-title { font-size: 24px; text-transform: uppercase; color: #444; margin-bottom: 14px; }
.st-issue-title a { color: #444; }
.st-issue-cover img { width: 100%; height: auto; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.st-issue-toc { font-size: 12px; line-height: 1.35; column-count: 2; column-gap: 28px; color: #444; }
.st-issue-toc p { margin: 0 0 6px; break-inside: avoid; }
.st-issue-toc strong, .st-issue-toc b { color: #222; }
@media (max-width: 767.98px) { .st-issue-toc { column-count: 1; } }

/* ---------- v4: calendario gare (modulo mod_spiritotrail_calendario) ---------- */
.st-cal-filters { margin-bottom: 10px; }
.st-cal-filters .form-control, .st-cal-filters .form-select { border-radius: 0; font-size: 14px; }
.st-cal-count { font-size: 13px; color: var(--st-grey); margin-bottom: 8px; }
.st-cal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.st-cal-table th { background: var(--st-dark); color: #fff; font-weight: 700; padding: 8px 7px; text-align: left; white-space: nowrap; }
.st-cal-table td { padding: 7px; border-bottom: 1px solid #e5e5e5; vertical-align: top; color: #333; }
.st-cal-table tbody tr:nth-child(even) td { background: #fafafa; }
.st-cal-table td.num { text-align: right; white-space: nowrap; }
.st-cal-table .st-cal-name { text-transform: uppercase; }
.st-cal-table a { color: var(--st-red); font-weight: 500; }
@media (max-width: 767.98px) {
  .st-cal-table thead { display: none; }
  .st-cal-table, .st-cal-table tbody, .st-cal-table tr, .st-cal-table td { display: block; width: 100%; }
  .st-cal-table tr { border: 1px solid #e5e5e5; margin-bottom: 10px; padding: 8px 10px; background: #fff; }
  .st-cal-table tbody tr:nth-child(even) td { background: none; }
  .st-cal-table td { border: 0; padding: 2px 0; text-align: left !important; }
  .st-cal-table td::before { content: attr(data-l) ": "; font-weight: 700; color: #777; }
  .st-cal-table td.st-cal-name { font-family: var(--st-font-head); font-size: 18px; }
  .st-cal-table td.st-cal-name::before, .st-cal-table td:empty { display: none; }
}
@media (max-width: 767.98px) {
  .com-content-article__body .st-cal-table td, .st-cal .st-cal-table td { border: 0; padding: 2px 0; }
  .com-content-article__body .st-cal-table tr, .st-cal .st-cal-table tr { border: 1px solid #e5e5e5; }
}
.st-team .category-desc, .st-archivio .category-desc { border: 0; padding: 0; background: none; }

/* =====================================================================
   v5: RIFINITURE
   ===================================================================== */
/* Menu: freccia grigia sulle voci con sottomenu, come il vecchio sito */
.st-header-block .t4-megamenu .item-caret { display: inline-block; width: 0; height: 0; margin-left: 6px; vertical-align: middle;
  border-top: 4px solid #999; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.st-header-block .t4-megamenu .item-caret::before, .st-header-block .t4-megamenu .item-caret::after { display: none; }
.st-header-block .t4-megamenu .navbar-nav > li > a { padding-left: 14px; padding-right: 14px; }

/* Sottomenu: riquadro #222 pieno, voci bianche in Oswald */
.st-header-block .t4-megamenu .dropdown-menu,
.st-header-block .t4-megamenu .dropdown-menu .dropdown-menu-inner { background: #222 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none; }
.st-header-block .t4-megamenu .dropdown-menu { min-width: 200px; padding: 10px 0; }
.st-header-block .t4-megamenu .dropdown-menu ul { list-style: none; margin: 0; padding: 0; }
.st-header-block .t4-megamenu .dropdown-menu a.dropdown-item,
.st-header-block .t4-megamenu .dropdown-menu a.dropdown-item span { color: #fff !important; background: none !important; font-family: var(--st-font-head); font-size: 16px; opacity: 1; }
/* padding solo sul link: sugli span annidati creava un rientro sulla prima riga e restringeva la voce */
.st-header-block .t4-megamenu .dropdown-menu a.dropdown-item { padding: 7px 22px; }
@media (min-width: 992px) { .st-header-block .t4-megamenu .dropdown-menu a.dropdown-item { white-space: nowrap; } }
.st-header-block .t4-megamenu .dropdown-menu a.dropdown-item span { padding: 0; }
.st-header-block .t4-megamenu .dropdown-menu, .st-header-block .t4-megamenu .dropdown-menu-inner { width: auto; min-width: 220px; }
.st-header-block .t4-megamenu .dropdown-menu a.dropdown-item:hover,
.st-header-block .t4-megamenu .dropdown-menu a.dropdown-item:hover span,
.st-header-block .t4-megamenu .dropdown-menu .active > a.dropdown-item span { color: var(--st-red) !important; }

/* Titoli di pagina grigi solo per categorie/elenchi, non per gli articoli */
.com-content-category-blog > .page-header h1, .com-content-category-blog > h2, .com-content-category > h1 { color: var(--st-grey-light); font-size: 18px; text-transform: uppercase; }

/* Articoli negli elenchi blog */
.com-content-category-blog .blog-item, .com-content-category-blog__item { margin-bottom: 38px; }
.st-blog-img { display: block; position: relative; overflow: hidden; width: 100%; aspect-ratio: 3 / 2; margin-bottom: 18px; background: #ecebe4; }
.st-blog-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
/* overlay come nel vecchio sito: leggero scurimento e zoom al passaggio del mouse */
.st-blog-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.18), rgba(0,0,0,0) 45%); transition: background-color .3s ease; pointer-events: none; }
.st-blog-img:hover::after { background-color: rgba(0,0,0,.18); }
.st-blog-img:hover img { transform: scale(1.03); }
.st-blog-title { font-size: 26px; line-height: 1.1; text-transform: uppercase; letter-spacing: -.4px; margin: 0 0 6px; }
.st-blog-title a { color: #444; }
.st-blog-title a:hover { color: var(--st-red); }
.st-blog-date { font-size: 11px; color: var(--st-grey); margin-bottom: 6px; }
.st-blog-intro { font-size: 12.5px; line-height: 1.45; color: #444; }
.com-content-category-blog .items-row, .com-content-category-blog .blog-items { --bs-gutter-x: 30px; }

/* Sottomenu sempre pienamente opaco quando è aperto (l'animazione "slide" di T4 lo lasciava semitrasparente) */
.st-header-block .t4-megamenu.animate .dropdown-menu { transition: opacity .15s ease, visibility .15s ease !important; }
.st-header-block .t4-megamenu .nav-item.dropdown:hover > .dropdown-menu,
.st-header-block .t4-megamenu .nav-item.dropdown.show > .dropdown-menu,
.st-header-block .t4-megamenu .nav-item.dropdown:focus-within > .dropdown-menu { opacity: 1 !important; visibility: visible !important; display: block; }

/* Sottomenu più compatto, come l'originale */
.st-header-block .t4-megamenu .dropdown-menu li { margin: 0; padding: 0; }
.st-header-block .t4-megamenu .dropdown-menu a.dropdown-item { padding: 5px 22px; line-height: 1.25; }

/* Footer: solo il copyright, senza la riga su Joomla (il vecchio sito non la mostrava) */
.st-footer .footer2 { display: none; }
.st-footer .footer1 { color: #777; }

/* Box Facebook nella colonna destra della home */
.st-sidebar .fb-page, .st-sidebar .fb-page span, .st-sidebar .fb-page iframe { max-width: 100% !important; }

/* Menu aperto su telefono/tablet: pannello scuro, voci bianche */
@media (max-width: 991.98px) {
  .st-header-block .t4-megamenu.collapse.show, .st-header-block .t4-megamenu.collapsing,
  .st-header-block .t4-megamenu .navbar-nav { background: #222 !important; }
  .st-header-block .t4-megamenu.collapse.show { padding: 6px 0 12px; }
  .st-header-block .t4-megamenu .navbar-nav > li > a, .st-header-block .t4-megamenu .navbar-nav > li > a span { color: #fff !important; padding: 9px 18px; }
  .st-header-block .t4-megamenu .navbar-nav > li.active > a, .st-header-block .t4-megamenu .navbar-nav > li.active > a span { color: var(--st-red) !important; }
  .st-header-block .t4-megamenu .dropdown-menu { position: static !important; background: #2b2b2b !important; padding: 2px 0 6px; }
  .st-header-block .t4-megamenu .dropdown-menu a.dropdown-item { padding: 6px 32px; }
  .st-header-block .t4-megamenu .navbar-nav > li { border-bottom: 1px solid #333; }
}
@media (max-width: 991.98px) {
  .st-header-block .t4-megamenu.collapse.show { max-height: calc(100vh - 60px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* ---------- v6: modulo "Ultime dal forum" (mod_spiritotrail_forum) ---------- */
.st-forum__item { padding: 9px 0; border-bottom: 1px solid #3a3a3a; }
.st-forum__item:first-child { padding-top: 0; }
.st-sidebar .st-forum ul > li > a.st-forum__title {
  display: block; padding: 0; text-transform: none; font-family: var(--st-font-body); font-size: 15px; font-weight: 500; letter-spacing: 0; line-height: 1.3;
}
.st-forum__meta { display: block; margin-top: 3px; font-size: 12px; color: #aaa; }
.st-sidebar .st-forum__meta a { color: #ccc; }
.st-sidebar .st-forum__meta a:hover { color: var(--st-red); }
.st-forum__all { margin: 12px 0 0; font-family: var(--st-font-head); text-transform: uppercase; font-size: 15px; }

/* ---------- v7: moduli RSForm (Contatti, Inserimento in calendario) ---------- */
.formContainer { max-width: 640px; margin-top: 10px; }
.formContainer .form-group, .formContainer .rsform-block { margin-bottom: 18px; }
.formContainer .rsform-block-header, .formContainer .rsform-block-antispam { margin-top: 6px; }
.formContainer .formControlLabel, .formContainer .control-label {
  display: block; float: none; width: auto; max-width: none; flex: none; padding: 0; text-align: left;
  font-weight: 500; color: #333; font-size: 15px; margin: 0 0 6px;
}
.formContainer .formControls { display: block; float: none; width: auto; max-width: none; flex: none; padding: 0; }
.formContainer .formRequired { color: var(--st-red); margin-left: 2px; }
.formContainer input[type="text"], .formContainer input[type="email"], .formContainer input[type="tel"], .formContainer input[type="url"],
.formContainer input[type="number"], .formContainer textarea, .formContainer select {
  display: block; width: 100%; max-width: 100%; box-sizing: border-box; padding: 9px 12px;
  border: 1px solid #ccc; border-radius: 0; background: #fff; color: #222; font: 15px/1.4 var(--st-font-body); box-shadow: none;
}
.formContainer textarea { min-height: 160px; resize: vertical; }
.formContainer input:focus, .formContainer textarea:focus, .formContainer select:focus { outline: none; border-color: var(--st-dark); box-shadow: 0 0 0 2px rgba(216, 0, 26, .15); }
/* Data con il pulsante del calendario affiancato */
.formContainer .formBody:has(.rsform-calendar-button), .formContainer .formControls:has(.rsform-calendar-button) { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; }
.formContainer .formBody:has(.rsform-calendar-button) > input[type="text"] { width: 180px; flex: 0 0 180px; }
.formContainer .formBody:has(.rsform-calendar-button) > .formValidation { flex-basis: 100%; }
.formContainer .rsform-calendar-button, .formContainer button.btn-calendar {
  border: 1px solid #ccc; border-left: 0; background: #f3f3f3; color: #333; padding: 0 12px; border-radius: 0; cursor: pointer;
}
.formContainer .formDescription, .formContainer .help-block:not(.formValidation) { display: block; font-size: 13px; color: #888; margin: 5px 0 0; line-height: 1.45; }
.formContainer .formDescription:empty { display: none; }
.formContainer .formBody > br { display: none; }
/* Scelte Sì/No */
.formContainer input[type="radio"], .formContainer input[type="checkbox"] { width: auto; margin: 0 6px 0 0; accent-color: var(--st-red); vertical-align: middle; }
.formContainer .formBody > label:has(input[type="radio"]) { display: inline-flex; align-items: center; margin: 4px 24px 4px 0; font-weight: 400; color: #333; cursor: pointer; }
/* Casella di consenso: testo (con link) su più righe accanto alla casella */
.formContainer label:has(input[type="checkbox"]) { display: block; position: relative; padding-left: 28px; margin: 2px 0; font-weight: 400; color: #333; line-height: 1.5; cursor: pointer; }
.formContainer label:has(input[type="checkbox"]) input[type="checkbox"] { position: absolute; left: 0; top: 3px; width: 17px; height: 17px; margin: 0; }
/* Errori di validazione */
.formContainer .formValidation, .formContainer .formError { color: var(--st-red); font-size: 13px; font-weight: 500; }
.formContainer .formValidation:empty { display: none; }
.formContainer .formValidation:has(> .formNoError:only-child) { display: none; }
.formContainer .rsform-error, .formContainer input.rsform-error, .formContainer textarea.rsform-error { border-color: var(--st-red); }
.formRed { color: var(--st-red); font-weight: 500; }
/* Pulsante anti-spam "Non sono un robot" (HashCash) */
.formContainer [data-rsfp-hashcash] {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 8px; min-width: 230px;
  border: 1px solid #ccc; border-radius: 0; background: #fafafa; color: #333; font: 15px var(--st-font-body); cursor: pointer;
}
.formContainer [data-rsfp-hashcash]:hover { border-color: var(--st-dark); }
.formContainer [data-rsfp-hashcash] svg { width: 34px; height: 34px; flex: 0 0 34px; }
/* Pulsante di invio come i pulsanti del sito */
.formContainer button[type="submit"], .formContainer input[type="submit"], .formContainer .rsform-submit-button {
  display: inline-block; background: var(--st-red); border: 0; border-radius: 0; color: #fff; cursor: pointer;
  font-family: var(--st-font-head); font-size: 18px; font-weight: 400; text-transform: uppercase; letter-spacing: .3px; padding: 10px 34px;
}
.formContainer button[type="submit"]:hover, .formContainer input[type="submit"]:hover, .formContainer .rsform-submit-button:hover { background: var(--st-red-dark); color: #fff; }
@media (max-width: 575.98px) {
  .formContainer [data-rsfp-hashcash] { width: 100%; }
  .formContainer button[type="submit"], .formContainer input[type="submit"], .formContainer .rsform-submit-button { width: 100%; }
}

/* ---------- v8: paginazione (blog, categorie, ricerca) nei colori del sito ---------- */
.pagination { --bs-pagination-color: var(--st-dark); --bs-pagination-hover-color: #fff; --bs-pagination-hover-bg: var(--st-red); --bs-pagination-hover-border-color: var(--st-red);
  --bs-pagination-focus-color: var(--st-dark); --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(216, 0, 26, .2);
  --bs-pagination-active-bg: var(--st-red); --bs-pagination-active-border-color: var(--st-red); --bs-pagination-border-radius: 0; --bs-pagination-border-color: #ddd; }
.pagination .page-link { border-radius: 0 !important; font-family: var(--st-font-body); }
.pagination .page-item.active .page-link { background-color: var(--st-red); border-color: var(--st-red); color: #fff; }
.pagination .page-link:hover { background-color: var(--st-red); border-color: var(--st-red); color: #fff; }
.com-content-category-blog__counter, .counter { color: var(--st-grey-light); }

/* ---------- v9: fascia alta della home su tre colonne (slider, categorie, banner) ---------- */
.st-home-top .row { align-items: stretch; }
.st-home-top .home-slider .st-slider, .st-home-top .home-slider .st-slider-track { height: 100%; }
.st-slide { height: 100%; min-height: 315px; }
.st-home-banner .carouselbanner-wrp, .st-home-banner .carouselbanner { height: 100%; }
.st-home-banner .banneritem img { display: block; width: 100%; height: auto; }
/* Senza banner pubblicati la colonna resta vuota: slider e categorie si riprendono lo spazio, come prima */
@media (min-width: 992px) {
  .st-home-top .row:not(:has(.st-home-banner .banneritem)) > .home-slider { flex: 0 0 66.6667%; max-width: 66.6667%; }
  .st-home-top .row:not(:has(.st-home-banner .banneritem)) > .home-categorie { flex: 0 0 33.3333%; max-width: 33.3333%; }
}
.st-home-top .row:not(:has(.st-home-banner .banneritem)) > .st-home-banner { display: none; }
.st-home-banner .carouselbanner { margin: 0 !important; }
.st-home-banner .tns-outer, .st-home-banner .tns-ovh { height: 100%; }
@media (max-width: 991.98px) {
  .st-home-banner { margin-top: 12px; }
  .st-home-banner .banneritem img { max-width: 340px; margin: 0 auto; }
}

/* ---------- v10: carousel banner nella colonna destra (interne e home) ---------- */
.st-sidebar .t4-module:has(.carouselbanner-wrp), .st-sidebar .moduletable:has(.carouselbanner-wrp) { background: transparent; padding: 0; }
.st-sidebar .t4-module:has(.carouselbanner-wrp):not(:has(.banneritem)), .st-sidebar .moduletable:has(.carouselbanner-wrp):not(:has(.banneritem)) { display: none; }
.st-sidebar .carouselbanner { margin: 0 !important; }
.st-sidebar .banneritem img { display: block; width: 100%; height: auto; }

/* ---------- v11: elenchi di articoli (Archivio): freccina al posto dell'icona FontAwesome mancante ---------- */
.category-module li a, .st-sidebar .category-module ul > li > a { position: relative; padding-left: 15px; }
.category-module li a::before { content: "\25B8"; font-family: inherit; color: var(--st-red); left: 0; top: 0; }
.st-sidebar .category-module .mod-articles-category-group { color: #ccc; font-family: var(--st-font-head); text-transform: uppercase; margin: 12px 0 4px; }

/* ---------- v12: sottomenu nel menu del telefono rientrati rispetto alle voci principali ---------- */
@media (max-width: 991.98px) {
  .st-header-block .t4-megamenu .dropdown-menu a.dropdown-item { padding: 8px 20px 8px 72px; white-space: normal; }
}

/* ---------- v13: numeri della rivista sfogliabili (layout magazine, iPages) ---------- */
.st-magazine__viewer { margin: 10px 0 30px; background: #ecebe4; }
.st-magazine__book { width: 100%; height: 640px; }
.st-magazine__cover { max-width: 320px; height: auto; }
@media (max-width: 767.98px) { .st-magazine__book { height: auto; min-height: 480px; } }

/* ---------- v14: finestra modale per link (informativa privacy nei moduli) ---------- */
.st-modal-dialog { width: min(900px, 94vw); height: min(85vh, 900px); padding: 0; border: 0; border-radius: 0; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.st-modal-dialog::backdrop { background: rgba(0,0,0,.6); }
.st-modal-dialog[open] { display: flex; flex-direction: column; }
.st-modal-bar { display: flex; align-items: center; justify-content: space-between; background: var(--st-dark); color: #fff; padding: 10px 16px; }
.st-modal-title { font-family: var(--st-font-head); font-size: 18px; text-transform: uppercase; }
.st-modal-close { background: none; border: 0; color: #fff; font-size: 30px; line-height: 1; cursor: pointer; padding: 0 4px; }
.st-modal-close:hover { color: var(--st-red); }
.st-modal-frame { flex: 1; width: 100%; border: 0; background: #fff; }
