/* BANDIERA HEADER */
html {
  overflow-x: hidden !important;
}
.flag_container {
  display: block;
}
header.is-sticky .flag_container {
  position: relative;
  z-index: 100;
  width: 100%;
}
.flag_container div {
  width: 33.3333333333%;
  height: 8px;
  overflow: hidden;
  float: left;
}
.flag_container div.green {
  background: #009246;
}
.flag_container div.white {
  background: #fff;
  box-shadow: rgb(0 0 0 / 15%) 0px 0px 7px 0px;
}
.flag_container div.red {
  background: #ce2b37;
}
@media (max-width: 1024px) {
  .flag_container div {
    display: none;
  }
}
#it-block-italiagov-local-tasks {
  background-color: #f7f7f7 !important;
}
#it-block-italiagov-local-tasks .tabs {
  background-color: #f7f7f7 !important;
}
#it-block-italiagov-local-tasks .nav-item {
  background-color: #f7f7f7 !important;
}
#it-block-italiagov-local-tasks .nav-link.active.is-active {
  background-color: #f7f7f7 !important;
}
.it-header-center-wrapper {
  background: #184f90 !important;
}
.container-flag {
  background: #184f90;
}


.header-logos-wrapper {
  display: flex;
  padding: 0 6px;
}

@media (max-width: 992px) {
  .it-header-wrapper .it-nav-wrapper .it-header-navbar-wrapper {
    margin-top: -1px !important;
    position: unset !important;
  }
  .it-header-wrapper .it-nav-wrapper .it-brand-wrapper,
  .it-brand-wrapper .brand-link img {
    padding-left: 0 !important;
  }

  .it-header-center-content-wrapper .header-logo-column{
    justify-content: center;
  }
  .header-logo-column .image-brand,
  .header-logo-column img {
    padding: 4px !important;
  }

  .header-logos-wrapper {
    display: grid;
    width: 100%;
  }
  /* 0–3 figli → una riga */
  .header-logos-wrapper:has(:nth-child(-n+3)):not(:has(:nth-child(4))) {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 4 figli → 2 + 2 */
  .header-logos-wrapper:has(:nth-child(4)):not(:has(:nth-child(5))) {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 5 figli → 3 + 2 */
  .header-logos-wrapper:has(:nth-child(5)):not(:has(:nth-child(6))) {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 6 figli → 3 + 3 */
  .header-logos-wrapper:has(:nth-child(6)) {
    grid-template-columns: repeat(3, 1fr);
  }

  /* 4 elementi → nascondi after del 2° */
  .header-logos-wrapper:has(:nth-child(4)):not(:has(:nth-child(5)))
    > .header-logo-column:nth-child(2)::after {
    display: none;
  }
  .header-logos-wrapper:has(:nth-child(4)):not(:has(:nth-child(5)))
    > .header-logo-column:nth-child(2) {
    padding-right: 0;
  }

  /* 5 o 6 elementi → nascondi after del 3° */
  .header-logos-wrapper:has(:nth-child(5))
    > .header-logo-column:nth-child(3)::after {
    display: none;
  }
  .header-logos-wrapper:has(:nth-child(5))
    > .header-logo-column:nth-child(3) {
    padding-right: 0;
  }
}

.header-logo-column {
  padding-right: 1rem;
  padding-left: 0;
}

.header-logo-column:not(:last-child):after  {
  content: '';
  height: 60%;
  width: 1px;
  position: absolute;
  right: 0;
  top: 50%;
  translate: -0.5rem -50%;
  background-color: var(--white);
}
.header-logo-column:last-child,
.header-logo-column:last-child .image-brand  {
  padding-right: 0;
}

.header-logo-column .image-brand,
.header-logo-column img {
  padding: 10px;
}
/* Slim header */
.it-header-slim-wrapper {
  background-color: #004c99;
}
.dropdown-menu:before {
  display: none;
}
.it-header-slim-wrapper .it-header-slim-wrapper-content .navbar-brand {
  text-decoration: underline;
}
.it-header-slim-wrapper .it-header-slim-wrapper-content .navbar-brand:hover {
  text-decoration: none !important;
}
@media (min-width: 992px) {
  .it-header-slim-wrapper {
    height: 70px;
  }
  .it-header-slim-wrapper .it-header-slim-wrapper-content {
    height: 70px;
  }
  .social-header span.social-icon .icon-social-header {
    height: 20px !important;
    vertical-align: middle !important;
    width: 20px !important;
    margin-right: 0px !important;
  }

  .it-header-slim-wrapper .it-header-slim-wrapper-content .navbar-brand {
    font-size: 1rem !important;
  }
}
@media (max-width: 992px) {
  .social-header .title-social{
    font-size: .778em;
  }
  .social-header span.social-icon .icon-social-header {
    height: 18px !important;
    vertical-align: middle !important;
    width: 18px !important;
    margin-right: 0px !important;
  }

  .it-header-slim-wrapper .it-header-slim-wrapper-content .navbar-brand {
    padding: .5rem 0;
  }
}
/* Center header */
.title-header{
  font-size: 1.777rem;
  line-height: 1.8rem;
}
.title-header a{
  color: white;
}
.social-header .social-icon {
  margin-right: 12px;
}
@media (max-width: 992px) {
  .title-header{
    font-size: 0.9rem;
    line-height: 1.3rem;
    margin-bottom: 12px;
  }
}
@media (max-width: 576px) {
  .it-header-center-content-wrapper .header-logo-column{
    max-width: 128px;
  }
}

.it-header-center-content-wrapper .header-logo-column{
  flex: unset;
  max-width: unset;
  width: auto;
}

.margin-search{
  margin-right: 20px;
}
/* Logo */
.it-header-center-wrapper .it-header-center-content-wrapper .it-brand-wrapper a .icon {
  width: 100%;
  height: unset;
}
.it-brand-wrapper .brand-link img {
  margin: 0;
  padding-left: 30px;
}
.it-header-wrapper.it-header-sticky.is-sticky .it-header-navbar-wrapper .menu-wrapper .it-brand-wrapper.cloned-header a .icon {
  fill: #fff;
  flex-shrink: 0;
  height: 55px !important;
  margin-right: 16px;
  width: 520px !important;
}
.vr {
  border-right: 1px solid #fff;
  height: 32px;
  margin: 0px 10px;
}
.image-brand {
  object-fit: cover;
  max-height: 58px;
  max-width: 100%;
}
.navbar .navbar-collapsable .navbar-nav li.nav-item .nav-link {
  align-self: center !important;
}
.navbar .navbar-collapsable .navbar-nav li.nav-item .nav-link.empty-link {
  cursor: default;
  color: #fff;
}
.navbar .navbar-collapsable .navbar-nav li.nav-item .nav-link + .dropdown-toggle,
.navbar .navbar-collapsable .navbar-nav li.nav-item .dropdown-menu .link-list .list-item + .dropdown-toggle {
  cursor: pointer;
  background: transparent;
  border: unset;
  padding: 0;
}
.navbar .navbar-collapsable .navbar-nav li.nav-item .nav-link + .dropdown-toggle:focus-visible,
.navbar .navbar-collapsable .navbar-nav li.nav-item .dropdown-menu .link-list .list-item + .dropdown-toggle:focus-visible {
  outline: 2px solid #f90 !important;
}
.navbar .navbar-collapsable .navbar-nav li.nav-item .dropdown-menu .link-list .list-item + .dropdown-toggle {
  display: flex !important;
  justify-content: flex-end;
}
.navbar .navbar-collapsable .navbar-nav li.nav-item .dropdown-menu .link-list li {
  display: grid;
  grid-template-columns: minmax(0, max-content) auto;
}
.navbar .navbar-collapsable .navbar-nav li.nav-item .dropdown-menu .link-list li > .link-sublist {
  grid-column: 1 / -1;
}

.navbar .navbar-collapsable .navbar-nav li a.nav-link.active {
  border-color: unset;
}

.navbar .dropdown-menu .link-list-wrapper .link-sublist li,
.navbar .dropdown-menu .link-list-wrapper li {
  margin: 7px 0;
}
.navbar .dropdown-menu .link-list-wrapper .link-sublist a span,
.navbar .dropdown-menu .link-list-wrapper a span {
  line-height: 1.2em !important;
}

.nav-item-homepage a span {
  font-size: medium;
}
.fs-1 {
  font-size: 1rem !important;
}
.width-dropdown-menu {
  width: max-content !important;
}
.navbar .dropdown-menu .link-list-wrapper ul li a span {
  color: #039;
}
.it-header-slim-wrapper-content .fs-1 {
  padding-left: 24px !important;
}
.block-image-pn {
  object-fit: cover;
  height: fit-content;
  width: 100%;
}
.title-block-num-pn {
  color: #039;
}
.it-brand-wrapper.cloned-header .brand-link {
  display: none;
}
.fill-white {
  fill: #fff !important;
}
#search-block-form #edit-actions {
  float: right;
  margin-top: 15px;
}
.cursor-pointer {
  cursor: pointer;
}
#search-modal .modal-body {
  padding-bottom: 24px !important;
}
.user-icon--welcome-page .icon {
  height: 64px !important;
  width: 64px !important;
}
.dropdown-menu.show {
  min-width: 280px !important;
}
.dropdown-menu.show .link-list-wrapper ul li a {
  padding: 2px 0 2px 24px !important;
  line-height: 1.8 !important;
}
/* Added active link classes. */
@media (min-width: 992px) {
  li.nav-item.dropdown.active {
    background: transparent;
    border-left: 0;
    border-color: #fff;
    border-bottom: 3px solid #fff;
  }
}
#user-login-form .js-form-item.form-item.form-group.js-form-type-textfield.form-item-captcha-response.js-form-item-captcha-response label {
  font-size: .777rem;
  transform: translateY(-75%);
}
#user-login-form .js-form-item.form-item.form-group.js-form-type-textfield.form-item-captcha-response.js-form-item-captcha-response label {
  font-size: .777rem;
  transform: translateY(-75%);
}
#user-login-form .js-form-item.form-item.form-group.js-form-type-textfield.form-item-captcha-response.js-form-item-captcha-response label {
  font-size: .777rem;
  transform: translateY(-75%);
}
#user-pass .js-form-item.form-item.form-group.js-form-type-textfield.form-item-captcha-response.js-form-item-captcha-response label {
  font-size: .777rem;
  transform: translateY(-75%);
}
#user-pass .js-form-item.form-item.form-group.js-form-type-textfield.form-item-captcha-response.js-form-item-captcha-response label {
  font-size: .777rem;
  transform: translateY(-75%);
}
#user-pass > p {
  display: none;
}
#user-pass .js-form-item.form-item.form-group.js-form-type-textfield.form-item-captcha-response.js-form-item-captcha-response.third-form-box {
  margin-bottom: 3rem !important;
}
#user-pass .js-form-item.form-item.form-group.js-form-type-textfieldform-item-name.js-form-item-name.third-form-box {
  margin-bottom: 0px !important;
  padding: .25rem .5rem !important;
}
#page-user-login .nav.nav-tabs {
  margin-bottom: 3rem;
}
#page-user-login #it-block-brandingdelsito img {
  width: 100% !important;
  max-height: 64px;
}

.it-header-navbar-wrapper .container-flag .search-button-mobile {
  display: none;
}
.search-button-dsk {
  background: transparent !important;
  padding: 0 !important;
  border: unset;
}
.search-button-dsk:focus-visible {
  outline: 2px solid #f90 !important;
}
@media (max-width: 992px) {
  .it-header-center-wrapper {
    height: 121px;
  }
  /* Se ci sono almeno 4 loghi (header-logo-column), aumenta l'altezza */
  .it-header-center-wrapper:has(.header-logos-wrapper .header-logo-column:nth-child(4)) {
    height: 172px;
  }

  .it-header-navbar-wrapper .container-flag {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .it-header-navbar-wrapper .container-flag .search-button-mobile {
    display: block;
    height: 40px;
    width: 40px;
    border: none;
    border-radius: 100%;
    background: white;
    flex-shrink: 0;
    margin-right: 18px;
  }
  .it-header-navbar-wrapper .container-flag .search-button-mobile>svg {
    color: #0073df;
    width: 20px;
    height: 20px;
    margin-top: 4px;
  }

  .navbar .navbar-collapsable .navbar-nav li.nav-item .nav-link.empty-link {
    color: #06c;
    padding: 13px 24px;
  }

  .navbar .navbar-collapsable .navbar-nav li.nav-item .dropdown-menu .link-list .list-item {
    width: fit-content;
  }
}

/* ==============================
   NOTIFICHE FLOATING (HOTFIX)
   per Bootstrap Italia 2.12 + Drupal 10.5
   ============================== */

.it-notification__wrapper {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  width: 360px;
  z-index: 9999;
  pointer-events: none; /* lascia cliccare sotto */
}

.it-notification__wrapper .messages {
  pointer-events: all; /* riattiva click solo sul box */
  margin-bottom: 1rem;
  padding: 1rem 1.25rem 1rem 1rem;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(-10px);
  animation: toast-in 0.3s forwards;
  position: relative;
}

.alert-status,
.messages--status {
  background-color: #d1ecf1;
  border-left: 6px solid #0c5460;
  color: #0c5460;
}
.alert-warning,
.messages--warning {
  background-color: #fff3cd;
  border-left: 6px solid #856404;
  color: #856404;
}
.alert-danger,
.messages--error {
  background-color: #f8d7da;
  border-left: 6px solid #721c24;
  color: #721c24;
}

.alert .btn-close,
.messages .close-notification {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.6;
}

.messages .close-notification:hover {
  opacity: 1;
}

@keyframes toast-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* --- quiz icon admin menu --- */
.menu-item .toolbar-icon.toolbar-icon-quiz-admin::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23000000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='10' y='6' width='28' height='36' rx='3'/%3E%3Cpath d='M18 6h12v-2a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2z'/%3E%3Cline x1='16' y1='18' x2='26' y2='18'/%3E%3Cpolyline points='30 17 32 19 36 15'/%3E%3Cline x1='16' y1='26' x2='26' y2='26'/%3E%3Cpolyline points='30 25 32 27 36 23'/%3E%3C/g%3E%3C/svg%3E") !important;
}
/* --- end quiz icon admin menu --- */


.logo-site-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-site-wrapper .header-logo-site {
  width: 32px;
}
@media (max-width: 992px) {
  .logo-site-wrapper .header-logo-site {
    width: 26px;
  }
}

