/* Modale legale + banner cookie per le pagine blog (estratto dal template della home) */
/* =========================================================
   POLICY MODAL (Privacy / Cookie / Termini)
========================================================= */
.policy-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 48px);
  background: rgba(20, 19, 17, 0.72);
  backdrop-filter: saturate(1.1) blur(6px);
  -webkit-backdrop-filter: saturate(1.1) blur(6px);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.policy-modal.open {
  display: flex;
  opacity: 1;
}
.policy-card {
  background: var(--bone);
  color: var(--ink);
  width: 100%;
  max-width: 880px;
  max-height: 92vh;
  border-radius: 4px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.45), 0 0 0 1px rgba(20,19,17,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform .45s var(--ease);
}
.policy-modal.open .policy-card { transform: translateY(0) scale(1); }

.policy-head {
  padding: 28px clamp(24px, 4vw, 48px) 20px;
  border-bottom: 1px solid var(--ink-10);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  background: var(--bone);
  position: sticky;
  top: 0;
  z-index: 2;
}
.policy-head .kicker {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 8px;
  display: block;
}
.policy-head h3 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.policy-head h3 em { font-style: italic; color: var(--gold); font-weight: 300; }
.policy-head .updated {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-top: 6px;
}
.policy-close {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--ink-20);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.policy-close:hover { background: var(--ink); color: var(--bone); border-color: var(--ink); transform: rotate(90deg); }
.policy-close::before, .policy-close::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 1px;
  background: currentColor;
}
.policy-close::before { transform: rotate(45deg); }
.policy-close::after { transform: rotate(-45deg); }

.policy-body {
  padding: 28px clamp(24px, 4vw, 48px) clamp(32px, 5vw, 56px);
  overflow-y: auto;
  flex: 1;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-80);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.policy-body::-webkit-scrollbar { width: 8px; }
.policy-body::-webkit-scrollbar-track { background: transparent; }
.policy-body::-webkit-scrollbar-thumb { background: var(--ink-20); border-radius: 4px; }
.policy-body::-webkit-scrollbar-thumb:hover { background: var(--ink-40); }

.policy-body .lead {
  font-size: 15px;
  color: var(--ink-80);
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink-10);
}
.policy-body h4 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--ink);
  margin-top: 32px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
  scroll-margin-top: 120px;
}
.policy-body h4:first-of-type { margin-top: 0; }
.policy-body h5 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-top: 22px;
  margin-bottom: 10px;
}
.policy-body p { margin-bottom: 12px; }
.policy-body p strong, .policy-body li strong { color: var(--ink); font-weight: 600; }
.policy-body ul, .policy-body ol { padding-left: 20px; margin-bottom: 14px; }
.policy-body li { margin-bottom: 6px; }
.policy-body a { color: var(--gold-2); text-decoration: underline; text-underline-offset: 3px; }
.policy-body a:hover { color: var(--gold); }

.policy-body .callout {
  background: var(--bone-2);
  border-left: 3px solid var(--gold);
  padding: 14px 18px;
  margin: 18px 0;
  border-radius: 2px;
  font-size: 14px;
}
.policy-body .callout strong { color: var(--ink); }

.policy-body .placeholder {
  display: inline-block;
  background: rgba(163, 126, 63, 0.14);
  color: var(--gold-2);
  padding: 1px 8px;
  border-radius: 3px;
  font-weight: 500;
  font-size: 0.95em;
  letter-spacing: 0.02em;
  border: 1px dashed var(--gold);
}

.policy-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 22px;
  font-size: 13.5px;
}
.policy-body table th, .policy-body table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ink-10);
  vertical-align: top;
}
.policy-body table th {
  font-weight: 600;
  color: var(--ink);
  background: var(--bone-2);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.policy-body table td { color: var(--ink-80); }

.policy-body .cookie-block {
  background: #fff;
  border: 1px solid var(--ink-10);
  border-radius: 4px;
  padding: 18px 22px;
  margin: 16px 0;
}
.policy-body .cookie-block h5 { margin-top: 0; margin-bottom: 8px; }
.policy-body .cookie-block .tag {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  font-weight: 500;
  vertical-align: 1px;
}
.policy-body .tag-tech { background: rgba(27, 42, 58, 0.1); color: var(--ink); }
.policy-body .tag-third { background: rgba(163, 126, 63, 0.15); color: var(--gold-2); }
.policy-body .cookie-block dl { margin-top: 8px; font-size: 13px; }
.policy-body .cookie-block dl div {
  display: grid;
  grid-template-columns: 150px 1fr;
  padding: 6px 0;
  border-bottom: 1px dashed var(--ink-10);
}
.policy-body .cookie-block dl div:last-child { border-bottom: 0; }
.policy-body .cookie-block dl dt { font-weight: 600; color: var(--ink); font-size: 12px; letter-spacing: 0.02em; }
.policy-body .cookie-block dl dd { color: var(--ink-80); font-size: 13px; }

.policy-body .foot-note {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--ink-10);
  font-size: 12.5px;
  color: var(--ink-60);
  font-style: italic;
}

@media (max-width: 600px) {
  .policy-head { padding: 20px 20px 16px; }
  .policy-body { padding: 22px 20px 32px; font-size: 14px; }
  .policy-body .cookie-block dl div { grid-template-columns: 1fr; gap: 2px; padding: 8px 0; }
  .policy-close { width: 36px; height: 36px; }
}
body.no-scroll { overflow: hidden; }

/* =========================================================
   COOKIE BANNER + MAP BLOCKED PLACEHOLDER
========================================================= */
.map-blocked {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(20,19,17,0.04) 0%, rgba(20,19,17,0.08) 100%),
    repeating-linear-gradient(45deg, rgba(20,19,17,0.04) 0 2px, transparent 2px 18px),
    var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-80);
  padding: 32px 24px;
}
.map-blocked-inner {
  text-align: center;
  max-width: 460px;
}
.map-blocked h4 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.map-blocked p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-60);
  margin-bottom: 20px;
}
.btn-consent-map {
  background: var(--ink);
  color: var(--bone);
  padding: 12px 22px;
  border-radius: 999px;
  border: 0;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
  font-weight: 500;
}
.btn-consent-map:hover { background: var(--gold-2); transform: translateY(-1px); }
.map-policy-link {
  display: block;
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-20);
  padding-bottom: 2px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  transition: color .2s ease, border-color .2s ease;
}
.map-policy-link:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: clamp(16px, 3vw, 32px);
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 150;
  background: var(--ink);
  color: var(--bone);
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(250,246,236,0.06);
  padding: clamp(20px, 2.5vw, 28px) clamp(22px, 3vw, 36px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
  transition: transform .5s var(--ease), opacity .4s var(--ease);
  max-width: 1080px;
  margin: 0 auto;
}
.cookie-banner.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.cookie-banner-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(250, 246, 236, 0.88);
}
.cookie-banner-text h5 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  color: var(--bone);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.cookie-banner-text h5 em { color: var(--gold-soft); font-style: italic; }
.cookie-banner-text a {
  color: var(--gold-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s ease;
}
.cookie-banner-text a:hover { color: var(--bone); }
.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}
.cookie-btn {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 11px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s ease;
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}
.cookie-btn.ghost {
  background: transparent;
  color: rgba(250, 246, 236, 0.78);
  border-color: rgba(250, 246, 236, 0.24);
}
.cookie-btn.ghost:hover { color: var(--bone); border-color: var(--bone); }
.cookie-btn.primary {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.cookie-btn.primary:hover { background: var(--gold-soft); border-color: var(--gold-soft); }
.cookie-btn.link {
  background: transparent;
  color: rgba(250, 246, 236, 0.6);
  border: 0;
  padding: 11px 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.cookie-btn.link:hover { color: var(--bone); }

@media (max-width: 820px) {
  .cookie-banner {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 22px 20px;
  }
  .cookie-banner-actions { justify-content: flex-start; }
  .cookie-btn { flex: 1 1 calc(50% - 5px); text-align: center; padding: 12px 14px; }
  .cookie-btn.link { flex-basis: 100%; }
}

/* Cookie preferences modal */
.cookie-prefs {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 48px);
  background: rgba(20, 19, 17, 0.72);
  backdrop-filter: saturate(1.1) blur(6px);
  -webkit-backdrop-filter: saturate(1.1) blur(6px);
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.cookie-prefs.open {
  display: flex;
  opacity: 1;
}
.cookie-prefs-card {
  background: var(--bone);
  color: var(--ink);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  border-radius: 4px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.45), 0 0 0 1px rgba(20,19,17,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  transition: transform .45s var(--ease);
}
.cookie-prefs.open .cookie-prefs-card { transform: translateY(0) scale(1); }
.cookie-prefs-head {
  padding: 26px 32px 18px;
  border-bottom: 1px solid var(--ink-10);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.cookie-prefs-head .kicker {
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  display: block;
  margin-bottom: 6px;
}
.cookie-prefs-head h3 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.cookie-prefs-head h3 em { font-style: italic; color: var(--gold); font-weight: 300; }
.cookie-prefs-body {
  padding: 20px 32px 8px;
  overflow-y: auto;
  flex: 1;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-80);
}
.cookie-prefs-body p { margin-bottom: 12px; }
.cookie-prefs-body a { color: var(--gold-2); text-decoration: underline; text-underline-offset: 3px; }

.cookie-category {
  padding: 18px 0;
  border-bottom: 1px solid var(--ink-10);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: flex-start;
}
.cookie-category:last-of-type { border-bottom: 0; }
.cookie-category-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 4px;
}
.cookie-category-desc {
  font-size: 13px;
  color: var(--ink-60);
  line-height: 1.55;
}
.cookie-category .status {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-top: 6px;
  font-weight: 500;
}

/* Toggle switch */
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider {
  position: absolute;
  inset: 0;
  background: var(--ink-20);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease;
}
.switch .slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  background: var(--bone);
  border-radius: 50%;
  transition: transform .2s var(--ease);
}
.switch input:checked + .slider { background: var(--gold); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:disabled + .slider { background: rgba(163, 126, 63, 0.5); cursor: not-allowed; }
.switch input:disabled + .slider::before { background: rgba(250, 246, 236, 0.8); }

.cookie-prefs-foot {
  padding: 18px 32px 26px;
  border-top: 1px solid var(--ink-10);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cookie-prefs-foot .cookie-btn.ghost { color: var(--ink-60); border-color: var(--ink-20); }
.cookie-prefs-foot .cookie-btn.ghost:hover { color: var(--ink); border-color: var(--ink); }
.cookie-prefs-foot .cookie-btn.primary { background: var(--ink); color: var(--bone); border-color: var(--ink); }
.cookie-prefs-foot .cookie-btn.primary:hover { background: var(--gold-2); border-color: var(--gold-2); }
@media (max-width: 500px) {
  .cookie-prefs-head, .cookie-prefs-body, .cookie-prefs-foot { padding-left: 20px; padding-right: 20px; }
  .cookie-prefs-foot { flex-direction: column; }
  .cookie-prefs-foot .cookie-btn { width: 100%; text-align: center; }
}
