/* =====================================================
   MOTUS DESIGN SYSTEM
   Base CSS – Home + Pillar Pages (FINAL VERSION)
   ===================================================== */

/* ---------- RESET MINIMO + WP SAFETY ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

/* FIX LINK ANCORA: Gestisce lo scroll con header sticky */
html { 
  scroll-behavior: smooth; 
  scroll-padding-top: 120px; /* Altezza Header + spazio respiro (Cruciale per i link) */
}

body {
  margin: 0;
  font-family: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
  background-color: #ffffff;
  line-height: 1.6;
  overflow-x: hidden; /* Previene scroll orizzontale */
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid rgba(31, 154, 116, 0.35);
  outline-offset: 3px;
}

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Brand Colors */
  --brand-900: #0f3d2e;
  --brand-800: #145c46;
  --brand-700: #1a7f61;
  --brand-600: #1f9a74;
  --brand-500: #26b287;

  /* Neutral Colors */
  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --bg-soft: #f5f7f6;
  --bg-dark: #0f3d2e;
  --line-200: #e5e7eb;

  /* Fonts */
  --font-display: "Montserrat", system-ui, sans-serif;

  /* UI Tokens */
  --radius-lg: 18px;
  --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 18px 60px rgba(15, 23, 42, 0.12);
  --burger-ink: #0f172a; 

  /* Header spacing */
  --header-h: 92px;
  --header-gap: 30px;

  /* Spacing Variables */
  --m-space-xs: 6px;
  --m-space-sm: 20px;
  --m-space-md: 20px;
  --m-space-lg: 30px;
  --m-space-xl: 40px;
  --m-space-2xl: 50px;
}

/* ---------- TYPOGRAPHY ---------- */
.m-h1, .m-h2, .m-h3 {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}

.m-h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.15;
  margin: 0 0 var(--m-space-sm);
}

.m-h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0 0 var(--m-space-sm);
}

.m-h3 {
  margin: 0 0 var(--m-space-xs);
}

.m-p {
  font-size: 1rem;
  color: var(--ink-700);
  max-width: 60ch;
  margin: 0;
}
.m-p + .m-p { margin-top: var(--m-space-md); }

.m-kicker {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-600);
  margin: 0 0 var(--m-space-xs);
}

/* ---------- LAYOUT & CONTAINER ---------- */
.m-container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 20px;
}

.m-section { padding: var(--m-space-2xl) 0; }
.m-bgSoft { background-color: var(--bg-soft); }

@media (max-width: 900px) {
  .m-container { padding-inline: 16px; }
  .m-section { padding-block: calc(var(--m-space-2xl) - 12px); }
}

/* =====================================================
   ASTRA RESET — FULL WIDTH SAFE
   ===================================================== */
.ast-container, .site-content, #content, #primary, #main {
  max-width: none !important; width: 100% !important;
}
.ast-container { padding-left: 0 !important; padding-right: 0 !important; }
.site-content .ast-container { margin: 0 !important; }
.site-content { padding: 0 !important; margin: 0 !important; }

/* FULL-BLEED BREAKOUT & MAIN VISIBILITY */
.m-header, .m-footer, .m-hero, .m-main {
  width: 100%; max-width: 100%; margin-left: 0; margin-right: 0;
}

/* VISIBILITÀ MAIN (Cruciale per SEO Mobile) */
.m-main {
  display: block !important;
  position: relative;
  z-index: 1; 
  background-color: #ffffff;
  min-height: 300px; 
  clear: both;
}

/* Desktop Only: Full-Width Breakout */
@media (min-width: 901px) {
  .m-hero {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
}

/* ---------- HEADER ---------- */
.m-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: #fff;
  border-bottom: 1px solid var(--line-200);
}

.m-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 72px; padding: 10px 0;
  flex-wrap: nowrap; overflow: visible;
}

.m-brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-family: var(--font-display);
  font-weight: 900; letter-spacing: 0.2px; color: var(--ink-900);
}

.m-navActions {
  display: inline-flex; align-items: center; gap: 12px;
}

/* =====================================================
   BUTTONS (STANDARD)
   ===================================================== */
.m-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px; border-radius: 14px;
  font-family: var(--font-display); font-weight: 800; font-size: 0.95rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  user-select: none;
}
.m-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.m-btn:active { transform: translateY(0); box-shadow: none; }

.m-btn-primary {
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
  color: #fff;
}
.m-btn-primary:hover { opacity: .95; }

.m-btn-secondary {
  background: transparent; border-color: var(--brand-600); color: var(--brand-600);
}
.m-btn-secondary:hover { background: rgba(31,154,116,0.08); }

.m-link {
  font-family: var(--font-display); font-weight: 800; color: var(--brand-700);
  text-decoration: none; transition: opacity .15s ease;
}
.m-link:hover { opacity: .85; }

/* =====================================================
   FIX HERO BUTTONS (Risolve il problema "Matrioska" e i click)
   ===================================================== */

/* 1. RESET DEL WRAPPER (Il contenitore esterno diventa invisibile) */
.m-hero .wp-block-button,
.m-hero .wp-block-button.m-btn,
.m-hero .wp-block-button.m-btn-primary,
.m-hero .wp-block-button.m-btn-secondary {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

/* 2. STILE DEL LINK (Il bottone vero e cliccabile) */
.m-hero .wp-block-button__link,
.m-hero a.m-btn {
  border-radius: 999px !important;
  padding: 16px 30px !important;
  font-family: var(--font-display);
  font-weight: 800;
  text-decoration: none !important;
  border: 1px solid transparent !important;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease;
  background-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
}

/* 3. COLORI PRIMARY (Giallo) */
.m-hero .wp-block-button.m-btn-primary .wp-block-button__link,
.m-hero a.m-btn-primary {
  background: #f5c842 !important;
  color: #0f3d2e !important;
  border-color: #7adbb0 !important;
  box-shadow: 0 10px 22px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.45) !important;
}
.m-hero .wp-block-button.m-btn-primary .wp-block-button__link:hover,
.m-hero a.m-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.55) !important;
}

/* 4. COLORI SECONDARY (Verde) */
.m-hero .wp-block-button.m-btn-secondary .wp-block-button__link,
.m-hero a.m-btn-secondary {
  background: linear-gradient(135deg, #1a7f61 0%, #26b287 100%) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.35) !important;
  box-shadow: 0 9px 20px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.35) !important;
}
.m-hero .wp-block-button.m-btn-secondary .wp-block-button__link:hover,
.m-hero a.m-btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.45) !important;
}

/* =====================================================
   DESKTOP MENU
   ===================================================== */
.m-menu--desktop .m-menuList {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 24px;
  flex-wrap: nowrap; overflow: visible;
}
.m-menu--desktop .m-menuList > li { margin: 0; padding: 0; position: relative; }
.m-menu--desktop .m-menuList a {
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  color: var(--ink-700); text-decoration: none; padding: 8px 10px;
  border-radius: 12px; display: inline-flex; transition: all .15s ease;
}
.m-menu--desktop .m-menuList a:hover {
  color: var(--brand-700); background: var(--bg-soft); transform: translateY(-1px);
}
.m-menu--desktop .current-menu-item > a {
  background: rgba(38,178,135,0.12); color: var(--brand-800);
}

/* Dropdown */
.m-menu--desktop .m-menuList > li.menu-item-has-children { padding-bottom: 12px; }
.m-menu--desktop .m-menuList > li.menu-item-has-children::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 12px;
}
.m-menu--desktop .m-menuList > li > .sub-menu {
  position: absolute; top: 100%; left: 0; margin-top: 8px;
  min-width: 260px; padding: 10px; list-style: none;
  background: #fff; border: 1px solid var(--line-200);
  border-radius: 16px; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: all .15s ease; z-index: 99999;
}
.m-menu--desktop .m-menuList > li:hover > .sub-menu,
.m-menu--desktop .m-menuList > li:focus-within > .sub-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.m-menu--desktop .m-menuList > li > .sub-menu a {
  display: block; padding: 10px 12px; border-radius: 12px; background: transparent;
}
.m-menu--desktop .m-menuList > li > .sub-menu a:hover { background: var(--bg-soft); }
.m-menu--desktop .ast-menu-toggle, .m-menu--desktop .submenu-toggle { display: none !important; }

/* =====================================================
   MOBILE MENU
   ===================================================== */
.m-burger { display: none; }
.m-burgerLines {
  width: 18px; height: 2px; background: var(--burger-ink) !important;
  position: relative; display: block; border-radius: 2px;
}
.m-burgerLines::before, .m-burgerLines::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px;
  background: var(--burger-ink) !important; border-radius: 2px;
}
.m-burgerLines::before { top: -6px; }
.m-burgerLines::after  { top:  6px; }

/* Drawer */
.m-mobile { display: none; }
.m-mobile.is-open { display: block; }
.m-mobileBackdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,0.45); z-index: 1300;
}
.m-mobilePanel {
  position: fixed; top: 0; right: 0; height: 100vh;
  width: min(420px, 92vw); background: #fff; z-index: 1400;
  border-left: 1px solid var(--line-200); box-shadow: -20px 0 50px rgba(0,0,0,0.12);
  padding: 18px; display: flex; flex-direction: column; gap: 12px;
}
.m-mobileTop {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 6px 10px; border-bottom: 1px solid var(--line-200);
}
.m-mobileTitle {
  font-family: var(--font-display); font-weight: 900; font-size: 1.1rem; color: var(--ink-900);
}
.m-mobileClose {
  width: 42px; height: 42px; border-radius: 14px;
  border: 1px solid var(--line-200); background: #fff; cursor: pointer;
}
html.m-lock, html.m-lock body { overflow: hidden; }

/* Mobile Links */
.m-mobileNav .m-mobileList { list-style: none !important; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.m-mobileNav .m-mobileList > li > a {
  font-family: var(--font-display); font-weight: 800; color: var(--ink-900);
  text-decoration: none; padding: 12px 12px; border-radius: 14px;
  background: var(--bg-soft); display: flex; align-items: center; justify-content: space-between;
}
.m-mobileNav .m-mobileList > li > a:hover { transform: translateY(-1px); background: #eef3f1; }
.m-mobileNav .current-menu-item > a { background: rgba(38,178,135,0.16); }

/* KILL ASTRA TOGGLES */
.m-mobileNav button, .m-mobileNav .ast-menu-toggle, .m-mobileNav .submenu-toggle { display: none !important; }
.m-mobileNav .menu-item-has-children > a::after { content: none !important; }
.m-mobileCta { margin-top: auto; padding-top: 10px; }

@media (max-width: 900px) {
  .m-menu--desktop { display: none; }
  .m-btn--cta { display: none; }
  .m-burger {
    display: inline-flex; width: 44px; height: 44px;
    border-radius: 14px; border: 1px solid var(--line-200);
    background: #fff; align-items: center; justify-content: center; cursor: pointer;
  }
}

/* =====================================================
   HERO & COMPONENTS
   ===================================================== */
.m-hero { position: relative; min-height: 90vh; display: flex; align-items: stretch; }
.m-heroMedia, .m-heroOverlay, .m-heroOverlayFx { position: absolute; inset: 0; z-index: 0; }
.m-heroMedia { background-size: cover; background-position: center; }
.m-heroOverlay, .m-heroOverlayFx {
  background: linear-gradient(90deg, rgba(15, 61, 46, 0.92) 0%, rgba(15, 61, 46, 0.6) 45%, rgba(15, 61, 46, 0.25) 100%);
}
.m-heroBg { background: linear-gradient(135deg, #0f3d2e 0%, #1a7f61 60%, #26b287 100%); }

.m-heroInner {
  position: relative; z-index: 2; display: grid; grid-template-columns: 1.2fr 0.8fr;
  gap: 40px; color: #fff; padding-top: 120px;
}
.m-heroInner .m-h1, .m-heroInner .m-p { color: #fff; }

.m-hero .m-container {
  position: relative;
  z-index: 2;
  padding-top: var(--header-gap);
  padding-bottom: 95px;
}

.m-hero .wp-block-buttons { display: flex !important; flex-wrap: wrap; margin-top: 33px; gap: 40px !important; }
.m-hero .m-card {
  padding: 25px; background: linear-gradient(160deg, #e8f7f1 0%, #cfeee4 100%) !important;
  border-radius: 22px; border: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 22px 46px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.7) !important;
}
.m-hero .m-card * { color: #0f3d2e !important; }

/* Pillar Overrides */
body.motus-pillar .m-hero .m-container {
  padding-top: var(--header-gap);
  padding-bottom: 90px;
}
body.motus-pillar .m-heroInner { gap: var(--m-space-xl); }
body.motus-pillar .m-hero .wp-block-buttons { margin-top: var(--m-space-lg); gap: var(--m-space-lg); }
body.motus-pillar .m-hero .m-badges { margin-top: var(--m-space-lg); gap: var(--m-space-sm); }
body.motus-pillar .m-hero .m-cardBody { padding: 22px; }

/* General Cards */
.m-card {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--line-200);
  overflow: hidden; transition: box-shadow .15s ease, transform .15s ease;
}
.m-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.m-cardBody { padding: 22px; }

.m-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.m-badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.m-badge { padding: 6px 12px; border-radius: 999px; background: var(--bg-soft); font-size: 0.75rem; font-weight: 700; }

.m-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.m-step {
  background: #fff; border-radius: var(--radius-lg); padding: 24px;
  border: 1px solid var(--line-200); transition: box-shadow .15s ease, transform .15s ease;
}
.m-stepNum {
  width: 42px; height: 42px; border-radius: 50%; background: var(--brand-700);
  color: #fff; display: grid; place-items: center; font-weight: 900; margin-bottom: 12px;
}

/* Pillar Specifics */
body.motus-pillar .m-grid3 { gap: var(--m-space-lg); margin-top: var(--m-space-md); }
body.motus-pillar .m-steps { gap: var(--m-space-lg); margin-top: var(--m-space-md); }
body.motus-pillar #prenota.m-section { padding-block: var(--m-space-2xl); }

/* ---------- FOOTER ---------- */
.m-footer { background: var(--bg-dark); color: rgba(255,255,255,0.85); padding: 80px 0 40px; }
.m-footerGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px; }
.m-footer a { color: rgba(255,255,255,0.82); text-decoration: none; transition: opacity .15s ease; }
.m-footer a:hover { opacity: .85; }
.m-disclaimer { font-size: 0.7rem; color: rgba(255,255,255,0.6); margin-top: 14px; }

/* ---------- FORMS (CF7) ---------- */
.m-formWrap { max-width: 860px; margin-top: 18px; }
.m-formCard {
  background: #fff; border: 1px solid var(--line-200); border-radius: 18px;
  padding: 22px; box-shadow: 0 14px 34px rgba(0,0,0,0.08);
}
.wpcf7 form { display: grid; gap: 14px; }
.wpcf7 label {
  font-family: var(--font-display); font-weight: 800; font-size: 0.85rem; color: var(--ink-900); margin-bottom: 6px;
}
.wpcf7 input:not([type="submit"]), .wpcf7 select, .wpcf7 textarea {
  width: 100%; border: 1px solid var(--line-200); border-radius: 14px; padding: 13px 14px;
  background: #fff; color: var(--ink-900); outline: none; transition: border-color .2s ease;
}
.wpcf7 input:focus, .wpcf7 select:focus, .wpcf7 textarea:focus {
  border-color: rgba(38,178,135,0.9); box-shadow: 0 0 0 4px rgba(38,178,135,0.18);
}
.wpcf7 input[type="submit"] {
  border-radius: 999px; padding: 16px 30px; font-family: var(--font-display); font-weight: 900;
  cursor: pointer; background: #f5c842; color: #0f3d2e; border: 1px solid #7adbb0;
  box-shadow: 0 10px 22px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform .2s ease;
}
.wpcf7 input[type="submit"]:hover {
  transform: translateY(-1px); box-shadow: 0 14px 32px rgba(0,0,0,0.24), inset 0 1px 0 rgba(255,255,255,0.45);
}

/* Disable Astra Scroll Top */
body.motus-pillar .ast-scroll-top, body.motus-pillar #ast-scroll-top, 
body.motus-home .ast-scroll-top, body.motus-home #ast-scroll-top { display:none !important; }

/* ---------- RESPONSIVE GLOBAL ---------- */
@media (max-width: 900px) {
  .m-heroInner {
    grid-template-columns: 1fr;
    gap: 55px;
    padding-top: 0;
  }

  body.motus-pillar .m-hero .m-container {
    padding-top: var(--header-gap);
    padding-bottom: 56px;
  }

  body.motus-pillar .m-heroInner {
    gap: var(--m-space-2xl);
  }
}

/* =====================================================
   COVER HERO
   Coerente con il pattern wp:cover
   ===================================================== */
.m-coverHero {
  position: relative;
  overflow: hidden;
  min-height: 90vh !important;
  display: flex;
  align-items: stretch;
}

.m-coverHero .wp-block-cover__background {
  z-index: 1;
}

.m-coverHero .wp-block-cover__image-background {
  object-fit: cover;
  object-position: 50% 35%;
}

.m-coverHero .wp-block-cover__inner-container {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0;
}

.m-coverHeroContent {
  width: 100%;
  padding-top: var(--header-gap);
  padding-bottom: 95px;
}

.m-coverHero .m-h1,
.m-coverHero .m-p,
.m-coverHero .m-kicker {
  color: #fff;
}

.m-coverHero .m-p {
  max-width: 60ch;
}

.m-coverHero .wp-block-buttons {
  display: flex !important;
  flex-wrap: wrap;
  gap: 20px !important;
  margin-top: 33px;
}

/* Fix bottone nel pattern cover */
.m-coverHero .wp-block-button,
.m-coverHero .wp-block-button.m-btn,
.m-coverHero .wp-block-button.m-btn-primary,
.m-coverHero .wp-block-button.m-btn-secondary {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

.m-coverHero .wp-block-button__link,
.m-coverHero a.m-btn {
  border-radius: 999px !important;
  padding: 16px 30px !important;
  font-family: var(--font-display);
  font-weight: 800;
  text-decoration: none !important;
  border: 1px solid transparent !important;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
}

.m-coverHero .wp-block-button.m-btn-primary .wp-block-button__link,
.m-coverHero a.m-btn-primary {
  background: #f5c842 !important;
  color: #0f3d2e !important;
  border-color: #7adbb0 !important;
  box-shadow: 0 10px 22px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.45) !important;
}

.m-coverHero .wp-block-button.m-btn-primary .wp-block-button__link:hover,
.m-coverHero a.m-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.55) !important;
}

/* Cover hero - title only */
.m-coverHero--titleOnly .wp-block-cover__inner-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: inherit;
}

.m-coverHero--titleOnly .m-coverHeroContent {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: inherit;
}

.m-coverHero--titleOnly .m-coverHeroTitle {
  margin: 0;
  max-width: 12ch;
  color: #fff;
  text-align: center;
}

/* Tablet */
@media (max-width: 900px) {
  .m-coverHero {
    min-height: 72vh !important;
  }

  .m-coverHero .wp-block-cover__image-background {
    object-position: 50% 30%;
  }

  .m-coverHeroContent {
    padding-top: var(--header-gap);
    padding-bottom: 56px;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .m-coverHero,
  .m-coverHero--titleOnly {
    min-height: 100svh !important;
    height: 100svh;
    align-items: center;
  }

  .m-coverHero .wp-block-cover__image-background,
  .m-coverHero--titleOnly .wp-block-cover__image-background {
    object-fit: cover !important;
    object-position: center center !important;
    width: 100%;
    height: 100%;
  }

  .m-coverHero .wp-block-cover__background,
  .m-coverHero--titleOnly .wp-block-cover__background {
    background-color: rgba(0, 0, 0, 0.28) !important;
  }

  .m-coverHero .wp-block-cover__inner-container,
  .m-coverHero--titleOnly .wp-block-cover__inner-container {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .m-coverHeroContent {
    padding-top: 30px !important;
    padding-bottom: 30px !important;
  }

  .m-coverHero .m-h1,
  .m-coverHero--titleOnly .m-coverHeroTitle {
    font-size: clamp(2rem, 8vw, 3rem);
    line-height: 1.05;
  }

  .m-coverHero .m-p {
    font-size: 1rem;
    line-height: 1.5;
  }

  .m-coverHero .wp-block-buttons {
    gap: 14px !important;
    margin-top: 24px;
    flex-direction: column;
    align-items: stretch;
  }

  .m-coverHero .wp-block-button__link,
  .m-coverHero a.m-btn {
    width: 100%;
  }
}

/* Hide breadcrumbs globally */
.ast-breadcrumbs-wrapper,
.ast-breadcrumbs,
.breadcrumb,
.breadcrumbs,
.rank-math-breadcrumb,
.yoast-breadcrumbs {
  display: none !important;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #0f172a;
  color: #ffffff;
  z-index: 9999;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.12);
}

.cookie-banner__content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.cookie-banner__content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.cookie-banner__content a {
  color: #ffffff;
  text-decoration: underline;
}

.cookie-banner__button {
  flex-shrink: 0;
  background: #ffffff;
  color: #0f172a;
  border: 0;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}

.cookie-banner__button:hover {
  opacity: 0.92;
}

.cookie-banner.is-hidden {
  display: none;
}

@media (max-width: 767px) {
  .cookie-banner__content {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 14px;
  }

  .cookie-banner__button {
    width: 100%;
    text-align: center;
  }
}

/* =====================================================
   MOTUS SEARCH FORM
   ===================================================== */

.motus-search-form {
  width: 100%;
  max-width: 760px;
  margin: 28px 0 40px;
}

.motus-search-form__inner {
  display: flex;
  align-items: stretch;
  width: 100%;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d7dde5;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.motus-search-form__inner:focus-within {
  border-color: #0f172a;
  box-shadow:
    0 0 0 3px rgba(15, 23, 42, 0.12),
    0 8px 24px rgba(15, 23, 42, 0.08);
}

.motus-search-form__field {
  flex: 1 1 auto;
  min-width: 0;
  height: 54px;
  margin: 0;
  padding: 0 18px;
  background: transparent;
  color: #0f172a;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  outline: none;
}

.motus-search-form__field::placeholder {
  color: #64748b;
  opacity: 1;
}

.motus-search-form__field::-webkit-search-cancel-button {
  cursor: pointer;
}

.motus-search-form__submit {
  flex: 0 0 auto;
  min-width: 112px;
  margin: 0;
  padding: 0 24px;
  background: #0f172a;
  color: #ffffff;
  border: 0;
  border-radius: 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.motus-search-form__submit:hover,
.motus-search-form__submit:focus-visible {
  background: #1e293b;
  color: #ffffff;
}

.motus-search-form__submit:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: -5px;
}

@media (max-width: 600px) {
  .motus-search-form {
    margin: 22px 0 32px;
  }

  .motus-search-form__inner {
    flex-direction: column;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    gap: 10px;
  }

  .motus-search-form__inner:focus-within {
    border-color: transparent;
    box-shadow: none;
  }

  .motus-search-form__field {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    background: #ffffff;
    border: 1px solid #d7dde5 !important;
    border-radius: 8px;
  }

  .motus-search-form__field:focus {
    border-color: #0f172a !important;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12) !important;
  }

  .motus-search-form__submit {
    width: 100%;
    min-height: 50px;
    border-radius: 8px;
  }
}

/* =====================================================
   MOTUS HEADER SEARCH
   Pulsante lente e pannello modale
   ===================================================== */

/* Pulsante nell'header */
.m-searchToggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  background: transparent;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.22);
  border-radius: 50%;
  box-shadow: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.m-searchToggle:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  transform: translateY(-1px);
}

.m-searchToggle:focus-visible {
  outline: 3px solid rgba(245, 200, 66, 0.75);
  outline-offset: 3px;
}

.m-searchToggleIcon {
  display: block;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

/* Pagine con header sovrapposto alla cover */
.m-header--overlay .m-searchToggle,
.motus-home .m-searchToggle {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.65);
}

.m-header--overlay .m-searchToggle:hover,
.motus-home .m-searchToggle:hover {
  background: #f5c842;
  color: #0f3d2e;
  border-color: #f5c842;
}

/* L'attributo hidden deve prevalere su qualsiasi altra regola */
.m-searchPanel[hidden] {
  display: none !important;
}

/* Pannello modale */
.m-searchPanel {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 110px 24px 40px;
}

.m-searchPanelBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  cursor: pointer;
}

.m-searchPanelContent {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  padding: 30px;
  background: #ffffff;
  color: #0f172a;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.m-searchPanelTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.m-searchPanelTitle {
  margin: 0;
  color: #0f172a;
  font-family: inherit;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
}

.m-searchPanelClose {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  background: #f1f5f9;
  color: #0f172a;
  border: 0;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.m-searchPanelClose:hover {
  background: #0f172a;
  color: #ffffff;
}

.m-searchPanelClose:focus-visible {
  outline: 3px solid rgba(245, 200, 66, 0.75);
  outline-offset: 3px;
}

/* Il modulo dentro il pannello non deve ereditare margini esterni */
.m-searchPanel .motus-search-form {
  max-width: none;
  margin: 0;
}

/* Impedisce lo scorrimento quando il pannello sarà aperto */
body.m-search-is-open {
  overflow: hidden;
}

@media (max-width: 767px) {
  .m-searchToggle {
    width: 42px;
    height: 42px;
  }

  .m-searchPanel {
    align-items: flex-start;
    padding: 76px 16px 24px;
  }

  .m-searchPanelContent {
    padding: 22px 18px;
    border-radius: 12px;
  }

  .m-searchPanelTop {
    margin-bottom: 18px;
  }
}