/* Location archive layout aligned with the Events page and homepage cards. */
body.post-type-archive-localita {
  --location-red: #a5080b;
  --location-ink: #211d1d;
  --location-cream: #f8f5f2;
  color: var(--location-ink);
}

body.post-type-archive-localita #wrapper-navbar,
body.post-type-archive-localita #mainNav,
body.post-type-archive-localita .menu-sotto {
  background: linear-gradient(110deg, #870306, #ae0b0e 55%, #870306) !important;
}

body.post-type-archive-localita #page-wrapper { padding: 0; }
body.post-type-archive-localita .immagine-cover {
  position: relative;
  display: flex;
  align-items: center;
  height: auto !important;
  min-height: 300px;
  padding: 38px 0;
  background-position: center 52%;
  background-size: cover;
}
body.post-type-archive-localita .immagine-cover::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(0 0 0 / 73%), rgb(0 0 0 / 16%));
  content: '';
}
body.post-type-archive-localita .immagine-cover > .container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1440px;
}
body.post-type-archive-localita .immagine-cover .titolo,
body.post-type-archive-localita .immagine-cover .titolo > .container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
body.post-type-archive-localita .immagine-cover .titolo .row {
  display: flex;
  flex-direction: column;
  margin: 0;
}
body.post-type-archive-localita .immagine-cover .titolo .row > .col-12 {
  padding: 0;
  text-align: left !important;
}
body.post-type-archive-localita .immagine-cover .titolo-breadcrumb { order: 2; }
body.post-type-archive-localita .immagine-cover .titolo .row > .col-12:last-child {
  order: 1;
  margin-bottom: 24px;
}
body.post-type-archive-localita .immagine-cover .background-overlay { display: none; }
body.post-type-archive-localita .immagine-cover .breadcrumbs,
body.post-type-archive-localita .immagine-cover .breadcrumbs a,
body.post-type-archive-localita .immagine-cover .breadcrumbs span,
body.post-type-archive-localita .immagine-cover .breadcrumbs i {
  color: #fff !important;
  font-size: .86rem;
}
body.post-type-archive-localita .immagine-cover h1 {
  margin: 0;
  color: #fff;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.8rem, 4vw, 4.2rem);
  font-weight: 700;
  line-height: 1.07;
}
body.post-type-archive-localita .location-hero__subtitle {
  max-width: 600px;
  margin: 12px 0 0;
  color: #fff;
  font-size: 1.06rem;
  line-height: 1.45;
}

body.post-type-archive-localita #page-wrapper > .container {
  width: 100%;
  max-width: 1440px;
}
body.post-type-archive-localita .testo-iniziale-archivio,
body.post-type-archive-localita .testo-finale-archivio {
  padding: 22px 0 !important;
  line-height: 1.55;
}
body.post-type-archive-localita .testo-iniziale-archivio h2,
body.post-type-archive-localita .testo-finale-archivio h2 {
  color: var(--location-ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.8rem, 2.5vw, 2.6rem);
  font-weight: 700;
}

/* Square image cards with the same title overlay used by the homepage carousel. */
body.post-type-archive-localita .swiper-attrazioni {
  overflow: hidden !important;
  padding-bottom: 0 !important;
}
body.post-type-archive-localita .swiper-attrazioni .swiper-slide,
body.post-type-archive-localita .swiper-attrazioni .cont-loop,
body.post-type-archive-localita .swiper-attrazioni .immagine-loop,
body.post-type-archive-localita .swiper-attrazioni .img-zoom {
  overflow: hidden;
  border-radius: 10px !important;
}
body.post-type-archive-localita .swiper-attrazioni .img-zoom {
  display: block;
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
}
body.post-type-archive-localita .swiper-attrazioni .img-zoom > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
body.post-type-archive-localita .swiper-attrazioni .img-zoom:hover > img { transform: scale(1.035); }
body.post-type-archive-localita .swiper-attrazioni .img-zoom::after {
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(transparent, rgb(0 0 0 / 78%));
  content: '';
  pointer-events: none;
}
body.post-type-archive-localita .swiper-attrazioni .meta-article { z-index: 1; }
body.post-type-archive-localita .swiper-attrazioni .categoria-tag { background: var(--location-red) !important; }
body.post-type-archive-localita .swiper-attrazioni .titolo-post {
  color: #fff;
  font-family: Georgia, 'Times New Roman', serif !important;
  font-size: clamp(1.15rem, 1.6vw, 1.6rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -.025em;
}
body.post-type-archive-localita .swiper-attrazioni .datetime { color: #fff; }
body.post-type-archive-localita .swiper-attrazioni .swiper-pagination-progressbar { position: relative; }

/* Keep sponsor marks centered and contained, as on the Events archive. */
body.post-type-archive-localita .pre-footer > .container { max-width: 1440px; }
body.post-type-archive-localita .pre-footer .logo-sponsor.wp-block-columns {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  gap: 24px;
  width: 100%;
  margin: 20px 0 28px;
}
body.post-type-archive-localita .pre-footer .logo-sponsor > .wp-block-column {
  display: flex;
  justify-content: center;
  min-width: 0;
  width: 100%;
  margin: 0;
}
body.post-type-archive-localita .pre-footer .logo-sponsor figure {
  width: 100%;
  margin: 0;
  text-align: center;
}
body.post-type-archive-localita .pre-footer .logo-sponsor img {
  display: block;
  width: 100%;
  height: 95px;
  margin: auto;
  object-fit: contain;
}
body.post-type-archive-localita .pre-footer .carosello-loghi a {
  display: flex;
  min-height: 100px;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
body.post-type-archive-localita .pre-footer .carosello-loghi img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 82px;
  object-fit: contain;
}

/* Match the location popup typography and keep its controls easy to use. */
#modale-punto .modal-content { position: relative; overflow: visible !important; }
#modale-punto .location-modal-close-wrap {
  position: absolute;
  top: -18px;
  right: -18px;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  margin: 0;
}
#modale-punto .img-zoom-popup {
  padding-left: 36px !important;
}
#modale-punto h3 {
  font-family: 'Sisteron', Georgia, serif !important;
}
#modale-punto .location-popup-description {
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.6rem;
}
#modale-punto .location-modal-close {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #671205;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
#modale-punto .location-popup-actions {
  display: flex;
  justify-content: center;
  width: 100%;
}
#modale-punto .location-popup-actions .btn {
  width: min(100%, 320px);
  justify-content: center;
  text-align: center;
}

@media (max-width: 991px) {
  body.post-type-archive-localita .pre-footer .logo-sponsor.wp-block-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  body.post-type-archive-localita .immagine-cover { min-height: 285px; }
  body.post-type-archive-localita .immagine-cover > .container { padding-inline: 24px; }
  body.post-type-archive-localita .pre-footer .logo-sponsor.wp-block-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.post-type-archive-localita .location-hero__subtitle { font-size: .98rem; }
}

@media (max-width: 767px) {
  #modale-punto .location-modal-close-wrap { top: -12px; right: -6px; }
}

/* Keep the hero and archive content on the same responsive grid as the home page. */
@media (max-width: 599px) {
  body.post-type-archive-localita { --location-layout-gutter: 15px; }
}
@media (min-width: 600px) and (max-width: 1023px) {
  body.post-type-archive-localita { --location-layout-gutter: clamp(28px, 4.7vw, 48px); }
}
@media (min-width: 1024px) and (max-width: 1535px) {
  body.post-type-archive-localita { --location-layout-gutter: clamp(48px, 4.5vw, 64px); }
}
@media (max-width: 1535px) {
  body.post-type-archive-localita .immagine-cover > .container,
  body.post-type-archive-localita #page-wrapper > .container {
    width: calc(100% - var(--location-layout-gutter) - var(--location-layout-gutter));
  }
}
@media (max-width: 767px) {
  body.post-type-archive-localita .immagine-cover > .container { padding-inline: 12px; }
}
