/* Local Font: Epilogue */
@font-face {
  font-family: "Epilogue";
  src: url("../fonts/Epilogue-ExtraLight.woff") format("woff");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Epilogue";
  src: url("../fonts/Epilogue-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Epilogue";
  src: url("../fonts/Epilogue-Italic.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Epilogue";
  src: url("../fonts/Epilogue-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Epilogue";
  src: url("../fonts/Epilogue-Black.woff") format("woff");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ========================= 1) CSS Variables ========================= */
:root{
  --color-bg: #f5f5f5;          /* background principale */
  --color-text: #111827;        /* colore testo principale */
  --color-muted: #6b7280;       /* colore secondario */
  --color-border: #e6e9ee;      /* colore per bordi sottili */
  --color-primary: #2050f2;     /* colore primario / CTA */
  --max-width: 1200px;            /* larghezza massima del container */
  --site-gutter: 1rem;            /* padding laterale del container */
  --base-font-size: 16px;         /* font-size di base */
  --base-line-height: 1.5;        /* line-height base */
  --space-xxs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --radius: 8px;                  /* border-radius globale */
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.05);
  --shadow-md: 0 4px 12px rgba(16,24,40,0.08);
}

/* ===================== 2) Reset / normalizzazione minima ===================== */
*, *::before, *::after { box-sizing: border-box; }

html, body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--base-font-size);
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: "Epilogue", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: var(--base-line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover, a:focus { text-decoration: underline; }

ul, ol { list-style: none; padding: 0; }

h1 { font-size: 2rem; margin-bottom: var(--space-sm); }
h2 { font-size: 1.5rem; margin-bottom: var(--space-sm); }
h3 { font-size: 1.25rem; margin-bottom: var(--space-xs); }

/* ========================= 3) Utilities per accessibilità ========================= */
.sr-only {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

:focus {
  outline: 3px solid rgba(11,95,255,0.18);
  outline-offset: 2px;
}

/* ========================= 4) Container / layout principale ========================= */
.container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--site-gutter);
  padding-right: var(--site-gutter);
  max-width: var(--max-width);
}

.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }

/* ======================= 5) Grid responsive (lista/archivi) ======================= */
.grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

/* ======================= 6) Header e navigazione (mobile-first) ======================= */
.site-header, .header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  transition: box-shadow 180ms ease, background-color 180ms ease;
  z-index: 100;
  position: relative;
}

.site-header.is-sticky, .header.is-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: var(--shadow-md);
}

.site-branding {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
}
.site-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  text-decoration: none;
}
.site-description {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: transparent;
  border: none;
  font: inherit;
  padding: var(--space-xs);
  cursor: pointer;
}
.menu-toggle:focus {
  box-shadow: var(--shadow-sm);
  outline: none;
}

#primary-menu {
  display: none;
  flex-direction: column;
  gap: var(--space-xs);
}
#primary-menu a {
  display: inline-block;
  padding: var(--space-xs) 0;
  color: var(--color-text);
  text-decoration: none;
}

#primary-menu.is-open {
  display: flex;
}

@media (min-width: 800px) {
  .menu-toggle { display: none; }
  #primary-menu { display: flex !important; flex-direction: row; gap: 1rem; align-items: center; }
  .header-cta { margin-left: 1rem; }
}

.header-cta { display: none; }
@media (min-width: 800px) {
  .header-cta { display: block; }
}

/* =========================== Sticky header additions =========================== */
.site-header,
.header {
  transition: transform 320ms cubic-bezier(.2,.8,.2,1), background-color 220ms ease, box-shadow 220ms ease;
  will-change: transform, background-color;
  z-index: 9999;
}

.site-header.at-top,
.header.at-top {
  background: transparent;
  box-shadow: none;
  transform: translateY(0);
}

.site-header.is-sticky,
.header.is-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.98);
  backdrop-filter: saturate(110%) blur(6px);
  box-shadow: 0 8px 28px rgba(16,24,40,0.08);
  transform: translateY(0);
}

.site-header.hidden,
.header.hidden {
  transform: translateY(-110%);
}

.site-header.visible,
.header.visible {
  transform: translateY(0);
}

@media (hover: none), (pointer: coarse) {
  .site-header,
  .header {
    transition: none;
  }
  .site-header.hidden,
  .header.hidden {
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .header {
    transition: none !important;
  }
}

/* ========================= 7) Card e contenuto post ========================= */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}
.entry-title { margin-bottom: var(--space-xs); font-size: 1.125rem; }
.entry-meta { color: var(--color-muted); font-size: 0.875rem; margin-bottom: var(--space-sm); }

.entry-content { color: var(--color-text); margin-bottom: var(--space-md); }

/* ============================== 8) Buttons ============================== */
.button {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 0.875rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.button:hover, .button:focus { filter: brightness(0.95); }

.button--ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

/* ============================== 9) Forms (basic) ============================== */
input[type="text"], input[type="email"], textarea, select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font: inherit;
  color: var(--color-text);
  background: #fff;
}
label { display: block; margin-bottom: var(--space-xs); color: var(--color-text); font-weight: 600; }

/* ============================== 10) Footer ============================== */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-muted);
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
}

.footer-widgets {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
  margin-bottom: var(--space-md);
}
@media (min-width: 680px) {
  .footer-widgets {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-col { padding: 0.25rem 0; }
.widget-title { font-size: 1rem; margin-bottom: var(--space-xs); color: var(--color-text); }

.footer-bottom {
  border-top: 1px solid rgba(0,0,0,0.03);
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}
.footer-bottom-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: var(--space-md);
}

@media (max-width: 679px) {
  .footer-bottom-row { flex-direction: column; align-items: flex-start; }
}

.footer-menu, .footer-bottom-menu { list-style:none; margin:0; padding:0; display:flex; gap:1rem; }
.footer-menu a, .footer-bottom-menu a { color: var(--color-text); text-decoration:none; }

.back-to-top {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:50%;
  background:var(--color-primary);
  color:#fff;
  border:none;
  cursor:pointer;
  font-weight:700;
  font-size:1rem;
}
.back-to-top[hidden] { display:none; }

.site-footer a { color: var(--color-primary); }

/* ============================ 11) Front-Page / Hero ============================ */

:root {
  --hero-height-desktop: 720px; /* altezza desktop */
  --hero-height-tablet: 560px;  /* altezza tablet */
  --hero-height-mobile: 420px;  /* altezza mobile */
  --hero-overlay-default: rgba(23, 80, 177, 0.607);
}

/* full-bleed container */
.hero {
  position: relative;
  width: 100vw;
  left: 50%;
  margin-left: -50vw;
  box-sizing: border-box;

  /* fallback background-color se non è presente background-image inline */
  background-color: rgba(0,0,0,0.03);

  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  background-attachment: scroll;

  height: var(--hero-height-desktop);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/*
  MODIFICA NECESSARIA:
  - ripristino overlay via CSS variable --hero-overlay
  - compatibile sia con home hero (inline style: --hero-overlay) sia con news-hero (inline style: --hero-overlay)
*/
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;

  /* overlay controllabile: se non viene settato inline, usa default */
  background: var(--hero-overlay, var(--hero-overlay-default)) !important;
}

/* Contenuto interno sopra l'overlay */
.hero-inner,
.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  padding: 40px 20px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-content,
.hero__content {
  text-align: center;
  max-width: 720px;
  color: #fff; /* testo su overlay */
}

/* ---------- HOME: layout prototipo (left aligned) ---------- */
.hero:not(.news-hero) .hero__inner {
  justify-content: flex-start;
}
.hero:not(.news-hero) .hero__content {
  text-align: left;
  max-width: 720px;
}

/* Eyebrow “pill” */
.hero:not(.news-hero) .hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.hero:not(.news-hero) .hero__eyebrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  opacity: 0.95;
}
.hero:not(.news-hero) .hero__eyebrow {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
}

/* Title + highlight word */
.hero:not(.news-hero) .hero__title {
  font-size: clamp(2.05rem, 4.2vw, 3.25rem);
  margin-bottom: 14px;
  color: #ffffff;
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 12px 36px rgba(0,0,0,0.35);
}
.hero__title-highlight {
  color: #527cca; /* evidenzia (blu) */
}

/* Lead */
.hero:not(.news-hero) .hero__lead {
  margin-bottom: 18px;
  color: rgba(255,255,255,0.94);
  font-size: 1.06rem;
  max-width: 720px;
  text-shadow: 0 8px 22px rgba(0,0,0,0.25);
}

/* layout container CTA */
.hero__actions,
.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center; /* centrale per default */
  margin-top: 22px;
  z-index: 2; /* sopra overlay */
}

/* HOME: CTA allineate a sinistra */
.hero:not(.news-hero) .hero__actions {
  justify-content: flex-start;
}

.hero__actions .btn,
.hero__actions a.button,
.hero__actions .button,
.hero-actions .btn,
.hero-actions a.button,
.hero-actions .button {
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1;
  padding: 10px 18px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
  border: none;
}

/* Primary (bianco con testo blu e ombra) */
.hero__actions .btn.btn-primary,
.hero__actions a.button.btn-primary,
.hero-actions .btn.btn-primary {
  background: #ffffff;
  color: #0b5fff;
  box-shadow: 0 6px 20px rgba(11,95,255,0.12);
  font-weight: 600;
  border: none;
}

/* Freccia postfix */
.hero__actions .btn.btn-primary::after,
.hero-actions .btn.btn-primary::after {
  content: "➜";
  margin-left: 6px;
  font-size: 1rem;
  opacity: 0.95;
}

/* Secondary / ghost */
.hero__actions .btn.btn-ghost,
.hero__actions a.button.btn-ghost,
.hero-actions .btn.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(4px); /* opzionale */
}

/* Hover states */
.hero__actions .btn.btn-primary:hover,
.hero-actions .btn.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(11,95,255,0.16);
}
.hero__actions .btn.btn-ghost:hover,
.hero-actions .btn.btn-ghost:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

/* ---------- HOME: KPI row (prototipo) ---------- */
.hero__kpis {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 760px;
}
.hero:not(.news-hero) .hero__kpis {
  justify-content: flex-start;
}
.hero__kpi {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(6px);
}
.hero__kpi-value {
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.0;
  color: #ffffff;
  margin-bottom: 6px;
}
.hero__kpi-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255,255,255,0.90);
}

/* ---------- INTERNAL (news-hero): più pulito, sempre centrato ---------- */
.hero.news-hero .hero__content,
.news-hero .hero__content {
  text-align: center;
}
.hero.news-hero .hero__actions {
  justify-content: center;
}

/* Back link per prototipo interno */
.hero__back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.92);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  margin-bottom: 14px;
}
.hero__back-link:hover,
.hero__back-link:focus {
  text-decoration: underline;
}

/* header sopra l'hero */
.site-header,
.header {
  z-index: 9999;
}

/* Media responsive */
@media (max-width: 1024px) {
  .hero { height: var(--hero-height-tablet); }
  .hero-title, .hero__title { font-size: 1.6rem; }
  .hero-subtitle, .hero__lead { font-size: 1rem; }
}

@media (max-width: 799px) {
  .hero { height: var(--hero-height-mobile); }
  .hero-title, .hero__title { font-size: 1.35rem; }
  .hero-subtitle, .hero__lead { font-size: 0.95rem; }
  .hero-inner, .hero__inner { padding: 20px; }
  .hero__actions { flex-direction: column; gap: 12px; }
  .hero__actions .btn { width: auto; padding: 10px 16px; }

  /* KPI mobile */
  .hero__kpis { grid-template-columns: 1fr; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero { background-attachment: scroll; }
}

body.admin-bar .site-header.is-sticky,
body.admin-bar .header.is-sticky {
  top: var(--wp-adminbar-height, 32px);
}

/* Featured grid / hero grid etc */
.featured-grid { padding: var(--space-lg) 0; }
.featured-grid .section-header { margin-bottom: var(--space-md); }
.featured-grid .section-title { font-size: 1.25rem; margin: 0; color: var(--color-text); }
.featured-grid .grid { gap: var(--space-md); }
.featured-grid .card {
  padding: var(--space-md);
}
.featured-grid .card__thumb-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: calc(var(--radius) - 2px);
  display: block;
  margin-bottom: var(--space-sm);
}

/* CTA area */
.front-cta { background: linear-gradient(180deg, rgba(11,95,255,0.05), transparent); padding: var(--space-lg) 0; margin-top: var(--space-lg); }
.cta-inner { display:flex; align-items:center; justify-content:space-between; gap:var(--space-md); }
.cta-title { font-size: 1.25rem; margin:0; }
.cta-sub { margin: 0; color: var(--color-muted); }

/* Mobile */
@media (max-width: 680px) {
  .hero-content { text-align:center; } /* retrocompatibilità */
  .cta-inner { flex-direction: column; align-items: stretch; text-align:center; }
  .featured-grid .card__thumb-img { height: 140px; }
}

@media (max-width: 480px) {
  .card__title { font-size: 1rem; }
  .card { padding: var(--space-sm); }
}

.site-header.at-top,
.header.at-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  box-shadow: none;
  z-index: 9999;
  pointer-events: auto;
}

body.admin-bar .site-header.at-top,
body.admin-bar .header.at-top {
  top: var(--wp-adminbar-height, 32px);
}

/* =========================== 12) Fix spacing header sticky =========================== */

.site-header .site-header__inner,
.header .site-header__inner {
  padding-top: 22px;
  padding-bottom: 22px;
  display: flex;
  align-items: center; 
  gap: var(--space-md, 1rem);
  box-sizing: border-box;
  transition: padding 200ms ease, height 200ms ease;
}

.site-header.is-sticky .site-header__inner,
.header.is-sticky .site-header__inner {
  padding-top: 14px;
  padding-bottom: 14px;
  align-items: center;
  min-height: 56px;       
  height: auto;
}

body.admin-bar .site-header.is-sticky,
body.admin-bar .header.is-sticky {
  top: var(--wp-adminbar-height, 32px);
}

/* Mobile */
@media (max-width: 800px) {
  .site-header .site-header__inner,
  .header .site-header__inner {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .site-header.is-sticky .site-header__inner,
  .header.is-sticky .site-header__inner {
    padding-top: 10px;
    padding-bottom: 10px;
    min-height: 48px;
  }
}

/* ================================ 13) Logo menu ================================ */
.site-branding {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.site-branding .custom-logo-link,
.site-branding .site-logo {
  display: inline-block;
  width: 160px;     /* LARGHEZZA DESKTOP */
  height: 48px;     /* ALTEZZA DESKTOP */
  line-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.site-branding .custom-logo-link img,
.site-branding .site-logo img,
.site-branding img.custom-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

/* logo leggermente più piccolo quando sticky */
.site-header.is-sticky .site-branding .custom-logo-link,
.site-header.is-sticky .site-branding .site-logo {
  width: 140px;
  height: 40px;
}

/* Mobile */
@media (max-width: 799px) {
  .site-branding .custom-logo-link,
  .site-branding .site-logo {
    width: 130px;
    height: 40px;
  }
  .site-header.is-sticky .site-branding .custom-logo-link,
  .site-header.is-sticky .site-branding .site-logo {
    width: 110px;
    height: 34px;
  }
}

/* =============================== 14) Mega-menu =============================== */
#site-navigation .primary-menu > .menu-item.mega > .sub-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 640px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(16,24,40,0.08);
  padding: 18px 22px;
  z-index: 999;
  display: flex;
  gap: 36px;
  align-items: flex-start;
  transform-origin: top center;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 240ms ease, transform 260ms cubic-bezier(.2,.8,.2,1);
}

#site-navigation .primary-menu > .menu-item.mega.open > .sub-menu {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

#site-navigation .primary-menu > .menu-item.mega > .sub-menu > .menu-item {
  width: 50%;
  margin: 0;
  padding: 0 8px;
  list-style: none;
}

/* column title (Privati / Aziende) */
#site-navigation .primary-menu > .menu-item.mega > .sub-menu > .menu-item > a {
  display: block;
  font-weight: 600;
  color: #1f4aa5;
  padding: 6px 0 10px 0;
}

/* small gray subgroup headings */
#site-navigation .primary-menu .menu-subheading > a {
  color: #6b7280;
  font-weight: 500;
  cursor: default;
  pointer-events: none;
  padding: 6px 0;
}

#site-navigation .primary-menu .menu-item .sub-menu li a,
#site-navigation .primary-menu .menu-item > .sub-menu > li > a {
  color: #0f172a;
  padding: 6px 0;
  display: block;
  text-decoration: none;
}

/* visual separation between two columns (subtle) */
#site-navigation .primary-menu > .menu-item.mega > .sub-menu > .menu-item + .menu-item {
  padding-left: 28px;
  border-left: 1px solid rgba(15,23,42,0.03);
}

#site-navigation .primary-menu > .menu-item.mega > a {
  position: relative;
  border-radius: 10px;
  padding: 8px 12px;
  display: inline-block;
}

/* small rectangle/background when the mega is open */
#site-navigation .primary-menu > .menu-item.mega.open > a {
  background: #f1f5f9;
  box-shadow: 0 6px 18px rgba(11,95,255,0.06);
}

#site-navigation .primary-menu > .menu-item.mega > a::after {
  content: "▾";
  font-size: 0.65rem;
  margin-left: 8px;
  opacity: 0.9;
  vertical-align: middle;
}
#site-navigation .primary-menu > .menu-item.mega.open > a::after {
  transform: rotate(180deg);
}

@media (max-width: 799px) {
  #site-navigation .primary-menu > .menu-item.mega > .sub-menu {
    position: static;
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    min-width: auto;
    box-shadow: none;
    opacity: 1;
    transform: none;
  }
  #site-navigation .primary-menu > .menu-item.mega.open > .sub-menu {
    display: block;
  }
  #site-navigation .primary-menu > .menu-item.mega > .sub-menu > .menu-item {
    width: 100%;
    border-left: none;
    padding-left: 0;
  }
}

#site-navigation,
.main-navigation {
  position: relative;
}

#site-navigation .primary-menu > .menu-item.mega > .sub-menu {
  left: 50% !important;
  transform: translateX(-50%) translateY(-6px) !important;
}
#site-navigation .primary-menu > .menu-item.mega.open > .sub-menu {
  transform: translateX(-50%) translateY(0) !important;
  opacity: 1 !important;
}

/* =============================== 15) Cursore =============================== */
#site-navigation .primary-menu > .menu-item > a,
#site-navigation .primary-menu > .menu-item.mega > a,
#site-navigation .primary-menu > .menu-item > a::after {
  cursor: pointer;                
  user-select: none;              
  -webkit-user-select: none;
  -moz-user-select: none;
}

#site-navigation .primary-menu > .menu-item > a::after {
  pointer-events: none;
}

.menu-toggle,
.header-cta .button,
.header-cta a {
  cursor: pointer;
}

/* ========================== 16) Fix linea taglio Hero ========================== */
.site-header.at-top,
.header.at-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
  z-index: 9999;
}

.site-header.at-top .container,
.header.at-top .container,
.site-header.at-top .header-row,
.header-at-top .header-row,
.topbar {
  border-bottom: none !important;
  box-shadow: none !important;
}

/* ================= 17) Single post minimal tweaks for spacing and meta =================== */
.single-post-wrapper {
  padding-top: 32px;
  padding-bottom: 56px;
}

.single-back .button--ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid rgba(15,23,42,0.06);
  padding: 8px 12px;
  border-radius: 8px;
  display: inline-block;
}

.single-categories .post-category {
  font-size: 0.95rem;
  line-height: 1;
  display: inline-block;
}

/* Entry meta spacing */
.entry-meta { margin-top: 6px; margin-bottom: 8px; color: var(--color-muted); }

/* ---------------------- ARTICLE / CONTENT ADJUSTMENTS (TARGETED) ---------------------- */

.post-content-wrapper {
  max-width: 920px;
  margin: 0 auto;               /* center the article body */
  padding-left: 20px;           /* breathing space to match title area */
  padding-right: 20px;
  box-sizing: border-box;
}

/* Make the entry header (title + meta) share the same max width and centering */
.single .entry-header {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Limit the inner title width to visually align with content */
.single .entry-header .entry-title {
  max-width: 880px;
  margin: 0 auto;
}

/* Ensure article element itself doesn't force extra width */
.post-single.entry-content {
  width: 100%;
  box-sizing: border-box;
}

/* Restore paragraph spacing inside editor content (wpautop) */
.entry-content p,
.post-content p,
.page-content p {
  margin: 0 0 1.25rem;
  line-height: 1.6;
}

/* Enable bullets only inside post content so global lists elsewhere remain controlled */
.entry-content ul,
.post-content ul,
.page-content ul,
.wp-block ul {
  list-style-type: disc;
  list-style-position: outside;
  margin: 0 0 1.25rem 1.5rem;
  padding-left: 0;
}

/* Ensure list markers are visible (some themes hide them) */
.entry-content li::marker,
.post-content li::marker,
.page-content li::marker {
  color: inherit;
  font-size: 1em;
}

/* ================= 18) Single post boxed article styles ================= */

/* Box that contains meta, title and article content on single post pages.
   Uses existing variables so it matches site look & feel. */
.post-article-box {
  background: #ffffff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(16,24,40,0.06);
  margin-left: auto;
  margin-right: auto;
  max-width: 920px; /* matches post-content-wrapper */
  box-sizing: border-box;
}

/* Slightly reduce top/bottom margin for hero proximity */
.single-post-wrapper .post-article-box {
  margin-top: 20px;
  margin-bottom: 24px;
}

/* Ensure the inner title/meta/content keep the same horizontal padding/alignment */
.post-article-box .post-content-wrapper {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
  box-sizing: border-box;
}

/* Keep the back button visually consistent inside the box */
.post-article-box .single-back .button--ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid rgba(15,23,42,0.06);
  padding: 8px 12px;
  border-radius: 8px;
  display: inline-block;
}

/* If the theme previously used .card for other modules, keep the visual parity */
.post-article-box.card {
  border: 1px solid rgba(16,24,40,0.03);
}

/* ------------------ Images & figures (desktop & mobile unified rules) ------------------ */

/* Default: center images inside the article, keep consistent vertical rhythm */
.post-article-box .entry-content img,
.post-article-box .entry-content figure,
.post-article-box .entry-content .wp-block-image img {
  display: block;
  margin: 24px auto;
  max-width: 100%;
  height: auto;
  box-sizing: border-box;
}

/* Figure wrappers: center captions and remove extra side spacing */
.post-article-box .entry-content figure,
.post-article-box .entry-content .wp-block-image {
  margin: 24px auto;
  text-align: center;
}

/* Captions */
.post-article-box .entry-content figcaption {
  display: block;
  margin-top: 8px;
  color: var(--color-muted);
  font-size: 0.95rem;
  text-align: center;
}

/* Full-width / wide images (Gutenberg): remove lateral constraints and maintain vertical gap */
.post-article-box .entry-content figure.alignfull,
.post-article-box .entry-content .alignfull,
.post-article-box .entry-content figure.alignwide,
.post-article-box .entry-content .alignwide {
  width: 100% !important;
  margin: 28px 0 !important;
  max-width: none !important;
}

/* Floats: keep them on desktop for inline flow, but ensure consistent margins */
.post-article-box .entry-content .alignleft,
.post-article-box .entry-content img.alignleft {
  float: left;
  margin: 0 20px 20px 0;
  max-width: 48%;
}
.post-article-box .entry-content .alignright,
.post-article-box .entry-content img.alignright {
  float: right;
  margin: 0 0 20px 20px;
  max-width: 48%;
}

/* ========= Mobile adjustments: force wider box and better fit ========= */

/* Use an aggressive full-viewport technique so the boxed article visually spans most of the screen */
@media (max-width: 760px) {

  /* Make the article box edge-near full-width of the viewport */
  .single-post-wrapper .post-article-box {
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;

    /* inner paddings provide small gutters inside the full-width box */
    padding-left: 18px !important;
    padding-right: 18px !important;
    padding-top: 14px !important;
    padding-bottom: 16px !important;

    /* slightly smaller radius for mobile */
    border-radius: 8px !important;
  }

  /* Ensure inner wrappers don't add extra horizontal padding */
  .single-post-wrapper .post-article-box .post-content-wrapper,
  .single-post-wrapper .post-article-box .entry-header {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Slightly reduce base font-size within the article box to improve fit on small screens */
  .post-article-box .entry-content,
  .post-article-box .post-content-wrapper {
    font-size: 0.98rem;
    line-height: 1.45;
  }

  /* Headings inside the box: scale down a bit */
  .post-article-box .entry-title { font-size: 1.6rem; line-height: 1.08; }
  .post-article-box h2 { font-size: 1.15rem; }
  .post-article-box h3 { font-size: 1.03rem; }

  /* Images: centered, wider, full width of the box and maintain vertical rhythm */
  .post-article-box .entry-content img,
  .post-article-box .entry-content figure,
  .post-article-box .entry-content .wp-block-image img {
    display: block;
    margin: 16px auto;
    width: calc(100% - 0px) !important;
    max-width: 100% !important;
    height: auto;
    box-sizing: border-box;
  }

  .post-article-box .entry-content figure,
  .post-article-box .entry-content .wp-block-image {
    margin: 16px auto;
    text-align: center;
  }

  .post-article-box .entry-content figcaption {
    margin-top: 6px;
    color: var(--color-muted);
    font-size: 0.9rem;
    text-align: center;
  }

  /* Disable floats on small screens to avoid super-narrow columns */
  .post-article-box .entry-content .alignleft,
  .post-article-box .entry-content img.alignleft,
  .post-article-box .entry-content .alignright,
  .post-article-box .entry-content img.alignright {
    float: none !important;
    display: block !important;
    margin: 0 0 12px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Tighten paragraph spacing slightly on mobile */
  .post-article-box .entry-content p,
  .post-article-box .entry-content ul,
  .post-article-box .entry-content ol {
    margin-bottom: 1rem;
  }
}

/* ---------------------- RELATED / PREVIEWS (centered + 3 columns on desktop) ---------------------- */

/*
  This stylesheet controls the "Altre news" / related previews.
  I updated the mobile rules so the related previews become wider (less narrow column)
  and better match the full-width feeling of the article box on small screens.
*/

/* Center the related news container and match article max-width on desktop */
.related-news .container {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

/* Related grid base, then breakpoints */
.related-news .grid,
.related-news .related-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(1, 1fr);
}

/* Desktop / tablet columns */
@media (min-width:760px) {
  .related-news .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width:1100px) {
  .related-news .related-grid { grid-template-columns: repeat(3, 1fr); } /* 3 columns desktop */
}

/* Cards inside related grid: more breathing room and consistent visuals */
.related-news .related-grid .card,
.related-news .related-grid .news-card-grid,
.related-news .related-grid .post-card,
.related-news .related-grid .news-card {
  padding: 0;
  box-sizing: border-box;
  max-width: none;
  background: #fff;
  box-shadow: 0 8px 30px rgba(16,24,40,0.06);
  border-radius: 12px;
  overflow: hidden;
}

/* ---- Wider related previews on small screens ----
   The problem previously was that these cards appeared narrow on mobile because
   the .container kept large side gutters. We now use a mobile override that
   expands the .related-news container to span most of the viewport while keeping
   small internal padding (gutters).
*/
@media (max-width: 760px) {

  /* Make the related block visually wider - fill viewport while keeping small inner gutters */
  .related-news {
    /* ensure stacking context and no accidental overflow */
    position: relative;
    width: 100%;
    box-sizing: border-box;
  }

  .related-news .container {
    /* full-viewport technique similar to .post-article-box so it escapes parent's container gutters */
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    width: 100vw !important;
    max-width: 100vw !important;
    padding-left: 14px !important;   /* small inner gutters */
    padding-right: 14px !important;
    box-sizing: border-box !important;
  }

  /* Make the related grid single column but let cards take more horizontal space */
  .related-news .related-grid,
  .related-news .grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Reduce card padding slightly so content is more visible (wider visual area) */
  .related-news .related-grid .card,
  .related-news .related-grid .news-card-grid,
  .related-news .related-grid .post-card,
  .related-news .related-grid .news-card {
    padding: 0 !important;
    border-radius: 10px !important;
  }

  /* Make thumbnails inside cards use the available width and be more prominent */
  .related-news .related-grid .card img,
  .related-news .related-grid .news-card-grid img,
  .related-news .related-grid .post-card img {
    width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 0 12px 0;
    object-fit: cover;
  }

  /* Badge/category inside card: keep it inline and avoid extra wrapping */
  .related-news .related-grid .news-label--small {
    display: inline-block;
    max-width: calc(100% - 40px);
  }

  /* Card title: make it slightly larger and use normal weight so it reads cleanly */
  .related-news .related-grid .card__title,
  .related-news .related-grid .news-card__title {
    font-size: 1.05rem !important;
    line-height: 1.18 !important;
    margin-bottom: 10px !important;
  }

  /* Excerpt: allow more lines and slightly bigger leading */
  .related-news .related-grid .card__excerpt,
  .related-news .related-grid .news-card__excerpt {
    margin-bottom: 10px !important;
    color: var(--color-muted);
    line-height: 1.5;
  }
}

/* Tighter mobile adjustments applied earlier kept for compatibility */
@media (max-width: 900px) {
  .post-content-wrapper, .single .entry-header {
    padding-left: 16px;
    padding-right: 16px;
  }
  .related-news .related-grid { grid-template-columns: repeat(1, 1fr); }
  .post-content-wrapper { max-width: 100%; }
}

/* Related grid: override .grid to keep consistent gap */
.related-news .grid { gap: 28px; grid-template-columns: repeat(1,1fr); }
@media (min-width:760px) {
  .related-news .grid { grid-template-columns: repeat(2,1fr); }
}
@media (min-width:1100px) {
  .related-news .grid { grid-template-columns: repeat(4,1fr); }
}

/* Fix: impedisce che i sub-menu invisibili intercettino click */

#site-navigation .primary-menu > .menu-item.mega > .sub-menu {
  /* default: non interagibile e nascosto per accessibilità */
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 240ms ease, transform 260ms cubic-bezier(.2,.8,.2,1), visibility 240ms;
}

/* Quando il mega menu è aperto (classe .open già usata nel tuo CSS) */
#site-navigation .primary-menu > .menu-item.mega.open > .sub-menu {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

#site-navigation .primary-menu > .menu-item.mega > .sub-menu[aria-hidden="false"],
#site-navigation .primary-menu > .menu-item.mega.open > .sub-menu {
  display: flex !important;
}

/* ===== Site background SVG (fisso) ===== */
body {
  background-color: var(--color-bg);
  background-image: url('/wp-content/themes/theme-abcontact/assets/img/img-background.svg');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
  background-origin: border-box;
  background-clip: border-box;
}

/* Mobile fallback for iOS */
@supports (-webkit-overflow-scrolling: touch) {
  body { background-image: none; }
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('/wp-content/themes/theme-abcontact/assets/img/img-background.svg');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    pointer-events: none;
  }
}


/* ================= 404 — full-page gradient + centering ================= */

body.error404 {
  --error404-top-alpha: 0.40; 
  background: linear-gradient(
    180deg,
    rgba(11,95,255,var(--error404-top-alpha)) 0%,
    rgba(11,95,255,0.18) 18%,
    rgba(11,95,255,0.06) 35%,
    rgba(255,255,255,0.00) 65%
  );
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  min-height: 100vh;
  display: block;
}

body.error404 .site-header {
  position: relative;
  z-index: 25;
}

body.error404 .site-header a,
body.error404 .site-header .menu a,
body.error404 .site-header .menu-toggle {
  color: #ffffff !important;
  text-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

body.error404 .site-main.page-404-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: calc(100vh - 220px); 
  padding-top: 36px;
  padding-bottom: 36px;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
}

body.error404 .page-404-inner {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

/* increase card width / space in related grid */
.related-news .grid > .grid { /* il wrapper dove vengono stampate le card */
  gap: 32px;
}
.related-news .grid .news-card-grid,
.related-news .grid .card.news-card-grid,
.related-news .grid .post-card,
.related-news .grid .news-card {
  max-width: none; /* non limitare troppo */
  padding: 0;
}
/* se le card sono in grid a 4 colonne, riduci a 3 colonne su larghezze medie per più spazio */
@media (min-width:1100px) {
  .related-news .grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== INTERNAL HERO (news-hero) — SOLID background like prototype ===== */
.hero.news-hero.news-hero--solid {
  /* reduce height vs home */
  height: auto;
  min-height: 320px;
  padding-top: 96px;   /* spazio per header trasparente */
  padding-bottom: 64px;
  background-image: none !important;
  background-color: var(--news-hero-bg, #153473) !important;
}

/* overlay: keep but default transparent for solid hero */
.hero.news-hero.news-hero--solid::before {
  background: var(--hero-overlay, rgba(15, 43, 155, 0.35)) !important;
}

/* Left aligned content like prototype internal page */
.hero.news-hero.news-hero--solid .hero-inner,
.hero.news-hero.news-hero--solid .hero__inner {
  justify-content: flex-start;
}

.hero.news-hero.news-hero--solid .hero-content,
.hero.news-hero.news-hero--solid .hero__content {
  align-items: flex-start;
  text-align: left;
  max-width: 860px;
}

/* Back link */
.hero.news-hero.news-hero--solid .hero__back-link {
  color: rgba(255,255,255,0.72);
  font-weight: 600;
  margin-bottom: 24px;
}

/* Eyebrow like prototype */
.hero.news-hero.news-hero--solid .hero__eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: rgba(84, 148, 255, 0.95);
  margin-bottom: 14px;
}

/* Title like prototype */
.hero.news-hero.news-hero--solid .hero-title {
  font-size: clamp(2.2rem, 5.2vw, 3.2rem);
  line-height: 1.02;
  text-shadow: none;
  margin-bottom: 16px;
}

/* Subtitle more muted, not huge */
.hero.news-hero.news-hero--solid .hero-subtitle {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.55;
  color: rgba(255,255,255,0.70);
  text-shadow: none;
  max-width: 720px;
  margin-left: 0;
  margin-right: 0;
}

/* Responsive */
@media (max-width: 880px) {
  .hero.news-hero.news-hero--solid {
    min-height: 260px;
    padding-top: 88px;
    padding-bottom: 52px;
  }
}
@media (max-width: 520px) {
  .hero.news-hero.news-hero--solid {
    padding-top: 76px;
    padding-bottom: 44px;
  }
}

/* ===== FIX ALIGNMENT: match prototype for solid internal hero ===== */
.hero.news-hero.news-hero--solid .hero-inner {
  /* The container already centers the block; we want content aligned like prototype */
  justify-content: flex-start;
}

/* Create a "text column" with a left offset similar to prototype */
.hero.news-hero.news-hero--solid .hero-content.hero-content--internal {
  width: 100%;
  max-width: 980px;      /* allow a wider text column like prototype */
  margin-left: 0;        /* prevent centering via auto margins */
  margin-right: 0;
  padding-left: 64px;    /* key: left offset */
  padding-right: 24px;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

/* Spacing rhythm like prototype */
.hero.news-hero.news-hero--solid .hero__back-link {
  margin-bottom: 28px;
}

.hero.news-hero.news-hero--solid .hero__eyebrow {
  margin-bottom: 18px;
}

.hero.news-hero.news-hero--solid .hero-title {
  margin-bottom: 18px;
}

.hero.news-hero.news-hero--solid .hero-subtitle {
  margin-top: 0;
  margin-bottom: 0;
  max-width: 720px;
}

/* Responsive: reduce left offset on smaller screens */
@media (max-width: 1024px) {
  .hero.news-hero.news-hero--solid .hero-content.hero-content--internal {
    padding-left: 40px;
  }
}
@media (max-width: 680px) {
  .hero.news-hero.news-hero--solid .hero-content.hero-content--internal {
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* ===== Mobile fix: solid internal hero should feel like prototype ===== */
@media (max-width: 680px) {

  .hero.news-hero.news-hero--solid {
    min-height: 220px;       /* less tall */
    padding-top: 92px;       /* enough space for header */
    padding-bottom: 44px;
  }

  /* Strongly force left alignment on mobile */
  .hero.news-hero.news-hero--solid .hero-inner {
    justify-content: flex-start;
  }

  .hero.news-hero.news-hero--solid .hero-content.hero-content--internal {
    padding-left: 14px;      /* small gutter like prototype */
    padding-right: 14px;
    max-width: 100%;
    align-items: flex-start;
    text-align: left;
  }

  /* Back link smaller and less heavy */
  .hero.news-hero.news-hero--solid .hero__back-link {
    font-size: 0.92rem;
    margin-bottom: 18px;
    color: rgba(255,255,255,0.70);
  }

  /* Eyebrow: compact */
  .hero.news-hero.news-hero--solid .hero__eyebrow {
    font-size: 0.72rem;
    margin-bottom: 12px;
    letter-spacing: 0.10em;
  }

  /* Title: reduce size + tighter line height */
  .hero.news-hero.news-hero--solid .hero-title {
    font-size: clamp(1.7rem, 7vw, 2.25rem);
    line-height: 1.05;
    margin-bottom: 14px;
  }

  /* Subtitle: smaller, avoid big centered block feeling */
  .hero.news-hero.news-hero--solid .hero-subtitle {
    font-size: 0.98rem;
    line-height: 1.5;
    max-width: 28ch;         /* keeps it visually like prototype */
    color: rgba(255,255,255,0.68);
  }
}

/* Extra-small devices */
@media (max-width: 420px) {
  .hero.news-hero.news-hero--solid {
    padding-top: 84px;
    padding-bottom: 40px;
  }
  .hero.news-hero.news-hero--solid .hero-title {
    font-size: 1.9rem;
  }
}

/* ================= HOME HERO: fix mobile overlap with transparent header ================= */

/* The header is absolute/transparent at top; make hero content start lower */
.hero:not(.news-hero) {
  /* keep current heights but ensure content isn't hidden behind header */
  padding-top: 96px; /* desktop/tablet baseline; overridden below */
  box-sizing: border-box;
}

/* Ensure inner block aligns like prototype and doesn't sit under header */
.hero:not(.news-hero) .hero__inner {
  align-items: flex-start;       /* not vertical centered */
  justify-content: flex-start;
  padding-top: 0;                /* hero padding handles top space */
}

/* Prevent title from sliding under header due to large font sizes */
.hero:not(.news-hero) .hero__content {
  width: 100%;
}

/* Mobile specific tuning */
@media (max-width: 799px) {

  .hero:not(.news-hero) {
    height: auto;                /* instead of fixed 420px: allow content */
    min-height: 520px;           /* keeps hero presence but avoids overlap */
    padding-top: 104px;          /* critical: pushes content below header */
    padding-bottom: 44px;
  }

  /* left aligned like prototype */
  .hero:not(.news-hero) .hero__content {
    text-align: left;
    align-items: flex-start;
    max-width: 520px;
  }

  /* Title scale + spacing so it doesn't collide */
  .hero:not(.news-hero) .hero__title {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
    line-height: 1.05;
    margin-bottom: 12px;
  }

  .hero:not(.news-hero) .hero__lead {
    font-size: 0.98rem;
    line-height: 1.5;
    margin-bottom: 16px;
  }

  /* Actions: keep stacked but align left */
  .hero:not(.news-hero) .hero__actions {
    align-items: flex-start;
    justify-content: flex-start;
  }

  /* KPI cards: full width and tighter spacing */
  .hero:not(.news-hero) .hero__kpis {
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    max-width: 520px;
    margin-top: 18px;
  }
}

/* Extra small devices: slightly less padding-top */
@media (max-width: 420px) {
  .hero:not(.news-hero) {
    padding-top: 96px;
    min-height: 500px;
  }
}

/* ===== HOME HERO KPI: match prototype (no cards, 3 columns) ===== */
@media (max-width: 799px) {

  .hero:not(.news-hero) .hero__kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    max-width: 560px;
    margin-top: 26px;
    padding-top: 8px;
  }

  /* remove "card" look completely */
  .hero:not(.news-hero) .hero__kpi {
    background: transparent !important;
    border: 0 !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* value style (blue, big) */
  .hero:not(.news-hero) .hero__kpi-value {
    color: #0b5fff; /* prototype-like blue */
    font-weight: 800;
    font-size: 2.05rem;
    line-height: 1;
    margin: 0 0 10px 0;
    letter-spacing: -0.02em;
  }

  /* label style (muted gray) */
  .hero:not(.news-hero) .hero__kpi-label {
    color: rgba(255,255,255,0.62);
    font-weight: 500;
    font-size: 0.98rem;
    line-height: 1.35;
    margin: 0;
  }
}

/* Very small phones: keep 3 columns but reduce gap/font a bit */
@media (max-width: 420px) {
  .hero:not(.news-hero) .hero__kpis {
    gap: 12px;
  }
  .hero:not(.news-hero) .hero__kpi-value {
    font-size: 1.75rem;
  }
  .hero:not(.news-hero) .hero__kpi-label {
    font-size: 0.92rem;
  }
}

/* ===== HOME HERO buttons: match prototype (mobile) ===== */
@media (max-width: 799px) {

  /* stack + full width like prototype */
  .hero:not(.news-hero) .hero__actions {
    width: 100%;
    max-width: 560px;     /* similar to prototype content width */
    margin-top: 22px;
    gap: 14px;
  }

  .hero:not(.news-hero) .hero__actions .btn,
  .hero:not(.news-hero) .hero__actions a.button,
  .hero:not(.news-hero) .hero__actions .button {
    width: 100%;
    justify-content: center;
    text-align: center;

    /* big size */
    padding: 18px 22px;
    min-height: 64px;

    border-radius: 18px;  /* pill-ish */
    font-size: 1.15rem;
    font-weight: 700;

    /* smoother */
    box-shadow: none;
  }

  /* Primary (solid blue) */
  .hero:not(.news-hero) .hero__actions .btn--primary,
  .hero:not(.news-hero) .hero__actions .btn.btn--primary {
    background: #0b5fff;
    color: #ffffff;
    border: none;
  }

  /* Ensure arrow on primary (prototype) */
  .hero:not(.news-hero) .hero__actions .btn--primary::after {
    content: "→";
    margin-left: 14px;
    font-size: 1.2em;
    line-height: 1;
    opacity: 0.95;
  }

  /* Secondary (ghost) */
  .hero:not(.news-hero) .hero__actions .btn--ghost,
  .hero:not(.news-hero) .hero__actions .btn.btn--ghost {
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.92);
    border: 2px solid rgba(255,255,255,0.22);
    backdrop-filter: blur(6px);
  }

  /* Hover/active small lift */
  .hero:not(.news-hero) .hero__actions .btn:active {
    transform: translateY(1px);
  }
}

/* Extra-small tuning */
@media (max-width: 420px) {
  .hero:not(.news-hero) .hero__actions .btn,
  .hero:not(.news-hero) .hero__actions a.button,
  .hero:not(.news-hero) .hero__actions .button {
    font-size: 1.05rem;
    min-height: 60px;
    padding: 16px 18px;
    border-radius: 16px;
  }
}
/* ===== HOME HERO buttons: match prototype (desktop + tablet + mobile) ===== */

/* Base (desktop/tablet): bigger buttons and left aligned */
.hero:not(.news-hero) .hero__actions {
  justify-content: flex-start; /* prototype: left aligned */
  gap: 16px;
  margin-top: 26px;
}

/* Make both buttons larger */
.hero:not(.news-hero) .hero__actions .btn,
.hero:not(.news-hero) .hero__actions a.button,
.hero:not(.news-hero) .hero__actions .button {
  padding: 16px 24px;
  min-height: 56px;
  border-radius: 16px;
  font-size: 1.05rem;
  font-weight: 700;
}

/* Primary: solid blue with arrow */
.hero:not(.news-hero) .hero__actions .btn--primary,
.hero:not(.news-hero) .hero__actions .btn.btn--primary {
  background: #0b5fff;
  color: #ffffff;
  border: none;
  box-shadow: 0 14px 34px rgba(11,95,255,0.18);
}

.hero:not(.news-hero) .hero__actions .btn--primary::after {
  content: "→";
  margin-left: 14px;
  font-size: 1.15em;
  line-height: 1;
  opacity: 0.95;
}

/* Secondary: ghost */
.hero:not(.news-hero) .hero__actions .btn--ghost,
.hero:not(.news-hero) .hero__actions .btn.btn--ghost {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  border: 2px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(6px);
}

/* Hover states */
@media (hover:hover) {
  .hero:not(.news-hero) .hero__actions .btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 44px rgba(11,95,255,0.22);
  }
  .hero:not(.news-hero) .hero__actions .btn--ghost:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
  }
}

/* Mobile: full width like prototype */
@media (max-width: 799px) {
  .hero:not(.news-hero) .hero__actions {
    width: 100%;
    max-width: 560px;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .hero:not(.news-hero) .hero__actions .btn,
  .hero:not(.news-hero) .hero__actions a.button,
  .hero:not(.news-hero) .hero__actions .button {
    width: 100%;
    justify-content: center;
    padding: 18px 22px;
    min-height: 64px;
    border-radius: 18px;
    font-size: 1.15rem;
  }
}

/* Extra small */
@media (max-width: 420px) {
  .hero:not(.news-hero) .hero__actions .btn,
  .hero:not(.news-hero) .hero__actions a.button,
  .hero:not(.news-hero) .hero__actions .button {
    font-size: 1.05rem;
    min-height: 60px;
    padding: 16px 18px;
    border-radius: 16px;
  }
}

/* Smooth scroll for anchor links (optional but recommended) */
html { scroll-behavior: smooth; }

/* Avoid the anchor target being hidden under a sticky header */
#cta-footer { scroll-margin-top: 90px; }
