/* ============================================================
   TAKEAWAY — Policy Panel
   Zero body manipulation — solo CSS puro
   ============================================================ */

/* ── Backdrop ── */
#policy-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0);
  transition: background 0.7s ease;
}
#policy-overlay.is-open {
  display: block;
  background: rgba(0,0,0,0.82); /* più scuro */
}

/* ── Scala la pagina sotto quando il panel è aperto ── */
#policy-overlay.is-open ~ * ,
body:has(#policy-overlay.is-open) main {
  transform: scale(0.97);
  transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}

/* ── Panel ── */
.policy-overlay-inner {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(600px, 52vw);
  background: #080808;
  transform: translateX(100%);
  /* entrata veloce, uscita più lenta e morbida */
  transition: transform 0.55s cubic-bezier(0.76, 0, 0.24, 1);
  display: grid;
  grid-template-rows: auto 1fr;
  will-change: transform;
}
#policy-overlay.is-open .policy-overlay-inner {
  transform: translateX(0);
  /* uscita: più lenta con bounce leggero */
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Header ── */
.policy-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px 40px 24px;
}
.policy-overlay-label {
  font-family: var(--font, 'Gill Sans', sans-serif);
  font-size: var(--text-h6);
  line-height: var(--lh-h6);
  letter-spacing: var(--ls-tight);
  text-transform: none;
  color: var(--c-text);
  margin: 0;
}
.policy-overlay-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
  margin-right: -8px;
}
.policy-overlay-close:hover { opacity: 1; }

/* ── Content scrollabile ── */
.policy-overlay-content {
  min-height: 0;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 32px 40px 80px;
}

/* ── Sezioni ── */
.policy-section { display: none; }
.policy-section.active { display: block; }

/* ── Loading spinner ── */
.policy-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
}
.policy-loading span {
  display: block;
  width: 20px;
  height: 20px;
  border: 1px solid var(--c-border);
  border-top-color: var(--c-border);
  border-radius: 50%;
  animation: policy-spin 0.8s linear infinite;
}
@keyframes policy-spin {
  to { transform: rotate(360deg); }
}

/* ── Typography ── */
.policy-section h2 {
  font-family: var(--font, 'Gill Sans', sans-serif);
  font-size: clamp(28px, 3vw, 48px);
  font-weight: 400;
  color: #fff;
  margin: 0 0 8px 0;
}
.policy-updated,
.policy-section > p:first-of-type {
  font-size: 14px;
  color:#787878;
  margin: 0 0 48px 0;
}
/* Headings da WP block editor */
.policy-section h3,
.policy-section .wp-block-heading {
  font-family: var(--font, 'Gill Sans', sans-serif);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
   color:#787878;
  margin: 36px 0 10px 0;
  font-weight: 400;
}
.policy-section p {
  font-family: var(--font, 'Gill Sans', sans-serif);
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255,255,255,0.8);
  margin: 0 0 14px 0;
}
.policy-section strong {
  color: rgba(255,255,255,1);
  font-weight: 400;
}
.policy-section a {
  color: rgba(255,255,255,1);
  text-decoration: underline;
}
.policy-section hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 28px 0;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .policy-overlay-inner { width: 100%; }
  .policy-overlay-header { padding: 24px 20px 16px; }
  .policy-overlay-content { padding: 24px 20px 60px; }
}
