/*
Theme Name: Municipio Zero
Theme URI: https://municipiozero.it
Author: Municipio Zero
Author URI: https://municipiozero.it
Description: Interferenza Politica — Tema WordPress per i Municipi Sociali di Bologna. Dove l'autogoverno dal basso incontra l'orizzonte cosmico del possibile.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: municipiozero
*/

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  --mz-bg: #f0eff5;
  --mz-black: #0a0e1f;
  --mz-red: #7b5ea7;
  --mz-blue: #2a3d7c;
  --mz-bg-warm: #e6e5f0;
  /* Side margin of every full-width section. theme.json's root padding
     (styles.spacing.padding) reads it: 0 on desktop, set in PHONES below. */
  --mz-gutter: 0px;
}

/* ============================================
   RESET / GLOBAL
   ============================================ */
.wp-site-blocks > footer {
  margin-block-start: 0;
}

/* ============================================
   HEADER
   ============================================ */
.site-header-wrap {
  position: relative;
  z-index: 1000;
  border-bottom: 2px solid var(--mz-black);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.site-header-inner .wp-block-site-logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.site-header-inner .wp-block-navigation {
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header-inner .wp-block-navigation a {
  padding: 0.5rem 0.85rem;
  transition: background 0.1s ease, color 0.1s ease;
}

.site-header-inner .wp-block-navigation a:hover,
.site-header-inner .wp-block-navigation a:focus {
  background: var(--mz-black);
  color: var(--mz-bg) !important;
}

.site-header-inner .wp-block-navigation .wp-block-navigation-submenu__toggle {
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header-inner .wp-block-navigation .wp-block-navigation__submenu-container {
  background: var(--mz-black);
  border: 2px solid var(--mz-red);
  min-width: 220px;
}

.site-header-inner .wp-block-navigation .wp-block-navigation__submenu-container a {
  color: var(--mz-bg) !important;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(245, 245, 240, 0.1);
}

.site-header-inner .wp-block-navigation .wp-block-navigation__submenu-container a:hover {
  background: var(--mz-red) !important;
  color: #fff !important;
}

.header-search-icon .wp-block-search__button {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--mz-black);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s ease, border-color 0.1s ease, color 0.1s ease;
}

.header-search-icon .wp-block-search__button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.header-search-icon .wp-block-search__button:hover {
  background: var(--mz-red);
  border-color: var(--mz-red);
  color: #fff;
}

.header-search-icon .wp-block-search__input {
  border: 2px solid var(--mz-black);
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 0.8rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
/* The hero is a core Cover block: the image, its darkening (overlay
   colour + opacity) and focal point are all set in the Site Editor. */
.hero-section {
  position: relative;
  overflow: hidden;
}

/* Let the coordinates and vertical label anchor to the whole hero,
   not to the cover's inner container. */
.hero-section > .wp-block-cover__inner-container {
  position: static;
}

.hero-content-wrap {
  position: relative;
  z-index: 5;
  width: 100%;
}

.hero-title-row {
  display: flex !important;
  align-items: flex-end;
  gap: clamp(0.3rem, 4vw, 5rem);
}

.hero-title-municipio {
  font-family: var(--wp--preset--font-family--bebas-neue) !important;
  font-size: clamp(7rem, 18vw, 18rem) !important;
  line-height: 1 !important;
  letter-spacing: 0.04em !important;
  margin: 0 !important;
  transform: none;
  opacity: 0;
  animation: title-slide-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

.hero-title-logo {
  margin: 0 0 clamp(0.8rem, 2.1vw, 2.1rem) 0 !important;
  opacity: 0;
  animation: logo-slide-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
  flex-shrink: 0;
}

.hero-title-logo img {
  height: clamp(4.9rem, 20vw, 20rem) !important;
  width: auto !important;
  display: block !important;
  filter: brightness(1.1) contrast(1.05);
}

@keyframes title-slide-in {
  from { opacity: 0; transform: translateX(-5vw) translateY(30px); }
  to { opacity: 1; transform: translateX(0) translateY(0); }
}

@keyframes logo-slide-in {
  from { opacity: 0; transform: scale(0.7) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.hero-tagline-text {
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: clamp(0.75rem, 1.2vw, 1rem) !important;
  font-weight: 800 !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase;
  color: var(--mz-red) !important;
  opacity: 0;
  animation: fade-up 0.5s ease 1.5s forwards;
}

.hero-description-text {
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: clamp(1rem, 1.5vw, 1.25rem) !important;
  line-height: 1.6 !important;
  max-width: 480px;
  opacity: 0;
  animation: fade-up 0.5s ease 1.7s forwards;
}

.hero-cta-row {
  opacity: 0;
  animation: fade-up 0.5s ease 1.9s forwards;
}

.hero-cta-row .wp-block-button__link {
  padding: 0.85rem 1.8rem;
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 2.5px solid var(--mz-bg);
  transition: all 0.12s ease;
}

.hero-cta-row .wp-block-button__link:hover {
  background: var(--mz-red) !important;
  border-color: var(--mz-red);
  color: #fff !important;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 rgba(123, 94, 167, 0.4);
}

.hero-cta-outline .wp-block-button__link {
  background: transparent !important;
  color: var(--mz-bg) !important;
  border: 2.5px solid var(--mz-bg);
}

.hero-cta-outline .wp-block-button__link:hover {
  background: var(--mz-bg) !important;
  color: var(--mz-black) !important;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--mz-red);
}


.hero-coordinates {
  position: absolute;
  bottom: 2rem;
  left: 1.5rem;
  z-index: 5;
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.65rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.15em !important;
  text-transform: uppercase;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  opacity: 0;
  animation: fade-up 0.5s ease 2.2s forwards;
}

.hero-vertical-label {
  position: absolute;
  top: 50%;
  right: 1.5rem;
  z-index: 5;
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.6rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.25em !important;
  text-transform: uppercase;
  color: var(--mz-red) !important;
  writing-mode: vertical-lr;
  transform: rotate(180deg) translateY(50%);
  opacity: 0;
  animation: fade-up 0.5s ease 2.4s forwards;
}

/* ============================================
   GENERAL ANIMATIONS
   ============================================ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.6s ease forwards;
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-40px);
  animation: slideInLeft 0.7s ease forwards;
}

@keyframes slideInLeft {
  to { opacity: 1; transform: translateX(0); }
}

.slide-in-right {
  opacity: 0;
  transform: translateX(40px);
  animation: slideInRight 0.7s ease forwards;
}

@keyframes slideInRight {
  to { opacity: 1; transform: translateX(0); }
}

/* Scroll-triggered animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* A full-width section with its own background keeps the background in place
   and animates only its content. Fading the whole section showed the page
   background through it while scrolling: a blank band between two dark
   sections. */
.animate-on-scroll.alignfull.has-background {
  opacity: 1;
  transform: none;
}

.animate-on-scroll.alignfull.has-background > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-on-scroll.alignfull.has-background.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.is-visible > *:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-children.is-visible > *:nth-child(5) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

/* Reveal EVERY staggered child, not just the first five. `.stagger-children > *`
   sets opacity:0, so without this catch-all any 6th-or-later child stays
   invisible forever. The rules above only ever covered 1-5, which went
   unnoticed while no stagger container held more than five items. */
.stagger-children.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.is-visible > *:nth-child(6) { transition-delay: 0.6s; }
.stagger-children.is-visible > *:nth-child(7) { transition-delay: 0.7s; }
.stagger-children.is-visible > *:nth-child(8) { transition-delay: 0.8s; }
.stagger-children.is-visible > *:nth-child(n+9) { transition-delay: 0.9s; }

/* Hover effects */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift.mz-card-linked:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

/* ============================================
   SECTION STYLES
   ============================================ */

/* Section label (category tag style) */
.section-label {
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase;
  color: var(--mz-red) !important;
}

.section-title-display {
  font-family: var(--wp--preset--font-family--bebas-neue) !important;
  font-size: clamp(2.5rem, 5vw, 4rem) !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
}

/* Diagonal red accent on section */
.section-with-slash {
  position: relative;
  overflow: hidden;
}

.section-with-slash::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: clamp(40px, 6vw, 80px);
  height: 130%;
  background: var(--mz-red);
  transform: rotate(-15deg);
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   CARD LAYOUTS
   ============================================ */
.equal-cards > .wp-block-column {
  display: flex;
  flex-direction: column;
  flex-grow: 0;
}

.equal-cards > .wp-block-column > .wp-block-group {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.equal-cards .cta-bottom {
  margin-top: auto;
  justify-content: center;
}

/* Article card style */
.article-card {
  border: 2px solid var(--mz-black);
  padding: 0;
  transition: all 0.15s ease;
  background: var(--mz-bg);
  color: var(--mz-black); /* stays readable when the card sits in a dark section */
  overflow: hidden;
}

.article-card > *:not(.wp-block-image) {
  padding-left: 2rem;
  padding-right: 2rem;
}

.article-card > *:last-child {
  padding-bottom: 2rem;
}

.article-card .wp-block-image {
  margin-bottom: 0;
}

.article-card .wp-block-image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.article-card.mz-card-linked:hover {
  transform: translate(-4px, -4px);
  box-shadow: 6px 6px 0 var(--mz-red);
}

/* Progetto pages (single-progetto.html): the "Orari", "sub-progetti" and "Articoli"
   sections disappear when they have nothing to show. */
.pp-sezione:not(:has(.pg-tile, .wp-block-post, .orari)) {
  display: none;
}

/* Home "In evidenza": a query of the featured articles/pages (see In Evidenza.md),
   drawn as article-cards. Equal heights; tags + button pinned to the bottom. */
.mz-evidenza-section:not(:has(.wp-block-post)) {
  display: none;
}

.mz-evidenza .wp-block-post {
  display: flex;
  flex-direction: column;
}

.mz-evidenza .article-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mz-evidenza .article-card > .wp-block-post-featured-image {
  margin: 0;
  padding: 0;
  line-height: 0;
}

.mz-evidenza .article-card > .wp-block-post-featured-image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.mz-evidenza .mz-evidenza-label a {
  color: inherit;
  text-decoration: none;
}

.mz-evidenza .article-card > .mz-post-tags {
  margin-top: 0.75rem !important;
}

.mz-evidenza .article-card > .wp-block-read-more {
  align-self: center;
  margin: auto 2rem 2rem; /* auto: the button sits at the bottom of the card */
  padding: 0.75rem 1.5rem;
  font-size: 0.7rem;
  text-decoration: none;
}

.mz-evidenza .article-card > .wp-block-post-excerpt {
  margin-bottom: 1.25rem; /* keeps a gap above the button when the card is tall */
}

/* A regular card placed in a dark section takes the dark palette
   (homepage: I Municipi Sociali). */
.has-foreground-background-color .article-card {
  background: rgba(240, 239, 245, 0.05);
  border-color: rgba(240, 239, 245, 0.55);
  color: var(--mz-bg);
}

.has-foreground-background-color .article-card.mz-card-linked:hover {
  border-color: var(--mz-red);
}

.has-foreground-background-color .article-card p {
  opacity: 0.8;
}

.article-card-dark {
  border: 2px solid rgba(245, 245, 240, 0.2);
  padding: 2rem;
  transition: all 0.15s ease;
  background: transparent;
}

.article-card-dark.mz-card-linked:hover {
  transform: translate(-4px, -4px);
  box-shadow: 6px 6px 0 var(--mz-red);
  border-color: var(--mz-red);
}

/* Any card holding a link is clickable as a whole (script in functions.php,
   municipiozero_card_links, adds this class). Card hover effects are written
   as `.card.mz-card-linked:hover`, so a card with no link doesn't react. */
.mz-card-linked {
  cursor: pointer;
}

/* Category label in card */
.card-category-label {
  display: inline-block;
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.15em !important;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border: 1.5px solid var(--mz-red);
  color: var(--mz-red) !important;
}

.card-category-label-light {
  border-color: var(--mz-bg);
  color: var(--mz-bg) !important;
}

/* ============================================
   FEATURED ARTICLE (VISIONE POLITICA)
   ============================================ */
.featured-article-section {
  position: relative;
  overflow: hidden;
}

.featured-article-section::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -5%;
  width: clamp(60px, 10vw, 120px);
  height: 150%;
  background: var(--mz-blue);
  transform: rotate(-20deg);
  opacity: 0.04;
  z-index: 0;
  pointer-events: none;
}

/* ============================================
   QUERY BLOCK / POST CARDS
   ============================================ */
.wp-block-query .wp-block-post {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.query-card-grid .wp-block-post,
.query-card-dark .wp-block-post {
  display: flex;
  flex-direction: column;
}

.query-card-grid .wp-block-post {
  border: 2px solid var(--mz-black);
  padding: 0;
  background: var(--mz-bg);
  transition: all 0.15s ease;
  overflow: hidden;
}

.query-card-grid .wp-block-post.mz-card-linked:hover {
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 var(--mz-red);
}

.query-card-dark .wp-block-post {
  border: 2px solid rgba(245, 245, 240, 0.15);
  padding: 0;
  background: transparent;
  transition: all 0.15s ease;
  overflow: hidden;
}

.query-card-dark .wp-block-post.mz-card-linked:hover {
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 var(--mz-blue);
  border-color: var(--mz-blue);
}

.query-card-grid .wp-block-post .wp-block-post-featured-image,
.query-card-dark .wp-block-post .wp-block-post-featured-image {
  margin: 0;
  line-height: 0;
}

.query-card-grid .wp-block-post .wp-block-post-featured-image img,
.query-card-dark .wp-block-post .wp-block-post-featured-image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.query-card-grid .wp-block-post > .wp-block-group,
.query-card-dark .wp-block-post > .wp-block-group {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.query-card-grid .wp-block-post .wp-block-post-date,
.query-card-dark .wp-block-post .wp-block-post-date,
.query-card-grid .wp-block-post .mz-card-meta,
.query-card-dark .wp-block-post .mz-card-meta {
  margin-top: auto;
}

/* Article cards: date · Autori on one row at the bottom (see "Article cards -- RULE").
   The names come from the "autori" plugin (post-terms block, term "autore"). */
.mz-card-meta {
  gap: 0;
  align-items: baseline;
}

.mz-card-meta .wp-block-post-date {
  margin-top: 0 !important;
}

.mz-card-meta .mz-autori::before {
  content: "·";
  margin: 0 0.5em;
}

.mz-card-meta .mz-autori a {
  color: inherit;
  text-decoration: none;
  transition: color 0.1s ease;
}

.mz-card-meta .mz-autori a:hover {
  color: var(--mz-black);
  text-decoration: underline;
}

/* Home page (In evidenza, Esplorazioni): same look as the Municipi Sociali
   cards — picture touches the card border and is shown whole, only the text
   is padded. !important beats the group's inline padding from the template. */
.home .query-card-grid .wp-block-post > .wp-block-group,
.home .query-card-dark .wp-block-post > .wp-block-group {
  padding: 0 0 1.5rem !important;
}

.home .query-card-grid .wp-block-post > .wp-block-group > *:not(.wp-block-post-featured-image),
.home .query-card-dark .wp-block-post > .wp-block-group > *:not(.wp-block-post-featured-image) {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.home .query-card-grid .wp-block-post-featured-image + *,
.home .query-card-dark .wp-block-post-featured-image + * {
  margin-top: 1.25rem;
}

.home .query-card-grid .wp-block-post .wp-block-post-featured-image img,
.home .query-card-dark .wp-block-post .wp-block-post-featured-image img {
  aspect-ratio: auto 16 / 10; /* the picture's own shape once loaded; 16:10 only as placeholder */
  height: auto;
  object-fit: fill;
}

.wp-block-post-title a {
  text-decoration: none;
  color: inherit;
  transition: color 0.1s ease;
}

.wp-block-post-title a:hover {
  color: var(--mz-red);
}

/* ============================================
   SECTION ARCHIVE LINK
   ============================================ */
.section-archive-link .wp-block-button__link {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: inherit !important;
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 0.7rem !important;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s ease, letter-spacing 0.2s ease;
}

.section-archive-link .wp-block-button__link:hover {
  color: var(--mz-red) !important;
  letter-spacing: 0.16em;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
  background: transparent !important;
  transform: none;
  box-shadow: none;
}

/* ============================================
   PROJECTS SECTION
   ============================================ */
.project-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.project-logo-row .wp-block-image img {
  height: 80px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: grayscale(100%) contrast(1.1);
  transition: filter 0.3s ease, transform 0.2s ease;
}

.project-logo-row .wp-block-image img:hover {
  filter: grayscale(0%) contrast(1);
  transform: scale(1.08);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer-wrap {
  border-top: 3px solid var(--mz-red);
}

.footer-nav a {
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.1s ease;
}

.footer-nav a:hover {
  color: var(--mz-red) !important;
}

.footer-bottom-bar {
  border-top: 1px solid rgba(245, 245, 240, 0.15);
}

/* ============================================
   PAGE TITLE BANNER
   ============================================ */
.page-title-banner {
  position: relative;
  overflow: hidden;
  min-height: 30vh;
  display: flex;
  align-items: center;
  /* Same image as the homepage hero (Media #9028), under a dark tint so the
     white titles stay readable. The block's foreground colour stays as the
     fallback underneath. */
  background-image:
    linear-gradient(rgba(10, 14, 31, 0.55), rgba(10, 14, 31, 0.55)),
    url('../../uploads/2026/10/universo.png');
  background-size: cover;
  background-position: center;
}

.page-title-banner .wp-block-post-title {
  position: relative;
  z-index: 1;
}

.page-title-banner h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(3rem, 6vw, 4.5rem);
  line-height: 1.05;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .hero-title-municipio {
    font-size: clamp(4rem, 14vw, 10rem) !important;
  }
  .hero-title-logo img {
    height: clamp(2.8rem, 9.8vw, 7rem) !important;
  }
  .hero-title-logo {
    margin-bottom: clamp(0.5rem, 1.6vw, 1.2rem) !important;
  }
  .hero-vertical-label {
    display: none;
  }
  .project-logo-row .wp-block-image img {
    height: 60px;
    max-width: 100px;
  }
  .location-cover {
    min-height: 35vh;
  }
}

@media (max-width: 680px) {
  .site-header-inner {
    min-height: 56px;
  }
  .site-header-inner .wp-block-site-logo img {
    height: 28px;
  }
  /* hero on phones: see PHONES at the end of the file */
  .location-cover {
    min-height: 30vh;
    border-width: 2px;
  }
  .location-name-display {
    font-size: clamp(2.5rem, 10vw, 4rem) !important;
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .animate-on-scroll,
  .animate-on-scroll.alignfull.has-background > *,
  .fade-up,
  .fade-in,
  .slide-in-left,
  .slide-in-right,
  .stagger-children > *,
  .hero-title-municipio,
  .hero-title-logo,
  .hero-tagline-text,
  .hero-description-text,
  .hero-cta-row,
  .hero-coordinates,
  .hero-vertical-label {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================
   PAGINATION
   ============================================ */
.wp-block-query-pagination {
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  gap: 0.5rem;
}

.wp-block-query-pagination a,
.wp-block-query-pagination span {
  padding: 0.6rem 1rem;
  border: 2px solid var(--mz-black);
  text-decoration: none;
  color: var(--mz-black);
  transition: all 0.12s ease;
}

.wp-block-query-pagination a:hover {
  background: var(--mz-black);
  color: var(--mz-bg);
}

.wp-block-query-pagination .current {
  background: var(--mz-black);
  color: var(--mz-bg);
}

/* ============================================
   SINGLE POST
   ============================================ */
.single .wp-block-post-content {
  font-size: 1.2rem;
  line-height: 1.75;
}

.single .wp-block-post-content > * + * {
  margin-top: 1.5rem;
}

/* articles only (not events or pages): justified body text */
.single-post .wp-block-post-content > p {
  text-align: justify;
}

/* ============================================
   EDITOR OVERRIDES
   ============================================ */
/* ============================================
   LOCATIONS PAGE
   ============================================ */

html {
  scroll-behavior: smooth;
}

.locations-intro {
  text-align: center;
}

.location-showcase {
  position: relative;
  overflow: hidden;
}

.location-showcase::before {
  content: '';
  position: absolute;
  top: -15%;
  right: -3%;
  width: clamp(50px, 8vw, 100px);
  height: 140%;
  background: var(--mz-red);
  transform: rotate(-18deg);
  opacity: 0.16;
  z-index: 0;
  pointer-events: none;
}

.location-showcase-alt::before {
  right: auto;
  left: -3%;
  transform: rotate(18deg);
  background: var(--mz-blue);
}

.location-cover {
  min-height: 50vh;
  border: 3px solid var(--mz-black);
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.location-cover.mz-card-linked:hover {
  transform: scale(1.01);
}

.location-cover img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.location-cover.mz-card-linked:hover img {
  transform: scale(1.05) !important;
}

.location-cover-dark {
  border-color: rgba(240, 239, 245, 0.2);
}

.location-cover-dark.mz-card-linked:hover {
  border-color: var(--mz-red);
}

.location-name-display {
  font-family: var(--wp--preset--font-family--bebas-neue) !important;
  font-size: clamp(3.5rem, 8vw, 7rem) !important;
  line-height: 1 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* The name links the photo to the location's page (the whole cover is
   clickable through municipiozero_card_links); it keeps the title look. */
.location-name-display a {
  color: inherit;
  text-decoration: none;
}

.wp-block-columns:has(.location-detail-card) > .wp-block-column {
  display: flex;
  flex-direction: column;
}

.location-detail-card {
  border: 2px solid var(--mz-black);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  background: var(--mz-bg);
  flex: 1;
}

.location-detail-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--mz-red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.location-detail-card.mz-card-linked:hover {
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 var(--mz-red);
}

.location-detail-card.mz-card-linked:hover::after {
  transform: scaleX(1);
}

.location-detail-card-dark {
  border-color: rgba(240, 239, 245, 0.15);
  background: transparent;
}

.location-detail-card-dark.mz-card-linked:hover {
  border-color: var(--mz-red);
  box-shadow: 5px 5px 0 var(--mz-blue);
}

.location-detail-card-dark::after {
  background: var(--mz-blue);
}

.location-detail-label {
  display: inline-block;
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.15em !important;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border: 1.5px solid var(--mz-red);
  color: var(--mz-red) !important;
  margin-bottom: 0.75rem;
}

.location-detail-label-light {
  border-color: var(--mz-bg);
  color: var(--mz-bg) !important;
}

.location-subtitle {
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: clamp(1rem, 1.5vw, 1.15rem) !important;
  line-height: 1.6 !important;
  font-style: italic;
}

/* ============================================
   LOCATION PAGE — PROJECT CARDS
   ============================================ */
.project-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}

.project-card {
  border: 2px solid var(--mz-black);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.15s ease;
  background: var(--mz-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.project-card.mz-card-linked:hover {
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 var(--mz-red);
}

.project-card .wp-block-image {
  margin: 0;
}

.project-card .wp-block-image img {
  height: 60px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  filter: grayscale(100%) contrast(1.1);
  transition: filter 0.3s ease;
}

.project-card.mz-card-linked:hover .wp-block-image img {
  filter: grayscale(0%) contrast(1);
}

.project-card-dark {
  border-color: rgba(240, 239, 245, 0.15);
  background: transparent;
}

.project-card-dark.mz-card-linked:hover {
  border-color: var(--mz-red);
  box-shadow: 5px 5px 0 var(--mz-blue);
}

/* ============================================
   LOCATION PAGE — MAP EMBED
   ============================================ */
.location-map-embed iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid var(--mz-black);
  display: block;
}

/* ============================================
   LOCATION PAGE — SOCIAL LINKS
   ============================================ */
.location-social-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.location-social-links .wp-block-button__link {
  background: transparent !important;
  color: var(--mz-black) !important;
  border: 2px solid var(--mz-black) !important;
  padding: 0.6rem 1.2rem !important;
  font-size: 0.7rem !important;
  transition: all 0.12s ease;
}

.location-social-links .wp-block-button__link:hover {
  background: var(--mz-black) !important;
  color: var(--mz-bg) !important;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--mz-red);
}

.location-social-links-dark .wp-block-button__link {
  color: var(--mz-bg) !important;
  border-color: rgba(240, 239, 245, 0.3) !important;
}

.location-social-links-dark .wp-block-button__link:hover {
  background: var(--mz-bg) !important;
  color: var(--mz-black) !important;
  box-shadow: 4px 4px 0 var(--mz-blue);
}

/* ============================================
   LOCATION PAGE — DESCRIPTION
   ============================================ */
.location-description {
  font-size: 1.05rem;
  line-height: 1.75;
}

.location-description p + p {
  margin-top: 1.25rem;
}

/* "Chi siamo": text on the left, the municipio's logo on the right (an image
   block in the page content, `.location-logo`). Multiply melts the logos'
   white background into the page; it needs a backdrop inside the section,
   because the scroll animation isolates it — hence the background. */
.location-showcase:has(.location-logo) {
  background: var(--mz-bg);
}

.location-logo img {
  mix-blend-mode: multiply;
}

@media (max-width: 781px) {
  .location-intro .location-logo img {
    max-width: 180px;
    height: auto;
  }
}

/* ============================================
   LOCATION DETAIL PAGES
   ============================================ */

.location-page-hero {
  position: relative;
}

.location-page-hero .wp-block-cover__inner-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 65vh;
}

.location-page-hero::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -3%;
  width: clamp(60px, 10vw, 140px);
  height: 160%;
  background: var(--mz-red);
  transform: rotate(-15deg);
  opacity: 0.15;
  z-index: 1;
  pointer-events: none;
}

.location-page-hero-name {
  font-family: var(--wp--preset--font-family--bebas-neue) !important;
  font-size: clamp(5rem, 15vw, 12rem) !important;
  line-height: 0.85 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase;
  margin-bottom: 1rem !important;
}

.location-page-hero-address {
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase;
  opacity: 0.7;
}

.location-intro-text {
  font-size: 1.1rem !important;
  line-height: 1.75 !important;
}

/* Activity grid */
.activity-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.activity-card {
  border: 2px solid var(--mz-black);
  padding: 2rem !important;
  background: var(--mz-bg);
  position: relative;
  overflow: hidden;
  transition: all 0.15s ease;
  display: flex !important;
  flex-direction: column;
}

.activity-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--mz-red);
}

.activity-card.mz-card-linked:hover {
  transform: translate(-3px, -3px);
  box-shadow: 5px 5px 0 var(--mz-red);
}

.activity-card-dark {
  border-color: rgba(240, 239, 245, 0.12);
  background: rgba(240, 239, 245, 0.03);
}

.activity-card-dark::before {
  background: var(--mz-blue);
}

.activity-card-dark.mz-card-linked:hover {
  border-color: var(--mz-red);
  box-shadow: 5px 5px 0 var(--mz-blue);
}

/* A card whose title links to a progetto: the progetto's logo, added by the
   progetti-percorsi plugin (pp_activity_card_logo) — same white framed plate
   as on the progetto's own page, smaller. */
.activity-card-logo {
  width: 72px;
  height: 72px;
  margin: 0 0 1.25rem !important;
  background: #fff;
  border: 2px solid var(--mz-black);
  box-shadow: 4px 4px 0 var(--mz-red);
  flex-shrink: 0;
}

.activity-card-logo img {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 0.4rem;
  object-fit: contain;
}

.activity-card h3 a {
  color: inherit;
  text-decoration: none;
}

.activity-card.mz-card-linked:hover h3 a {
  color: var(--mz-red);
}

.activity-tag {
  display: inline-block !important;
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.6rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.15em !important;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border: 1.5px solid var(--mz-red);
  color: var(--mz-red) !important;
  margin-bottom: 1rem !important;
  align-self: flex-start;
  width: auto !important;
}

.activity-tag-light {
  border-color: rgba(240, 239, 245, 0.5) !important;
  color: var(--mz-bg) !important;
}

.schedule-list {
  margin-top: 0.75rem !important;
  margin-bottom: 0.5rem !important;
}

.schedule-entry {
  padding: 0.4rem 0 !important;
  border-bottom: 1px solid rgba(10, 14, 31, 0.08);
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.85rem !important;
  line-height: 1.5 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.schedule-entry:last-child {
  border-bottom: none;
}

.activity-card-dark .schedule-entry {
  border-bottom-color: rgba(240, 239, 245, 0.08);
}

.schedule-day {
  font-weight: 800 !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase;
  color: var(--mz-red) !important;
}

.activity-contact {
  margin-top: auto !important;
  padding-top: 1rem !important;
  border-top: 1.5px solid rgba(10, 14, 31, 0.12);
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.78rem !important;
  line-height: 1.7 !important;
}

.activity-card-dark .activity-contact {
  border-top-color: rgba(240, 239, 245, 0.1);
}

.activity-contact a {
  color: var(--mz-red);
  text-decoration: none;
  font-weight: 700;
  transition: opacity 0.15s ease;
}

.activity-contact a:hover {
  opacity: 0.7;
}

.activity-card-dark .activity-contact a {
  color: var(--mz-bg);
}

/* Cross-navigation cards */
.location-nav-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.location-nav-card {
  border: 2px solid var(--mz-black);
  padding: 0 !important;
  overflow: hidden;
  transition: all 0.15s ease;
  background: var(--mz-bg);
}

.location-nav-card.mz-card-linked:hover {
  transform: translate(-4px, -4px);
  box-shadow: 6px 6px 0 var(--mz-red);
}

.location-nav-card .wp-block-image {
  margin: 0;
}

.location-nav-card .wp-block-image img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
  display: block;
}

.location-nav-card-body {
  padding: 1.5rem !important;
}

/* Location statement (Offside) */
.location-statement {
  font-family: var(--wp--preset--font-family--bebas-neue) !important;
  font-size: clamp(1.5rem, 3vw, 2.5rem) !important;
  line-height: 1.35 !important;
  font-style: italic;
}

@media (max-width: 680px) {
  .activity-grid {
    grid-template-columns: 1fr;
  }
  .location-page-hero-name {
    font-size: clamp(3.5rem, 15vw, 6rem) !important;
  }
  .location-nav-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   EDITOR OVERRIDES
   ============================================ */
.editor-styles-wrapper .fade-up,
.editor-styles-wrapper .fade-in,
.editor-styles-wrapper .slide-in-left,
.editor-styles-wrapper .slide-in-right,
.editor-styles-wrapper .animate-on-scroll,
.editor-styles-wrapper .animate-on-scroll.alignfull.has-background > *,
.editor-styles-wrapper .stagger-children > *,
.editor-styles-wrapper .hero-title-municipio,
.editor-styles-wrapper .hero-title-zero,
.editor-styles-wrapper .hero-tagline-text,
.editor-styles-wrapper .hero-description-text,
.editor-styles-wrapper .hero-cta-row,
.editor-styles-wrapper .hero-cosmic-zero,
.editor-styles-wrapper .hero-coordinates,
.editor-styles-wrapper .hero-vertical-label {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

/* ============================================
   PROGETTI PAGE — SHARED
   ============================================ */

/* Intro block */
.pg-intro-text {
  font-size: 1.1rem !important;
  line-height: 1.75 !important;
  max-width: 62ch;
}

/* Anchor nav to the areas */
.pg-areanav {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 !important;
}

.pg-areanav a {
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 1rem;
  border: 2px solid var(--mz-black);
  color: var(--mz-black);
  text-decoration: none;
  transition: all 0.12s ease;
}

.pg-areanav a:hover {
  background: var(--mz-black);
  color: var(--mz-bg);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--mz-red);
}

/* Area section */
.pg-area {
  position: relative;
  overflow: hidden;
  scroll-margin-top: 5rem;
}

.pg-area-count {
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase;
  opacity: 0.5;
}

/* Place tags (linked municipi) */
.pg-tags {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 !important;
}

.pg-tags a,
.pg-tags strong {
  display: inline-block;
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  line-height: 1.5;
  padding: 0.2rem 0.55rem;
  border: 1.5px solid var(--mz-blue);
  color: var(--mz-blue);
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}

.pg-tags a:hover {
  background: var(--mz-blue);
  color: var(--mz-bg);
}

.pg-tags strong {
  border-color: rgba(10, 14, 31, 0.22);
  color: rgba(10, 14, 31, 0.45);
}

.pg-dark .pg-tags a {
  border-color: rgba(240, 239, 245, 0.45);
  color: var(--mz-bg);
}

.pg-dark .pg-tags a:hover {
  background: var(--mz-bg);
  color: var(--mz-black);
}

.pg-dark .pg-tags strong {
  border-color: rgba(240, 239, 245, 0.18);
  color: rgba(240, 239, 245, 0.45);
}

/* Article tags (municipio, progetto, percorso) — on every article card and in
   the single-article banner. See TAGS.md. */
.mz-post-tags .wp-block-post-terms__separator {
  display: none;
}

/* Cards: the tag row sits right above the title. */
.query-card-grid .mz-post-tags,
.query-card-dark .mz-post-tags {
  margin: 0 0 0.6rem !important;
}

/* Titles line up across a row of cards: every card has a tag row, at least one
   tag high (empty rows included: .mz-post-tags--vuoto). One tag = 0.6rem text ×
   1.5 line-height + 0.2rem padding top/bottom + 1.5px border top/bottom.
   Rows that wrap are evened out by municipiozero_align_card_titles (functions.php). */
.wp-block-post .mz-post-tags {
  min-height: calc(0.6rem * 1.5 + 0.4rem + 3px);
  align-content: flex-start;
}

/* In the article banner (not a card) an empty tag row just goes away. */
.page-title-banner .mz-post-tags--vuoto {
  display: none !important;
}

/* Single article: under date + category, on the dark title banner */
.page-title-banner .mz-post-tags {
  margin-top: 1rem !important;
}

/* Colours: each tag gets one of six palette colours (tag-1 … tag-6, editable in
   Site Editor → Styles → Colours), saved on the tag (mz_colore_n) and added by
   municipiozero_tag_colours, so a tag is the same colour everywhere. A tag with
   its own Colore (Articoli → Tag) carries an inline --tag instead.
   Soft look: pale tint background, darker shade for text and border, rounded pill. */
.pg-tags.mz-post-tags a {
  --tag: var(--wp--preset--color--tag-1);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag) 14%, #fff);
  border-color: color-mix(in srgb, var(--tag) 55%, #fff);
  color: color-mix(in srgb, var(--tag) 75%, #000);
}

.pg-tags.mz-post-tags a:hover {
  background: var(--tag);
  border-color: var(--tag);
  color: #fff;
}

.pg-tags.mz-post-tags a.mz-tag-c2 { --tag: var(--wp--preset--color--tag-2); }
.pg-tags.mz-post-tags a.mz-tag-c3 { --tag: var(--wp--preset--color--tag-3); }
.pg-tags.mz-post-tags a.mz-tag-c4 { --tag: var(--wp--preset--color--tag-4); }
.pg-tags.mz-post-tags a.mz-tag-c5 { --tag: var(--wp--preset--color--tag-5); }
.pg-tags.mz-post-tags a.mz-tag-c6 { --tag: var(--wp--preset--color--tag-6); }

/* Social links */
.pg-social {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 !important;
}

.pg-social a {
  display: inline-block;
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  line-height: 1.5;
  padding: 0.28rem 0.6rem;
  border: 1.5px solid rgba(10, 14, 31, 0.2);
  color: var(--mz-black);
  text-decoration: none;
  transition: all 0.12s ease;
}

.pg-social a:hover {
  border-color: var(--mz-red);
  color: var(--mz-red);
  transform: translate(-2px, -2px);
  box-shadow: 3px 3px 0 var(--mz-red);
}

.pg-dark .pg-social a {
  border-color: rgba(240, 239, 245, 0.22);
  color: var(--mz-bg);
}

.pg-dark .pg-social a:hover {
  border-color: var(--mz-bg);
  color: var(--mz-bg);
  box-shadow: 3px 3px 0 var(--mz-blue);
}

/* "Scopri di piu" link */
.pg-more {
  margin: 0 !important;
}

.pg-more a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mz-red);
  text-decoration: none;
  transition: gap 0.18s ease, color 0.15s ease;
}

.pg-more a:hover {
  gap: 0.95rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

.pg-dark .pg-more a {
  color: var(--mz-bg);
}

/* ============================================
   PROGETTI — TILES (MANIFESTO)
   ============================================ */
.pg-mosaic {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem;
}

.pg-tile {
  position: relative;
  overflow: hidden;
  display: flex !important;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.85rem;
  min-height: 300px;
  padding: 2rem !important;
  border: 2px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pg-tile > * {
  margin: 0 !important;
  position: relative;
  z-index: 2;
}

.pg-tile.mz-card-linked:hover {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0 var(--mz-red);
}

.pg-span-2 { grid-column: span 2; }
.pg-span-3 { grid-column: span 3; }
.pg-span-6 { grid-column: span 6; min-height: 240px; }

/* Full-bleed image layer. The image covers the whole tile and sits underneath
   everything; the tile's own colour is then laid back over it as a scrim (the
   ::after below inherits background-color), so the colour blocking survives and
   the text keeps its contrast. Out of flow, so the flex column is unaffected. */
.pg-tile-logo {
  position: absolute !important;
  inset: 0;
  z-index: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  background: none;
  overflow: hidden;
  pointer-events: none;
}

.pg-tile-logo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover; /* -> `contain` to show each logo whole instead of cropped */
  object-position: center;
  transition: transform 0.35s ease;
}

/* The scrim. `background-color: inherit` picks up whatever colour the tile was
   given, so one rule covers all four tile tones. */
.pg-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: inherit;
  opacity: 0.8;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* Hover thins the scrim and pushes the image in, so the artwork comes forward. */
.pg-tile.mz-card-linked:hover::after {
  opacity: 0.62;
}

/* The near-black tiles swallow the artwork at the default strength. Give the
   image more room there — white-on-near-black keeps its contrast regardless. */
.pg-tile.has-foreground-background-color::after {
  opacity: 0.68;
}

.pg-tile.has-foreground-background-color.mz-card-linked:hover::after {
  opacity: 0.5;
}

.pg-tile.mz-card-linked:hover .pg-tile-logo img {
  transform: scale(1.05);
}

.pg-tile-name {
  font-family: var(--wp--preset--font-family--bebas-neue) !important;
  font-size: clamp(1.9rem, 3.2vw, 2.9rem) !important;
  line-height: 0.95 !important;
  letter-spacing: 0.035em !important;
  text-transform: uppercase;
}

.pg-tile-name a {
  color: inherit;
  text-decoration: none;
}

/* Whole tile is clickable: the title link's ::before is stretched over the
   tile. For that, the title must not be positioned (else the overlay is
   confined to it), so image + scrim move to negative z-index inside an
   isolated tile and the text paints above them without needing z-index.
   The other links (tags, social, "scopri di piu") are lifted above the overlay. */
.pg-tile {
  isolation: isolate;
}

.pg-tile > * {
  position: static;
  z-index: auto;
}

.pg-tile-logo {
  z-index: -2 !important;
}

.pg-tile::after {
  z-index: -1;
}

.pg-tile-name a::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.pg-tile a:not(.pg-tile-name a) {
  position: relative;
  z-index: 2;
}

/* Slightly stronger than it was: there is artwork behind the text now. */
.pg-tile-desc {
  font-size: 0.85rem !important;
  line-height: 1.5 !important;
  opacity: 0.88;
}

.pg-tile-rule {
  width: 48px;
  height: 3px;
  background: var(--mz-red);
  border: 0;
  margin: 0 !important;
  transition: width 0.25s ease;
}

.pg-tile.mz-card-linked:hover .pg-tile-rule {
  width: 100%;
}

/* ============================================
   PROGETTI — RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .pg-mosaic {
    grid-template-columns: 1fr;
  }

  .pg-span-2,
  .pg-span-3,
  .pg-span-6 {
    grid-column: 1 / -1;
  }

  .pg-tile {
    min-height: 240px;
  }
}

@media (max-width: 782px) {
  .pg-tile {
    padding: 1.5rem !important;
  }
}

/* Progetti e Percorsi page: the two lists side by side (Tessere blocks with
   layout "griglia" inside a Columns block .pg-split), stacked below 900px. */
.pg-split {
  gap: 2.5rem !important;
  margin: 0 auto !important;
}

.pg-split > .wp-block-column {
  scroll-margin-top: 5rem;
}

.pg-split .pg-mosaic {
  gap: 1rem;
}

.pg-split .pg-tile {
  min-height: 240px;
  padding: 1.5rem !important;
  gap: 0.7rem;
}

.pg-split .pg-tile-name {
  font-size: clamp(1.6rem, 2.2vw, 2.1rem) !important;
}

@media (max-width: 900px) {
  .pg-split {
    flex-wrap: wrap !important;
    gap: 4rem !important;
  }

  .pg-split > .wp-block-column {
    flex-basis: 100% !important;
  }
}

/* ============================================
   PROGETTI PAGE - IMAGE WRAPPER RESETS
   ============================================ */
/* The <figure> WordPress wraps the image in has to fill the layer too,
   otherwise object-fit has nothing to cover. */
.pg-tile-logo .wp-block-image {
  margin: 0 !important;
  padding: 0;
  line-height: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
}

/* ============================================
   PROGETTI - TILE TONE CORRECTIONS
   ============================================ */

/* Hover shadow has to stay visible on both light and dark sections. */
.pg-area.pg-dark .pg-tile.mz-card-linked:hover {
  box-shadow: 8px 8px 0 var(--mz-bg);
}

/* The rule under the name follows the tile's own text colour, so it stays
   visible on the purple and blue tiles too. */
.pg-tile-rule {
  background: currentColor;
  opacity: 0.65;
}

/* A pale tile inside a dark section must not inherit the dark-section
   treatment for tags, socials and the "scopri di piu" link. */
.pg-tile-light .pg-tags a {
  border-color: var(--mz-blue);
  color: var(--mz-blue);
}

.pg-tile-light .pg-tags a:hover {
  background: var(--mz-blue);
  color: var(--mz-bg);
}

.pg-tile-light .pg-tags strong {
  border-color: rgba(10, 14, 31, 0.22);
  color: rgba(10, 14, 31, 0.45);
}

.pg-tile-light .pg-social a {
  border-color: rgba(10, 14, 31, 0.2);
  color: var(--mz-black);
}

.pg-tile-light .pg-social a:hover {
  border-color: var(--mz-red);
  color: var(--mz-red);
  box-shadow: 3px 3px 0 var(--mz-red);
}

.pg-tile-light .pg-more a {
  color: var(--mz-red);
}

/* A pale tile on the pale section background needs a real edge. */
.pg-tile-light {
  border-color: var(--mz-black);
}

/* ============================================
   PROGETTI - SOCIAL LINKS AS ICONS
   ============================================ */
/* The label text stays in the markup (screen readers still announce
   "Facebook"), but is collapsed to zero and replaced by a masked SVG that
   inherits currentColor, so one icon works on light and dark tiles alike.
   The icon is chosen from the href, so no markup change is needed. */
.pg-social {
  gap: 0.85rem;
  align-items: center;
}

.pg-social a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  padding: 0 !important;
  border: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  box-shadow: none !important;
  transform: none;
  transition: color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.pg-social a::before {
  content: '';
  display: block;
  width: 21px;
  height: 21px;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
}

.pg-social a[href*="facebook."]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z'/%3E%3C/svg%3E");
}

.pg-social a[href*="instagram."]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='20' height='20' rx='5' ry='5'/%3E%3Cpath d='M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z'/%3E%3Cline x1='17.5' y1='6.5' x2='17.51' y2='6.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='2' width='20' height='20' rx='5' ry='5'/%3E%3Cpath d='M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z'/%3E%3Cline x1='17.5' y1='6.5' x2='17.51' y2='6.5'/%3E%3C/svg%3E");
}

.pg-social a:hover {
  transform: translateY(-2px) !important;
  box-shadow: none !important;
  opacity: 0.75;
}

/* ============================================
   PROGETTO PAGE — SCHEDA
   The first section of every progetto page (templates/single-progetto.html),
   identical on all of them. Left: the excerpt as a big Bebas statement, then
   the page text. Right: the info card — logo (featured image) on top, then the
   block progetti-percorsi/scheda (Dove · Contatti · Seguici, stacked) — which
   rises into the dark title banner. Everything comes from the progetto's
   fields — see "Progetti e Percorsi.md", section "La pagina del progetto".
   ============================================ */
.pp-scheda-colonne {
  gap: 3rem !important; /* the clear space between the text and the card */
  align-items: flex-start !important;
  margin: 0 !important;
}

/* Left: a short purple bar, then the statement. */
.pp-scheda-testo {
  padding-top: 0.75rem;
}

.pp-scheda-lead::before {
  content: '';
  display: block;
  width: 64px;
  height: 6px;
  margin-bottom: 1.5rem;
  background: var(--mz-red);
}

.pp-scheda-lead .wp-block-post-excerpt__excerpt {
  font-family: var(--wp--preset--font-family--bebas-neue);
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 400;
  line-height: 1.05;
  max-width: 30ch;
  margin: 0;
}

.pp-scheda-testo .wp-block-post-content {
  margin-top: 1.75rem;
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: none; /* fills the column up to the gap before the card */
}

.pp-scheda-testo .wp-block-post-content:empty {
  display: none;
}

.pp-scheda-testo .wp-block-post-content > * {
  margin-block: 0 1em;
}

/* Right: the info card, just peeking over the banner's bottom edge.
   -3.5rem minus the 2.25rem top padding of .pp-scheda = it rises 1.25rem into
   the banner, less than the banner's 1.5rem bottom padding, so it can never
   reach the title. Pull it up further and long titles end up under the card. */
.pp-scheda-card {
  position: relative;
  z-index: 2;
  margin-top: -3.5rem !important;
  background: #fff;
  border: 2.5px solid var(--mz-black);
  box-shadow: 10px 10px 0 var(--mz-red);
}

/* No logo and no info: no card. */
.pp-scheda-card:not(:has(.wp-block-post-featured-image, .pp-scheda-info)) {
  display: none;
}

.pp-scheda-card .wp-block-post-featured-image {
  margin: 0;
  border-bottom: 2.5px solid var(--mz-black);
}

.pp-scheda-card .wp-block-post-featured-image img {
  box-sizing: border-box;
  padding: 1.75rem 2.25rem;
}

/* A photo instead of a logo (tick box "è una foto" in the progetto's Scheda box):
   the plugin switches it to object-fit cover on the chosen point; here it loses
   the logo's white margin and fills the box. */
.pp-scheda-card .wp-block-post-featured-image.pp-foto img {
  padding: 0;
}

/* Dove · Contatti · Seguici, one under the other; an empty one is never drawn (see the plugin). */
.pp-scheda-info {
  margin: 0 !important;
}

.pp-scheda-voce {
  padding: 1.25rem 1.5rem;
}

.pp-scheda-voce + .pp-scheda-voce {
  border-top: 1.5px solid rgba(10, 14, 31, 0.12);
}

.pp-scheda-titolo {
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mz-red);
  margin: 0 0 0.75rem;
}

.pp-contatti {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.pp-contatti li + li {
  margin-top: 0.6rem;
}

.pp-contatto-etichetta {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  opacity: 0.55;
}

.pp-contatti a {
  color: var(--mz-black);
  text-decoration: underline;
  text-decoration-color: var(--mz-red);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.pp-contatti a:hover {
  color: var(--mz-red);
}

/* Seguici: on the tiles the links are bare icons; here they get their name back,
   framed like the theme's buttons. */
.pp-scheda-info .pg-social {
  gap: 0.5rem;
}

.pp-scheda-info .pg-social a {
  width: auto;
  height: auto;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem !important;
  border: 2px solid var(--mz-black) !important;
  font-size: 0.65rem !important;
  line-height: 1 !important;
  letter-spacing: 0.12em;
  color: var(--mz-black);
  transition: transform 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}

.pp-scheda-info .pg-social a::before {
  width: 15px;
  height: 15px;
}

.pp-scheda-info .pg-social a:hover {
  color: var(--mz-red);
  opacity: 1;
  transform: translate(-2px, -2px) !important;
  box-shadow: 3px 3px 0 var(--mz-red) !important;
}

/* Phones: the card comes first (still tucked under the banner), the text after it. */
@media (max-width: 781px) {
  .pp-scheda-colonne {
    gap: 2.5rem !important;
  }

  .pp-scheda-card {
    order: -1;
    margin-top: -3.5rem !important;
    margin-right: 10px !important; /* room for the shadow */
  }

  .pp-scheda-card .wp-block-post-featured-image {
    aspect-ratio: 2 / 1 !important;
  }
}

/* --- Scheda v1 (template "Progetto — v1", templates/progetto-v1.html) ---
   Logo plate left; excerpt as lead, page text and the info row
   (Dove · Contatti · Seguici side by side) right. Only applies inside
   .pp-scheda--v1, undoing the v2 rules above. */
.pp-scheda--v1 .pp-scheda-colonne {
  gap: 3.5rem !important;
}

.pp-scheda--v1 .pp-scheda-colonne:not(:has(.wp-block-post-featured-image)) > .pp-scheda-logo {
  display: none;
}

.pp-scheda--v1 .pp-scheda-logo .wp-block-post-featured-image {
  margin: 0;
  background: #fff;
  border: 2.5px solid var(--mz-black);
  box-shadow: 8px 8px 0 var(--mz-red);
}

.pp-scheda--v1 .pp-scheda-logo .wp-block-post-featured-image img {
  box-sizing: border-box;
  padding: 1.25rem;
}

.pp-scheda--v1 .pp-scheda-logo .wp-block-post-featured-image.pp-foto img {
  padding: 0;
}

.pp-scheda--v1 .pp-scheda-testo {
  padding-top: 0;
}

.pp-scheda--v1 .pp-scheda-lead::before {
  content: none;
}

.pp-scheda--v1 .pp-scheda-lead .wp-block-post-excerpt__excerpt {
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.3;
  max-width: 34ch;
}

.pp-scheda--v1 .pp-scheda-testo .wp-block-post-content {
  margin-top: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.65;
  max-width: 65ch;
}

.pp-scheda--v1 .pp-scheda-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.75rem 2.5rem;
  margin: 2.25rem 0 0 !important;
  padding-top: 1.5rem;
  border-top: 2.5px solid var(--mz-black);
}

.pp-scheda--v1 .pp-scheda-voce {
  padding: 0;
}

.pp-scheda--v1 .pp-scheda-voce + .pp-scheda-voce {
  border-top: 0;
}

@media (max-width: 781px) {
  .pp-scheda--v1 .pp-scheda-logo .wp-block-post-featured-image {
    max-width: 180px;
  }

  .pp-scheda--v1 .pp-scheda-lead .wp-block-post-excerpt__excerpt {
    font-size: 1.4rem;
  }
}

/* ============================================
   COSA FACCIAMO — FUSED SECTION
   Progetti carousel + articles. Shared by both
   layout variants (--rail and --strip).
   ============================================ */

/* --- section header: title left, "tutti i progetti" right --- */
.mz-facciamo-head {
  display: flex !important;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  margin-bottom: 2.5rem !important;
}
.mz-facciamo-head > * { margin: 0 !important; }
.mz-facciamo-headtext { flex: 1 1 32ch; }
.mz-facciamo-headtext > * { margin: 0 !important; }
.mz-facciamo-intro {
  font-size: 1.05rem !important;
  line-height: 1.7 !important;
  max-width: 62ch;
  margin-top: 1rem !important;
  opacity: 0.85;
}

/* --- carousel shell --- */
.mz-facciamo { overflow-x: clip; }
.mz-carousel { position: relative; }

.mz-carousel-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* vertical room for the tiles' brutalist hover shadow, which an overflow
     container would otherwise clip. Kept off the horizontal axis on purpose:
     .alignwide is already flush with the viewport at ~1040px, so a negative
     left/right margin here would widen the whole page and force a scrollbar. */
  padding: 6px 0 16px;
  margin: -6px 0 -16px;
  /* moving every slide during the shuffle otherwise lets scroll anchoring
     drag the scroller away from its start position */
  overflow-anchor: none;
}
.mz-carousel-viewport::-webkit-scrollbar { width: 0; height: 0; display: none; }
.mz-carousel-viewport:focus-visible { outline: 2.5px solid var(--mz-red); outline-offset: 2px; }

.mz-carousel-track {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 1.25rem;
}
.mz-carousel-track > .pg-tile {
  flex: 0 0 calc((100% - 2.5rem) / 3);
  scroll-snap-align: start;
  min-height: 360px;
  grid-column: auto; /* neutralise any stray .pg-span-* from the progetti page */
}

/* --- control bar: arrows + progress + counter --- */
.mz-carousel-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.75rem;
}
.mz-carousel-btns { display: flex; gap: 0.6rem; flex: 0 0 auto; }
.mz-carousel-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: inherit;
  border: 2.5px solid currentColor;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.mz-carousel-btn svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.mz-carousel-btn:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--mz-red);
}
.mz-carousel-btn:active:not(:disabled) { transform: translate(0, 0); box-shadow: none; }
.mz-carousel-btn:disabled { opacity: 0.22; cursor: default; }
.mz-carousel-btn:focus-visible { outline: 2.5px solid var(--mz-red); outline-offset: 3px; }

.mz-carousel-progress {
  flex: 1 1 auto;
  position: relative;
  height: 3px;
  overflow: hidden;
  background: rgba(10, 14, 31, 0.14);
}
.mz-carousel-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 30%;
  background: var(--mz-red);
  transition: transform 0.25s ease, width 0.25s ease;
}
.mz-carousel-count {
  flex: 0 0 auto;
  font-family: var(--wp--preset--font-family--tt-commons);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  opacity: 0.55;
  margin: 0 !important;
}
/* if every slide already fits, the controls have nothing to do */
.mz-carousel-static .mz-carousel-bar { display: none; }

/* --- the "all of the polisportiva" gateway slide: same border as every tile, only the count differs --- */
.pg-tile-count {
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.62rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase;
  opacity: 0.7;
}

/* --- variant A: carousel + narrow article rail --- */
.mz-facciamo-split {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 3rem;
  align-items: start;
}
.mz-newswire { border-top: 2.5px solid currentColor; padding-top: 1.1rem; }
.mz-newswire > * { margin: 0 !important; }
.mz-newswire-label {
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.7rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase;
  color: var(--mz-red) !important;
  margin-bottom: 0.9rem !important;
}
.mz-newswire .wp-block-post-template { margin: 0; padding: 0; display: block !important; }
.mz-newswire .wp-block-post {
  border-bottom: 1px solid rgba(10, 14, 31, 0.15);
  padding: 0.95rem 0;
  transition: padding-left 0.18s ease;
}
.mz-newswire .wp-block-post:first-child { padding-top: 0; }
.mz-newswire .wp-block-post.mz-card-linked:hover { padding-left: 0.4rem; }
.mz-newswire .wp-block-post-date {
  font-size: 0.65rem !important;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mz-red);
  margin: 0 0 0.35rem !important;
}
.mz-newswire .wp-block-post-title {
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  margin: 0 !important;
}
.mz-newswire .wp-block-post-title a { text-decoration: none; color: inherit; }
.mz-newswire .wp-block-post-title a:hover { color: var(--mz-red); }
.mz-newswire .section-archive-link { margin-top: 1.25rem !important; }

/* --- dark background (homepage): the near-black tiles need an edge, and the
   hairlines drawn in dark ink have to turn light --- */
.mz-facciamo--dark .mz-carousel-track > .pg-tile { border-color: rgba(240, 239, 245, 0.55); }
.mz-facciamo--dark .mz-carousel-progress { background: rgba(240, 239, 245, 0.18); }
.mz-facciamo--dark .mz-newswire .wp-block-post { border-bottom-color: rgba(240, 239, 245, 0.15); }

/* --- variant B: carousel with an article strip underneath --- */
.mz-articles-strip {
  margin-top: 3.5rem !important;
  border-top: 2.5px solid currentColor;
  padding-top: 1.5rem;
}
.mz-articles-strip-head {
  display: flex !important;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-bottom: 1.75rem !important;
}
.mz-articles-strip-head > * { margin: 0 !important; }

/* --- a temporary flag so the two variants are tellable apart --- */
.mz-variant-flag {
  display: inline-block;
  font-family: var(--wp--preset--font-family--tt-commons) !important;
  font-size: 0.62rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border: 2px solid var(--mz-red);
  color: var(--mz-red) !important;
  margin: 0 0 1.5rem !important;
}

/* --- responsive --- */
@media (max-width: 1024px) {
  .mz-facciamo-split { grid-template-columns: 1fr !important; gap: 2.5rem; }
  .mz-carousel-track > .pg-tile { flex-basis: calc((100% - 1.25rem) / 2); }
}
@media (max-width: 700px) {
  .mz-carousel-track > .pg-tile { flex-basis: 84%; min-height: 320px; }
  .mz-carousel-btn { width: 42px; height: 42px; }
  .mz-carousel-bar { gap: 1rem; }
  .mz-carousel-count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mz-carousel-progress-bar { transition: none; }
  .mz-carousel-btn { transition: none; }
}

/* ============================================
   HEADER — "PROGETTI E PERCORSI" MEGA MENU
   The .mz-mega item holds two nested submenus:
   Progetti (every progetto, Polisportiva included —
   its sports live on /progetti-percorsi/polisportiva/)
   and Percorsi. On desktop they stop behaving as
   flyouts and become two always-open columns in one
   panel, one list each, side by side.
   Below 1024px the hamburger menu takes over (see
   TABLETS AND PHONES at the end of the file).

   Specificity note: core's own rules for this are
   up to 0,5,0 (the :hover / items-justified-right
   ones), so every override below is deliberately
   qualified with li.wp-block-navigation-submenu to
   outrank them. Don't "simplify" those selectors.
   ============================================ */
@media (min-width: 1024px) {
  /* the panel: Progetti | Percorsi */
  .site-header-inner .wp-block-navigation li.mz-mega.wp-block-navigation-submenu > .wp-block-navigation__submenu-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: 0;
    left: auto;
    right: 0;
    width: max-content;
    max-width: min(46rem, calc(100vw - 3rem));
    padding: 0.9rem 0 0; /* links run edge to edge, like the other submenus */
  }

  .site-header-inner .wp-block-navigation li.mz-mega.wp-block-navigation-submenu > .wp-block-navigation__submenu-container > li {
    display: block;
  }

  /* thin line between the Progetti and Percorsi columns */
  .site-header-inner .wp-block-navigation li.mz-mega.wp-block-navigation-submenu > .wp-block-navigation__submenu-container > li + li {
    border-left: 1px solid rgba(245, 245, 240, 0.1);
  }

  /* each column: always open, no flyout chrome.
     core hides submenus with width/height 0 + overflow
     hidden, so all four have to be reset here. */
  .site-header-inner .wp-block-navigation li.mz-mega.wp-block-navigation-submenu > .wp-block-navigation__submenu-container > li.wp-block-navigation-submenu > .wp-block-navigation__submenu-container {
    position: static;
    visibility: visible;
    opacity: 1;
    width: auto;
    height: auto;
    min-width: 0;
    overflow: visible;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  /* column heading = Progetti / Percorsi */
  .site-header-inner .wp-block-navigation li.mz-mega.wp-block-navigation-submenu > .wp-block-navigation__submenu-container > li > .wp-block-navigation-item__content {
    display: block;
    padding: 0 0.75rem 0.5rem; /* 12px sides: lines up with the links */
    margin-bottom: 0;
    border-bottom: 2px solid var(--mz-red);
    color: var(--mz-red) !important;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .site-header-inner .wp-block-navigation li.mz-mega.wp-block-navigation-submenu > .wp-block-navigation__submenu-container > li > .wp-block-navigation-item__content:hover,
  .site-header-inner .wp-block-navigation li.mz-mega.wp-block-navigation-submenu > .wp-block-navigation__submenu-container > li > .wp-block-navigation-item__content:focus {
    background: transparent !important;
    color: #fff !important;
  }

  /* the links themselves: same look as every other header
     submenu (I Municipi Sociali) — keep these values in sync with
     the ".wp-block-navigation__submenu-container a" rule near the
     top of the file. Restated here only because core's nested-
     submenu rules outrank that one. */
  .site-header-inner .wp-block-navigation li.mz-mega.wp-block-navigation-submenu > .wp-block-navigation__submenu-container > li > .wp-block-navigation__submenu-container a {
    display: block;
    padding: 0.5em 1em; /* = what Municipi Sociali's links end up with (6px 12px) */
    margin-left: 0;
    border-bottom: 1px solid rgba(245, 245, 240, 0.1);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  /* no flyout arrows inside the panel */
  .site-header-inner .wp-block-navigation li.mz-mega.wp-block-navigation-submenu > .wp-block-navigation__submenu-container .wp-block-navigation__submenu-icon {
    display: none;
  }
}

/* ============================================
   CALENDARIO — PROSSIMI EVENTI + ARCHIVIO
   Both lists are the same Events Manager grid; the archive below
   is just scoped to past events. Same width so the two grids line
   up, and past cards drop time and place.
   ============================================ */

/* The upcoming list is injected into post-content, so the constrained
   layout caps it at contentSize. Widen it to match the archive. */
.wp-block-post-content > #em-wrapper {
  max-width: var(--wp--style--global--wide-size);
}

/* An archive only needs the date — time and place are noise once it's over. */
.mz-past-events .em-event-time,
.mz-past-events .em-event-location {
  display: none;
}

/* ============================================
   ORARI — plugin "orari" (wp-content/plugins/orari/README.md)
   .orari-schede: one card per group on a progetto's page.
   .orari-settimana: Mon–Fri (+ Sat/Sun when used) on the parent's page;
   each entry is a clickable card (in CARDS) edged in the progetto's tag colour.
   ============================================ */

.orari-schede {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.orari-scheda {
  position: relative;
  border: 2px solid var(--mz-black);
  background: var(--mz-bg);
  padding: 1.75rem;
}

.orari-scheda::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--mz-red);
}

.orari-gruppo {
  font-family: var(--wp--preset--font-family--bebas-neue);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 0.75rem;
}

.orari-righe {
  list-style: none;
  margin: 0;
  padding: 0;
}

.orari-riga {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  column-gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(10, 14, 31, 0.08);
  line-height: 1.4;
}

.orari-riga:last-child {
  border-bottom: none;
}

.orari-riga .orari-giorni {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mz-red);
  padding-top: 0.15rem;
}

.orari-riga .orari-ora {
  font-weight: 700;
}

.orari-riga .orari-luogo {
  grid-column: 2;
  font-size: 0.8rem;
  opacity: 0.65;
}

.orari-piede {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: 1.5rem;
}

.orari-piede:empty {
  display: none;
}

.orari-dove {
  align-items: center;
}

.orari-dove-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-right: 0.25rem;
}

.orari-aggiornato {
  font-size: 0.75rem;
  opacity: 0.6;
  margin: 0 !important;
}

/* Week */
.orari-settimana {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 1rem;
}

.orari-giorno-nome {
  font-family: var(--wp--preset--font-family--bebas-neue);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--mz-black);
}

.orari-giorno-vuoto {
  font-size: 0.8rem;
  opacity: 0.45;
  margin: 0;
}

.orari-voce {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.6rem;
  padding: 0.7rem 0.8rem;
  background: var(--mz-bg);
  border: 1.5px solid rgba(10, 14, 31, 0.15);
  border-left: 5px solid var(--voce, var(--mz-red));
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.orari-voce.mz-card-linked:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--voce, var(--mz-red));
}

.orari-voce .orari-ora {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.orari-voce-nome {
  font-family: var(--wp--preset--font-family--bebas-neue);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.05;
  margin: 0;
}

.orari-voce-nome a {
  color: inherit;
  text-decoration: none;
}

.orari-voce-gruppo {
  font-size: 0.8rem;
  line-height: 1.3;
}

.orari-voce .orari-luogo {
  font-size: 0.72rem;
  line-height: 1.3;
  opacity: 0.6;
}

@media (max-width: 1024px) {
  .orari-settimana {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 2rem;
  }
}

@media (max-width: 600px) {
  .orari-settimana {
    grid-template-columns: minmax(0, 1fr);
  }

  .orari-riga {
    grid-template-columns: 5.5rem 1fr;
  }
}

/* ============================================
   TABLETS AND PHONES (max-width: 1023px)
   Everything only tablets and phones see lives in the blocks below, so the
   desktop layout (1024px and up) never moves. Order: this shared block,
   then TABLETS (600–1023), then PHONES (≤781), then the header (≤1023).
   ============================================ */
@media (max-width: 1023px) {
  /* Side margin of every full-width section (theme.json root padding).
     PHONES narrows it to 1.25rem. */
  :root { --mz-gutter: 2rem; }
  /* …also for sections that set their own (smaller) side padding inline,
     so every page lines up on the same margin. */
  .wp-site-blocks .alignfull.has-global-padding {
    padding-left: var(--mz-gutter) !important;
    padding-right: var(--mz-gutter) !important;
  }

  /* --- Home "Cosa Facciamo": keep the column inside the screen, so the
     carousel and the newswire titles fit instead of overflowing --- */
  .mz-facciamo-split { grid-template-columns: minmax(0, 1fr) !important; }

  /* --- Menu overlay: dark, left-aligned, readable. Tablets get the hamburger
     too (TABLETS block below); core alone shows it only under 600px. --- */
  .site-header-inner .wp-block-navigation__responsive-container.is-menu-open {
    background: var(--mz-black) !important;
    color: var(--mz-bg) !important;
    padding: 0.75rem var(--mz-gutter) 2.5rem !important;
  }
  .site-header-inner .wp-block-navigation__responsive-container-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mz-bg);
  }
  .site-header-inner .wp-block-navigation__responsive-container-close svg { width: 30px; height: 30px; }
  .site-header-inner .is-menu-open .wp-block-navigation__responsive-container-content {
    padding-top: 3.5rem !important;
    align-items: stretch !important;
  }
  .site-header-inner .is-menu-open .wp-block-navigation__container,
  .site-header-inner .is-menu-open .wp-block-navigation-item,
  .site-header-inner .wp-block-navigation .is-menu-open .wp-block-navigation__submenu-container {
    align-items: flex-start !important;
    width: 100%;
  }
  .site-header-inner .is-menu-open .wp-block-navigation__container { gap: 0 !important; }
  .site-header-inner .wp-block-navigation .is-menu-open a {
    color: var(--mz-bg) !important;
    background: transparent !important;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.7rem 0 !important;
    border: 0 !important;
  }
  .site-header-inner .wp-block-navigation .is-menu-open a:hover,
  .site-header-inner .wp-block-navigation .is-menu-open a:focus {
    color: var(--mz-red) !important;
    background: transparent !important;
  }
  /* a top-level item with children: its children indented under a purple rule */
  .site-header-inner .wp-block-navigation .is-menu-open .wp-block-navigation__submenu-container {
    background: transparent !important;
    border: 0 !important;
    border-left: 2px solid var(--mz-red) !important;
    min-width: 0;
    padding: 0 0 0 1rem !important;
    margin: 0 0 0.6rem !important;
    gap: 0 !important;
  }
  .site-header-inner .wp-block-navigation .is-menu-open .wp-block-navigation__submenu-container a {
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--mz-bg-warm) !important;
    padding: 0.5rem 0 !important;
  }
  /* Progetti e Percorsi: on phones just the two links, not every progetto/percorso
     (the lists are filled in by the plugin, pp_menu_column) */
  .site-header-inner .wp-block-navigation .is-menu-open .mz-menu-progetti > .wp-block-navigation__submenu-container,
  .site-header-inner .wp-block-navigation .is-menu-open .mz-menu-percorsi > .wp-block-navigation__submenu-container,
  .site-header-inner .wp-block-navigation .is-menu-open .mz-menu-progetti > .wp-block-navigation__submenu-icon,
  .site-header-inner .wp-block-navigation .is-menu-open .mz-menu-percorsi > .wp-block-navigation__submenu-icon {
    display: none !important;
  }
}

/* ============================================
   TABLETS (600–1023px)
   ============================================ */
@media (min-width: 600px) and (max-width: 1023px) {
  /* The phone menu: core shows the full menu from 600px up; swap it for the
     hamburger + overlay (styled above) so the header stays on one row. */
  .site-header-inner .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: flex;
  }
  .site-header-inner .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
    display: none;
  }

  /* Hero: its layout on tablets is still to be decided; for now only make it
     sit on the page margin — drop the content's own 1.5rem side padding and the
     Cover block's default 1em, which both came on top of the gutter. */
  .hero-section,
  .hero-content-wrap {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Article card grids: two per row instead of three squeezed ones. */
  .query-card-grid .wp-block-post-template.is-layout-grid,
  .mz-evidenza .wp-block-post-template.is-layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* Footer: "Municipio Zero" across the top, the three link columns under it. */
  .site-footer-wrap .wp-block-columns {
    flex-wrap: wrap !important;
    row-gap: 2.5rem !important;
  }
  .site-footer-wrap .wp-block-columns > .wp-block-column:first-child {
    flex-basis: 100% !important;
  }
  .site-footer-wrap .wp-block-columns > .wp-block-column:not(:first-child) {
    flex: 1 1 0 !important;
  }
}

/* ============================================
   PHONES (max-width: 781px)
   781px is core's own breakpoint: below it Columns stack.
   ============================================ */
@media (max-width: 781px) {
  :root { --mz-gutter: 1.25rem; }

  /* Stacked columns: the global blockGap is 0, so give them air. */
  .wp-block-columns { row-gap: 2rem !important; }

  /* --- Home hero: big title at the bottom of the screen --- */
  .hero-section {
    min-height: calc(100vh - 56px) !important;
    min-height: calc(100svh - 56px) !important;
    align-items: flex-end !important;
  }
  /* padding-top: on short screens the cover grows instead of the title
     touching the header */
  .hero-content-wrap { padding: 4.5rem 0 2.25rem !important; }

  /* Two-line title: "MUNICIPIO" / "ZER" + the "0" logo as the O.
     --mz-hero-fs: "MUNICIPIO" spans the content width (the word is 3.29em wide
     at 0.02em spacing), capped so a portrait tablet still shows the buttons. */
  .hero-title-row {
    --mz-hero-fs: min(calc((100vw - 2 * var(--mz-gutter)) * 0.3), 10rem);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12em;
    font-size: var(--mz-hero-fs);
  }
  .hero-title-municipio {
    font-size: var(--mz-hero-fs) !important;
    letter-spacing: 0.02em !important;
    line-height: 0.85 !important;
  }
  /* Line 2. "ZER" is drawn by CSS; `/ ""` keeps screen readers from reading it
     (they get the h1 "MUNICIPIO" and the image's alt "Zero"). Same font, size,
     spacing and colour as line 1; it slides in with the title. */
  .hero-title-logo {
    display: flex;
    align-items: baseline;
    margin: 0 !important;
    font-size: var(--mz-hero-fs);
    animation-name: title-slide-in;
  }
  .hero-title-logo::before {
    content: "ZER";
    content: "ZER" / "";
    font-family: var(--wp--preset--font-family--bebas-neue);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 0.85;
    color: var(--mz-bg);
  }
  /* The logo as the O. Bebas Neue's O is 0.72em tall (0.71 above the baseline,
     0.01 below); the logo's visible "0" is 1280 of its 1359px, with 42px of
     transparent space under it. So ~0.76em tall (0.75 after checking by eye),
     nudged 0.034em down, and a
     small left margin to match the font's R→O spacing. */
  .hero-title-logo img {
    height: 0.75em !important;
    position: relative;
    top: 0.034em;
    margin-left: 0.017em;
  }
  .hero-content-wrap > .wp-block-group:not(.hero-title-row) {
    margin-top: 1.5rem !important;
    padding-left: 0 !important;
  }
  .hero-tagline-text {
    font-size: 0.72rem !important;
    letter-spacing: 0.18em !important;
    line-height: 1.5;
    margin: 0 0 0.5rem !important;
  }
  .hero-description-text {
    font-size: 1rem !important;
    max-width: none;
    margin: 0 0 1.5rem !important;
  }
  .hero-cta-row {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }
  .hero-cta-row .wp-block-button { width: 100%; }
  .hero-cta-row .wp-block-button__link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 1rem 1.5rem;
  }
  .hero-coordinates,
  .hero-vertical-label { display: none; }

  /* --- Articles: justified text makes gaps on a narrow column --- */
  .single-post .wp-block-post-content > p { text-align: left; }

  /* --- Footer --- */
  .site-footer-wrap .wp-block-columns { row-gap: 2.25rem !important; }
  .site-footer-wrap h4 { margin-bottom: 0.4rem; }
  .footer-nav { gap: 0 !important; }
  .footer-nav p { margin: 0; }
  .footer-nav a { display: inline-block; padding: 0.4rem 0; }
  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.4rem;
  }
}

/* Header with the hamburger (phones, and tablets via the TABLETS block).
   Logo left, search + menu right, thumb-sized buttons. Don't set `display`
   on the open button here: core hides it from 600px up, and only the TABLETS
   block (600–1023) brings it back. */
@media (max-width: 1023px) {
  .site-header-inner { gap: 0.25rem; }
  .site-header-inner .header-search-icon { order: 2; margin-left: auto; }
  .site-header-inner .wp-block-navigation { order: 3; }
  .site-header-inner .wp-block-navigation__responsive-container-open,
  .header-search-icon .wp-block-search__button {
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
  }
  .site-header-inner .wp-block-navigation__responsive-container-open svg { width: 30px; height: 30px; }
}
