:root {
  --blu: #1c2b45;          /* testi forti, header, footer */
  --blu-2: #273a5c;
  --rosso: #d23f31;        /* accento principale (colore FVG) */
  --rosso-scuro: #a92e23;
  --rosso-chiaro: #fdecea;
  --fondo: #f5f6f8;
  --carta: #ffffff;
  --testo: #3a4253;
  --testo-tenue: #6f7889;
  --linea: #e3e6eb;
  --raggio: 12px;
  --ombra: 0 1px 2px rgba(28, 43, 69, .05), 0 8px 24px rgba(28, 43, 69, .07);
  --ombra-hover: 0 2px 4px rgba(28, 43, 69, .06), 0 16px 36px rgba(28, 43, 69, .12);
  --font-titoli: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  --font-testo: 'Source Sans Pro', 'Segoe UI', Arial, sans-serif;
}

/* ---------- Base ---------- */

body {
  background: var(--fondo);
  color: var(--testo);
  font-family: var(--font-testo);
  font-size: 17px;
  line-height: 1.65;
}

body #page,
body .block-content {
  background-color: var(--fondo) !important;
}

body a { color: var(--rosso); transition: color .2s, background-color .2s, border-color .2s; }
body a:hover { color: var(--rosso-scuro); }
body a:focus-visible,
body button:focus-visible,
body input:focus-visible {
  outline: 3px solid rgba(210, 63, 49, .45);
  outline-offset: 2px;
}

body h1, body h2, body h3, body h4, body h5, body h6,
body .title-h1, body .title-h2, body .title-h3, body .title-h4 {
  color: var(--blu);
  font-family: var(--font-titoli);
  letter-spacing: -.01em;
}
body .light,
body .title-h1 .light,
body h1.light {
  font-family: var(--font-titoli);
  font-weight: 300;
}

body ::selection { background: var(--rosso); color: #fff; }

/* preloader */
body #page-preloader { background: var(--fondo); }
body #page-preloader .page-preloader-spin {
  border-top-color: var(--rosso);
  border-left-color: var(--rosso);
}

/* ---------- Header ---------- */

body #site-header,
body #site-header-wrapper {
  background: rgba(255, 255, 255, .96);
}
body #site-header {
  border-bottom: 1px solid var(--linea);
  box-shadow: 0 2px 14px rgba(28, 43, 69, .06);
}

/* voci di primo livello */
body #primary-menu.no-responsive > li > a {
  position: relative;
  color: var(--blu) !important;
  font-family: var(--font-titoli);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: none !important;
  border: 0 !important;
}
body #primary-menu.no-responsive > li > a::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 22px;
  height: 2px;
  background: var(--rosso);
  transition: left .25s, right .25s;
}
body #primary-menu.no-responsive > li > a:hover,
body #primary-menu.no-responsive > li.menu-item-active > a,
body #primary-menu.no-responsive > li.menu-item-current > a {
  color: var(--rosso) !important;
}
body #primary-menu.no-responsive > li > a:hover::after,
body #primary-menu.no-responsive > li.menu-item-active > a::after,
body #primary-menu.no-responsive > li.menu-item-current > a::after {
  left: 18px;
  right: 18px;
}

/* sottomenu */
body #primary-menu.no-responsive li ul {
  background: var(--carta) !important;
  border: 1px solid var(--linea) !important;
  border-top: 3px solid var(--rosso) !important;
  border-radius: 0 0 10px 10px;
  box-shadow: var(--ombra);
  padding: 6px 0;
}
body #primary-menu.no-responsive li li > a {
  color: var(--testo) !important;
  background: none !important;
  border: 0 !important;
  border-left: 3px solid transparent !important;
  font-family: var(--font-titoli);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
body #primary-menu.no-responsive li li:hover > a,
body #primary-menu.no-responsive li li.menu-item-active > a,
body #primary-menu.no-responsive li li.menu-item-current > a {
  color: var(--rosso) !important;
  background: var(--rosso-chiaro) !important;
  border-left-color: var(--rosso) !important;
}

/* hamburger mobile */
body #primary-navigation .menu-toggle span { background-color: var(--blu) !important; }
body #primary-navigation .dl-menu.dl-menuopen,
body #primary-menu.responsive {
  background: var(--carta);
}
body #primary-menu.responsive li a {
  color: var(--blu) !important;
  border-color: var(--linea) !important;
}
body #primary-menu.responsive li.menu-item-active > a {
  color: var(--rosso) !important;
}

/* ---------- Banner "Ti serve aiuto?" (sotto lo slider) ---------- */

body .vc_custom_1493292262108 {
  margin: 15px !important;
  padding: 30px 20px !important;
  background: var(--rosso) !important;
  background-image: linear-gradient(120deg, var(--rosso) 0%, #e2563f 100%) !important;
  border-radius: var(--raggio);
  box-shadow: 0 12px 30px rgba(210, 63, 49, .3);
}
body .custom-border {
  border: 0 !important;
  outline: 0 !important;
}

/* pulsanti del tema (anche quelli con colori inline) */
body .gem-button {
  border-radius: 999px !important;
  padding-left: 28px !important;
  padding-right: 28px !important;
  font-family: var(--font-titoli);
  font-weight: 700 !important;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: background-color .2s, color .2s, transform .2s, box-shadow .2s !important;
}
body .gem-button-container .gem-button {
  background-color: var(--blu) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(28, 43, 69, .25);
}
body .gem-button-container .gem-button:hover {
  background-color: #fff !important;
  color: var(--rosso) !important;
  transform: translateY(-2px);
}

/* ---------- Testo di benvenuto ---------- */

body .title-xlarge {
  color: var(--blu);
  line-height: 1.1;
}
body .title-xlarge .light { color: var(--testo-tenue); }
body .title-xlarge .title-h2 .light {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 16px;
  background: var(--rosso-chiaro);
  border-radius: 999px;
  color: var(--rosso);
  font-size: .55em;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body .styled-subtitle {
  max-width: 820px;
  margin: 0 auto;
  font-size: 19px;
  line-height: 1.7;
}
body .styled-subtitle span { color: var(--testo) !important; }
body .styled-subtitle strong { color: var(--blu); }

/* ---------- Separatore con titolo ("Tematiche") ---------- */

body .vc_separator .vc_sep_line {
  border-color: var(--linea) !important;
  border-top-width: 2px !important;
}
body .vc_separator h1,
body .vc_separator h2 {
  color: var(--blu);
  font-size: 34px;
  padding: 0 18px;
}

/* ---------- Schede tematiche (Alcol, Gioco, Tabacco, Sostanze) ---------- */

body .vc_row-o-equal-height .vc_col-has-fill > .vc_column-inner {
  position: relative;
  background: var(--carta) !important;
  border: 1px solid var(--linea);
  border-radius: var(--raggio);
  box-shadow: var(--ombra);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
body .vc_row-o-equal-height .vc_col-has-fill > .vc_column-inner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--rosso);
  border-radius: var(--raggio) var(--raggio) 0 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s;
}
body .vc_row-o-equal-height .vc_col-has-fill > .vc_column-inner:hover {
  transform: translateY(-6px);
  box-shadow: var(--ombra-hover);
  border-color: transparent;
}
body .vc_row-o-equal-height .vc_col-has-fill > .vc_column-inner:hover::before {
  transform: scaleX(1);
}

/* icona: cerchio invece di "sporgere" fuori dalla scheda */
body .vc_custom_1493972048252,
body .vc_custom_1498834252858,
body .vc_custom_1493972236145,
body .vc_custom_1493972288346 {
  margin-top: 0 !important;
  padding-top: 32px;
}
body .vc_col-has-fill .vc_single_image-wrapper {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 130px;
  height: 130px;
  background: var(--rosso-chiaro);
  border: 0 !important;
  border-radius: 50%;
  transition: background .25s;
}
body .vc_col-has-fill .vc_single_image-img {
  max-height: 72px;
  width: auto;
  border: 0 !important;
  box-shadow: none !important;
}
body .vc_col-has-fill .vc_column-inner:hover .vc_single_image-wrapper {
  background: #fbd9d5;
}

body .vc_col-has-fill .title-h4 { margin-top: 18px; }
body .vc_col-has-fill .title-h4 a {
  color: var(--blu);
  font-size: 18px;
}
body .vc_col-has-fill .vc_column-inner:hover .title-h4 a { color: var(--rosso); }

/* ---------- Riquadro newsletter ---------- */

body .vc_custom_1492171607935 {
  margin: 15px !important;
  padding: 36px 24px !important;
  background: var(--blu) !important;
  background-image: linear-gradient(135deg, var(--blu) 0%, var(--blu-2) 100%) !important;
  border-radius: var(--raggio);
  box-shadow: var(--ombra-hover);
}

/* ---------- Sezione "Domande? Scrivici" ---------- */

body .vc_custom_1493299594231 {
  background-color: var(--blu) !important;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(210, 63, 49, .25), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(255, 255, 255, .06), transparent 40%) !important;
}

/* ---------- Moduli (Contact Form 7) ---------- */

body .wpcf7-form input[type="text"],
body .wpcf7-form input[type="email"],
body .wpcf7-form input[type="tel"],
body .wpcf7-form textarea {
  width: 100%;
  padding: 12px 16px !important;
  background: #fff !important;
  border: 1px solid #d3d8e0 !important;
  border-radius: 8px !important;
  color: var(--blu) !important;
  font-family: var(--font-testo);
  font-size: 16px;
  box-shadow: none !important;
  transition: border-color .2s, box-shadow .2s;
}
body .wpcf7-form input:focus,
body .wpcf7-form textarea:focus {
  border-color: var(--rosso) !important;
  box-shadow: 0 0 0 3px rgba(210, 63, 49, .18) !important;
  outline: 0;
}
body .wpcf7-form ::placeholder { color: #9aa2b1; opacity: 1; }

/* moduli su sfondo scuro: campi semitrasparenti */
body .vc_custom_1492171607935 .wpcf7-form input[type="text"],
body .vc_custom_1492171607935 .wpcf7-form input[type="email"],
body .gem-contact-form-white input[type="text"],
body .gem-contact-form-white input[type="email"],
body .gem-contact-form-white textarea,
body #colophon .wpcf7-form input[type="text"],
body #colophon .wpcf7-form input[type="email"] {
  background: rgba(255, 255, 255, .08) !important;
  border-color: rgba(255, 255, 255, .22) !important;
  color: #fff !important;
}
body .vc_custom_1492171607935 .wpcf7-form ::placeholder,
body .gem-contact-form-white ::placeholder,
body #colophon .wpcf7-form ::placeholder { color: rgba(255, 255, 255, .6); }

body .wpcf7-form input[type="submit"],
body .wpcf7-form.gem-contact-form-white input[type="submit"],
body #colophon .wpcf7-form input[type="submit"] {
  padding: 12px 32px !important;
  background-color: var(--rosso) !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #fff !important;
  font-family: var(--font-titoli);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(210, 63, 49, .3);
  transition: background-color .2s, transform .2s, box-shadow .2s;
}
body .wpcf7-form input[type="submit"]:hover,
body .wpcf7-form.gem-contact-form-white input[type="submit"]:hover,
body #colophon .wpcf7-form input[type="submit"]:hover {
  background-color: var(--rosso-scuro) !important;
  color: #fff !important;
  transform: translateY(-2px);
}

body .wpcf7-form.gem-contact-form-white .col-md-12:last-child { text-align: center; }

/* messaggi di esito */
body div.wpcf7-response-output {
  margin: 12px 0 0 !important;
  padding: 10px 14px !important;
  border-radius: 8px;
  font-size: 15px;
  text-align: center;
}
body div.wpcf7-mail-sent-ok {
  background: #1f8a5b !important;
  border: 0 !important;
  color: #fff !important;
}
body div.wpcf7-validation-errors,
body #colophon .widget_black_studio_tinymce div.wpcf7-validation-errors {
  background: #fff4cc !important;
  border: 0 !important;
  color: #6b5400 !important;
}
body .wpcf7-not-valid-tip {
  margin-top: 4px;
  color: #ff8a80;
  font-size: 13px;
}

/* ---------- Footer ---------- */

body #colophon {
  background: #141f33 !important;
  border-top: 4px solid var(--rosso);
  color: #b8c0cf;
}
body #colophon .container { padding-top: 20px; }

body #colophon h5,
body #colophon h5 span {
  color: #fff !important;
  font-family: var(--font-titoli);
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
body #colophon h5 {
  position: relative;
  padding-bottom: 12px;
}
body #colophon h5::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 3px;
  background: var(--rosso);
  border-radius: 2px;
}
body #colophon h6,
body #colophon #black-studio-tinymce-2 h6 {
  color: #d5dbe5;
  font-family: var(--font-testo);
  font-size: 14px;
  line-height: 1.6;
}

body #colophon .widget ul { margin: 0; padding: 0; list-style: none; }
body #colophon #black-studio-tinymce-5 li {
  padding: 0 0 .7em !important;
  border: 0;
}
body #colophon .widget a {
  color: #d5dbe5;
  transition: color .2s, padding-left .2s;
}
body #colophon .widget li a::before {
  content: "\203A";
  display: inline-block;
  width: 14px;
  color: var(--rosso);
  font-weight: bold;
}
body #colophon .widget a:hover {
  color: #fff !important;
  padding-left: 4px;
}

body #colophon .facebook { color: #d5dbe5; }

/* ---------- Banner cookie ---------- */

body #cookie-notice {
  background-color: rgba(20, 31, 51, .97) !important;
  color: #e6e9ef !important;
  font-family: var(--font-testo);
  font-size: 15px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .2);
}
body #cookie-notice .cn-button {
  margin-left: 10px;
  padding: 6px 16px !important;
  background: var(--rosso) !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #fff !important;
  font-weight: 600;
  text-shadow: none !important;
  box-shadow: none !important;
}
body #cookie-notice .cn-more-info {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, .4) !important;
}

/* ---------- Pagine interne (articoli, widget, tabelle) ---------- */

body .post-content p,
body .entry-content p { color: var(--testo); }

body .post-content blockquote {
  margin: 1.5em 0;
  padding: 16px 22px;
  background: var(--carta);
  border-left: 4px solid var(--rosso);
  border-radius: 0 var(--raggio) var(--raggio) 0;
  color: var(--blu);
  font-style: italic;
}

body .post-content table {
  width: 100%;
  border-collapse: collapse;
  background: var(--carta);
  border-radius: var(--raggio);
  overflow: hidden;
  box-shadow: var(--ombra);
}
body .post-content table th {
  background: var(--blu);
  color: #fff;
  font-family: var(--font-titoli);
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
body .post-content table th,
body .post-content table td {
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--linea);
  text-align: left;
}
body .post-content table tr:nth-child(even) td { background: #fafbfc; }

body .widget-title,
body .widget h3,
body .widget h4 {
  color: var(--blu);
  font-family: var(--font-titoli);
}
body .widget_nav_menu ul.menu a,
body .widget_submenu ul a,
body .widget_pages ul a,
body .widget_categories ul a {
  color: var(--testo);
  border-color: var(--linea) !important;
}
body .widget_nav_menu li.current-menu-item > a,
body .widget_submenu li.menu-item-active > a,
body .widget_nav_menu ul.menu a:hover,
body .widget_submenu ul a:hover {
  color: var(--rosso) !important;
  border-left-color: var(--rosso) !important;
}

body .widget .tagcloud a {
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 999px;
  color: var(--testo);
}
body .widget .tagcloud a:hover {
  background: var(--rosso);
  border-color: var(--rosso) !important;
  color: #fff;
}

/* titolo pagina interna (barra del titolo di TheGem) */
body #page-title {
  background-color: var(--blu) !important;
}
body #page-title .page-title-title h1,
body #page-title .page-title-title { color: #fff; }

/* paginazione */
body .gem-pagination a,
body .gem-pagination span {
  border-radius: 8px;
  border-color: var(--linea) !important;
}
body .gem-pagination .current,
body .gem-pagination a:hover {
  background: var(--rosso) !important;
  border-color: var(--rosso) !important;
  color: #fff !important;
}

/* ---------- Schermi piccoli ---------- */

@media (max-width: 767px) {
  body { font-size: 16px; }
  body .title-xlarge { font-size: 40px; }
  body .styled-subtitle { font-size: 17px; text-align: left !important; }
  body .vc_separator h1 { font-size: 26px; }

  body .vc_row-o-equal-height .vc_col-has-fill { margin-bottom: 20px; }
  body .vc_col-has-fill .vc_single_image-wrapper { width: 110px; height: 110px; }

  body .vc_custom_1493292262108,
  body .vc_custom_1492171607935 {
    margin: 10px !important;
    padding: 24px 16px !important;
  }
  body .vc_custom_1492171607935 .title-h1 { margin-bottom: 18px; }

  body #cookie-notice .cn-button { margin: 8px 6px 0; }
}

/* ---------- Accessibilita' ---------- */

@media (prefers-reduced-motion: reduce) {
  body * {
    transition: none !important;
    animation: none !important;
  }
  body .wpb_animate_when_almost_visible { opacity: 1 !important; }
}