/* =========================
   BASE CARD
========================= */

.iwp2-sito {
  border: 1px solid #d9dadb;
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 24px;
  font-family: var(--font-base, "Titillium Web", sans-serif);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

.iwp2-sito__img {
  overflow: hidden;
  background: #f0f0f0;
}

.iwp2-sito__img-link {
  display: block;
  height: 100%;
}

.iwp2-sito__img img,
.iwp2-sito__img-link img,
.iwp2-sito__img-link .iwp2-sito__img-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.iwp2-sito:hover .iwp2-sito__img img,
.iwp2-sito:hover .iwp2-sito__img-link img,
.iwp2-sito:hover .iwp2-sito__img-link .iwp2-sito__img-el {
  transform: scale(1.03);
}

.iwp2-sito__body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-width: 0;
}

.iwp2-sito__titolo {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  margin: 0 !important;
  line-height: 1.3 !important;
  font-family: var(--font-base, "Titillium Web", sans-serif) !important;
}

.iwp2-sito__titolo a {
  color: #0066cc;
  text-decoration: none;
}

.iwp2-sito__titolo a:hover {
  color: #004d99;
  text-decoration: underline;
}

.iwp2-sito__desc {
  font-size: var(--text-size-desktop, 17px);
  margin: 0;
  line-height: 1.6;
}

.iwp2-sito__meta {
  list-style: none;
  margin: 0;
  padding: .75rem 0 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  border-top: 1px solid #e8e8e8;
}

.iwp2-sito__meta-item {
  font-size: .9rem;
  font-weight: 400;
  color: #3d3d3d;
  display: flex;
  align-items: center;
  gap: 6px;
}

.iwp2-sito__meta-item a {
  color: #0066cc;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.iwp2-sito__meta-item a:hover {
  text-decoration: underline;
}

/* Icone meta */
.iwp2-sito__meta--citta::before,
.iwp2-sito__meta--indirizzo::before,
.iwp2-sito__meta--tel::before,
.iwp2-sito__meta--email::before,
.iwp2-sito__meta--orari::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-color: #0066cc;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.iwp2-sito__meta--citta::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z'/%3E%3C/svg%3E");
}

.iwp2-sito__meta--indirizzo::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M12.166 8.94c-.524 1.062-1.234 2.12-1.96 3.07A31.493 31.493 0 0 1 8 14.58a31.481 31.481 0 0 1-2.206-2.57c-.726-.95-1.436-2.008-1.96-3.07C3.304 7.867 3 6.862 3 6a5 5 0 0 1 10 0c0 .862-.305 1.867-.834 2.94zM8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10z'/%3E%3Cpath d='M8 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0 1a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M12.166 8.94c-.524 1.062-1.234 2.12-1.96 3.07A31.493 31.493 0 0 1 8 14.58a31.481 31.481 0 0 1-2.206-2.57c-.726-.95-1.436-2.008-1.96-3.07C3.304 7.867 3 6.862 3 6a5 5 0 0 1 10 0c0 .862-.305 1.867-.834 2.94zM8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10z'/%3E%3Cpath d='M8 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm0 1a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'/%3E%3C/svg%3E");
}

.iwp2-sito__meta--tel::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.654 1.328a.678.678 0 0 0-1.015-.063L1.605 2.3c-.483.484-.661 1.169-.45 1.77a17.568 17.568 0 0 0 4.168 6.608 17.569 17.569 0 0 0 6.608 4.168c.601.211 1.286.033 1.77-.45l1.034-1.034a.678.678 0 0 0-.063-1.015l-2.307-1.794a.678.678 0 0 0-.58-.122l-2.19.547a1.745 1.745 0 0 1-1.657-.459L5.482 8.062a1.745 1.745 0 0 1-.46-1.657l.548-2.19a.678.678 0 0 0-.122-.58L3.654 1.328z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.654 1.328a.678.678 0 0 0-1.015-.063L1.605 2.3c-.483.484-.661 1.169-.45 1.77a17.568 17.568 0 0 0 4.168 6.608 17.569 17.569 0 0 0 6.608 4.168c.601.211 1.286.033 1.77-.45l1.034-1.034a.678.678 0 0 0-.063-1.015l-2.307-1.794a.678.678 0 0 0-.58-.122l-2.19.547a1.745 1.745 0 0 1-1.657-.459L5.482 8.062a1.745 1.745 0 0 1-.46-1.657l.548-2.19a.678.678 0 0 0-.122-.58L3.654 1.328z'/%3E%3C/svg%3E");
}

.iwp2-sito__meta--email::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4Zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2Zm13 2.383-4.708 2.825L15 11.105V5.383Zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741ZM1 11.105l4.708-2.897L1 5.383v5.722Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M0 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V4Zm2-1a1 1 0 0 0-1 1v.217l7 4.2 7-4.2V4a1 1 0 0 0-1-1H2Zm13 2.383-4.708 2.825L15 11.105V5.383Zm-.034 6.876-5.64-3.471L8 9.583l-1.326-.795-5.64 3.47A1 1 0 0 0 2 13h12a1 1 0 0 0 .966-.741ZM1 11.105l4.708-2.897L1 5.383v5.722Z'/%3E%3C/svg%3E");
}

.iwp2-sito__meta--orari::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z'/%3E%3Cpath d='M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71V3.5z'/%3E%3Cpath d='M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm7-8A7 7 0 1 1 1 8a7 7 0 0 1 14 0z'/%3E%3C/svg%3E");
}

.iwp2-sito__cta {
  margin-top: .25rem;
}

.iwp2-sito__cta .btn {
  font-family: var(--font-base, "Titillium Web", sans-serif);
  font-weight: 700;
  font-size: .875rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .5rem 1.25rem;
  background-color: #0066cc;
  border-color: #0066cc;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  transition: background-color .2s ease, border-color .2s ease;
}

.iwp2-sito__cta .btn:hover {
  background-color: #004d99;
  border-color: #004d99;
  color: #fff;
  text-decoration: none;
}

/* =========================
   CARD VARIANTS
========================= */

.iwp2-sito--verticale .iwp2-sito__img {
  height: 220px;
}

.iwp2-sito--inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

.iwp2-sito--inline .iwp2-sito__img {
  grid-column: 1;
  min-height: 240px;
  overflow: hidden;
  background: #f0f0f0;
}

.iwp2-sito--inline .iwp2-sito__body-desc {
  grid-column: 2;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-width: 0;
  border-left: 1px solid #e8e8e8;
}

.iwp2-sito--inline .iwp2-sito__body-info {
  grid-column: 3;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  justify-content: space-between;
  min-width: 0;
  border-left: 1px solid #e8e8e8;
}

/* Titolo e desc nella colonna centrale */
.iwp2-sito--inline .iwp2-sito__titolo {
  margin: 0 !important;
}

/* Meta senza border-top nella colonna info */
.iwp2-sito__meta--no-border {
  border-top: 0 !important;
  padding-top: 0 !important;
}

/* =========================
   GRID
========================= */

.iwp2-siti-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
  align-items: start;
}

.iwp2-siti-grid > * {
  min-width: 0;
}

.iwp2-siti-grid--explicit .iwp2-sito {
  margin-bottom: 0 !important;
  width: 100%;
  max-width: none !important;
  height: 100%;
  display: flex;
}

.iwp2-siti-grid--explicit .iwp2-sito--verticale {
  flex-direction: column;
}

.iwp2-siti-grid--explicit.iwp2-siti-grid-1 {
  grid-template-columns: minmax(0, 1fr);
}

.iwp2-siti-grid--explicit.iwp2-siti-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.iwp2-siti-grid--explicit.iwp2-siti-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.iwp2-siti-grid--explicit > .iwp2-sito:only-child {
  max-width: 380px !important;
  width: 100%;
  justify-self: start;
}

.iwp2-siti-grid--explicit > .iwp2-sito--inline:only-child,
.iwp2-siti-grid .iwp2-sito--inline {
  max-width: none !important;
  justify-self: stretch;
}

.iwp2-siti-grid .iwp2-sito--verticale {
  width: 100%;
  min-width: 0;
}

.iwp2-siti-grid .iwp2-sito--verticale .iwp2-sito__body {
  flex: 1;
}

/* inline list forzata shortcode */
.iwp2-siti-grid--inline-list {
  grid-template-columns: minmax(0, 1fr) !important;
}

.iwp2-siti-grid--inline-list > .iwp2-sito {
  max-width: none !important;
  width: 100%;
  justify-self: stretch;
}

/* La card inline è già un grid a 3 colonne — nessuna regola flex aggiuntiva necessaria */

/* =========================
   SINGLE
========================= */

.iwp2-sito-single__hero {
  margin-bottom: 0;
}

.iwp2-sito-single__image {
  aspect-ratio: 16 / 5;
  overflow: hidden;
  border-radius: 8px;
}

.iwp2-sito-single__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.iwp2-sito-single__intro {
  padding-top: 20px;
}

.iwp2-sito-single__title {
  margin: 16px 0;
}

.iwp2-sito-single__desc {
  font-size: 1.1rem;
  margin: 0;
}

.iwp2-sito-single__content {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  margin-top: 24px;
  margin-bottom: 32px;
}

.iwp2-sito-single__main {
  flex: 1 1 auto;
  min-width: 0;
}

.iwp2-sito-single__aside {
  flex: 0 0 340px;
  max-width: 340px;
}

.iwp2-sito-single__info {
  border: 1px solid #d9dadb;
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

/* telefoni */
.iwp2-sito__phone-list {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  max-width: 100%;
}

.iwp2-sito__phone-item {
  display: inline-flex;
  white-space: nowrap;
}

.iwp2-sito__phone-separator {
  display: inline-block;
  margin: 0 4px;
  white-space: nowrap;
}

.iwp2-sito__phone-label {
    color: #6c757d;
}

.iwp2-sito-single__map-nav {
  margin-top: 12px;
  text-align: right;
}

.iwp2-sito-single__map-menu-link {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  color: #17324d;
  padding: 0;
  border: 0;
  background: none;
  white-space: nowrap;
}

.iwp2-sito-single__map-menu-link:hover {
  text-decoration: underline;
}

/* mappa */
.iwp2-sito-single__map-section {
  padding-top: 8px;
  padding-bottom: 40px;
}

.iwp2-sito-single__map-header {
  margin-bottom: 16px;
}

.iwp2-sito-single__map {
  width: 100%;
  margin-bottom: 0;
  border: 1px solid #d9dadb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  overflow: hidden;
  box-sizing: border-box;
}

.iwp2-sito-single__map iframe {
  display: block;
  width: 100%;
  min-height: 380px;
  border: 0;
}

/* =========================
   ARCHIVE
========================= */

.iwp2-siti-archive-wrap .container {
  padding-top: 24px;
  padding-bottom: 40px;
}

.iwp2-siti-archive__header {
  margin: 0 0 24px;
}

.iwp2-siti-archive__title {
  margin: 0;
}


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

@media (max-width: 1100px) {
  .iwp2-siti-grid--explicit.iwp2-siti-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .iwp2-sito--inline,
  .iwp2-siti-grid .iwp2-sito--inline,
  .iwp2-siti-grid--inline-list > .iwp2-sito--inline {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .iwp2-sito--inline .iwp2-sito__img {
    grid-column: 1 / -1;
    min-height: 220px;
    width: 100%;
  }

  .iwp2-sito--inline .iwp2-sito__body-desc {
    grid-column: 1;
    border-left: 0;
    border-top: 1px solid #e8e8e8;
  }

  .iwp2-sito--inline .iwp2-sito__body-info {
    grid-column: 2;
    border-top: 1px solid #e8e8e8;
  }
}

@media (max-width: 991px) {
  .iwp2-sito-single__content {
    display: block;
  }

  .iwp2-sito-single__aside {
    width: 100%;
    max-width: 720px;
    margin-top: 24px;
  }

  .iwp2-sito-single__map-nav {
    display: none;
  }

  /* quando la card va sotto, tieni i telefoni in linea se c'è spazio */
  .iwp2-sito-single__aside .iwp2-sito__phone-list {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
    max-width: 100%;
  }

  .iwp2-sito-single__aside .iwp2-sito__phone-item {
    display: inline-flex;
    white-space: nowrap;
  }

  .iwp2-sito-single__aside .iwp2-sito__phone-separator {
    display: inline-block;
    margin: 0 4px;
    white-space: nowrap;
  }
}

@media (max-width: 767px) {
  .iwp2-siti-grid--explicit.iwp2-siti-grid-2,
  .iwp2-siti-grid--explicit.iwp2-siti-grid-3 {
    grid-template-columns: 1fr;
  }

  .iwp2-siti-grid .iwp2-sito {
    max-width: none !important;
  }

  .iwp2-sito--inline,
  .iwp2-siti-grid .iwp2-sito--inline,
  .iwp2-siti-grid--inline-list > .iwp2-sito--inline {
    grid-template-columns: 1fr;
  }

  .iwp2-sito--inline .iwp2-sito__img {
    grid-column: 1;
    min-height: 200px;
  }

  .iwp2-sito--inline .iwp2-sito__body-desc {
    grid-column: 1;
    border-left: 0;
    border-top: 1px solid #e8e8e8;
  }

  .iwp2-sito--inline .iwp2-sito__body-info {
    grid-column: 1;
    border-left: 0;
    border-top: 1px solid #e8e8e8;
  }
}

@media (max-width: 575px) {
  .iwp2-sito-single__aside {
    max-width: none;
    width: 100%;
  }

  /* mobile: telefoni su righe separate */
  .iwp2-sito-single__aside .iwp2-sito__phone-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    white-space: normal;
  }

  .iwp2-sito-single__aside .iwp2-sito__phone-item {
    display: block;
    white-space: normal;
  }

  .iwp2-sito-single__aside .iwp2-sito__phone-separator {
    display: none;
  }
}
.iwp2-sito-single__info-title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  line-height: 1.2;
  font-weight: 700;
}

.iwp2-sito-single__map-title {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  font-weight: 600;
}

/* =====================================================
   SHORTCODE CONTEXT — reset interferenze tema
   Applicato solo quando la griglia è inserita via
   shortcode [iwp2_siti] dentro un post/page del tema.
===================================================== */

.iwp2-siti-grid--shortcode {
  max-width: 100% !important;
  width: 100% !important;
  overflow: visible !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* il body della card non deve troncare il testo */
.iwp2-siti-grid--shortcode .iwp2-sito__body {
  overflow: visible;
  min-width: 0;
  word-break: normal;
  overflow-wrap: break-word;
}

/* il testo descrizione non viene tagliato */
.iwp2-siti-grid--shortcode .iwp2-sito__desc {
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
}

/* titolo: forza il colore blu anche dentro entry-content del tema */
.iwp2-siti-grid--shortcode .iwp2-sito__titolo,
.iwp2-siti-grid--shortcode .iwp2-sito__titolo a {
  color: #0066cc !important;
}

.iwp2-siti-grid--shortcode .iwp2-sito__titolo a:hover {
  color: #004d99 !important;
}

/* immagini: stessa altezza fissa dell'archivio */
.iwp2-siti-grid--shortcode .iwp2-sito__img {
  height: 240px;
}

.iwp2-siti-grid--shortcode .iwp2-sito__img-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* categoria sedi stile diverso */
.iwp2-sito--cat-sedi {
    background-color: #f5f5f5;
}

.iwp2-sito--cat-sedi .iwp2-sito__titolo a,
.iwp2-sito--cat-sedi .iwp2-sito__titolo a:hover {
    color: #3d3d3d;
}

.iwp2-sito--cat-sedi .btn {
    background-color: #3d3d3d;
    border-color: #3d3d3d;
    color: #fff;
}

.iwp2-sito--cat-sedi .btn:hover {
    background-color: #222;
    border-color: #222;
}

.iwp2-sito--cat-sedi .iwp2-sito__meta-item a {
    color: #3d3d3d;
}

.iwp2-sito--cat-sedi .iwp2-sito__meta-item a:hover {
    color: #222;
}

.iwp2-sito--cat-sedi .iwp2-sito__meta-item::before {
    filter: grayscale(100%) brightness(0.3);
}