/* =========================================================
   EVEREST — legal documents (privacy, terms, accessibility)
   Loaded on top of style.css, which carries the design tokens.
   ========================================================= */
body.doc { background: var(--white); }

/* ---------- header ---------- */
.doc__head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.doc__headin { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 16px; }
.doc__headright { display: flex; align-items: center; gap: clamp(14px, 3vw, 28px); }
.doc__headright .lang { display: flex; gap: 10px; font-family: var(--f-mono); font-size: 11px; color: var(--muted-2); }
.doc__headright .lang a { transition: color .3s var(--ease); }
.doc__headright .lang a[aria-current] { color: var(--ink); }
.doc__headright .lang a:hover { color: var(--brand); }
.doc__back { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--muted-2); transition: color .3s var(--ease); }
.doc__back:hover { color: var(--ink); }
.doc__back svg { width: 14px; height: 14px; transform: rotate(180deg); }

/* ---------- title block ---------- */
.doc__hero { padding: clamp(48px, 8vw, 110px) 0 clamp(30px, 4vw, 52px); border-bottom: 1px solid var(--line); }
.doc__title { font-size: clamp(29px, 6.6vw, 92px); line-height: .94; max-width: 14ch; overflow-wrap: break-word; hyphens: auto; }
.doc__sub { margin-top: 26px; color: var(--muted-2); font-size: clamp(16px, 1.5vw, 19px); max-width: 46em; }
.doc__meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 30px; color: var(--muted-2); font-size: 11px; }
.doc__meta b { color: var(--ink); font-weight: 500; }

/* ---------- layout ---------- */
.doc__grid { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); padding-block: clamp(36px, 5vw, 72px) clamp(70px, 9vw, 130px); align-items: start; }  /* padding-block, non la scorciatoia: quella azzerava i margini laterali di .wrap */
.doc__toc { position: sticky; top: 104px; display: grid; gap: 2px; }
.doc__toc h2 { font-size: 11px; color: var(--muted-2); margin-bottom: 12px; font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .08em; font-weight: 500; }
.doc__toc a { display: grid; grid-template-columns: 2.2em 1fr; gap: 6px; padding: 7px 0; font-size: 14px; color: var(--muted-2); border-top: 1px solid var(--line); transition: color .3s var(--ease); }
.doc__toc a:first-of-type { border-top: 0; }
.doc__toc a i { font-family: var(--f-mono); font-style: normal; font-size: 11px; opacity: .6; padding-top: .18em; }
.doc__toc a:hover { color: var(--ink); }

/* ---------- prose ---------- */
.doc__body { max-width: 74ch; }
.doc__sec { padding-block: clamp(26px, 3vw, 40px); border-top: 1px solid var(--line); scroll-margin-top: 100px; }
.doc__sec:first-child { border-top: 0; padding-top: 0; }
.doc__sec > h2 {
  display: grid; grid-template-columns: 2.6em 1fr; align-items: baseline;
  font-family: var(--f-display); font-weight: 800; font-stretch: 125%; font-variation-settings: "wdth" 125;
  text-transform: uppercase; font-size: clamp(19px, 2vw, 26px); line-height: 1.05; margin-bottom: 18px;
}
.doc__sec > h2 i { font-family: var(--f-mono); font-style: normal; font-weight: 400; font-size: 12px; color: var(--brand); letter-spacing: .05em; }
.doc__sec h3 { font-size: 16px; font-weight: 600; margin: 26px 0 8px; color: var(--ink); }
.doc__sec p { color: #3a4048; margin-bottom: 14px; }
.doc__sec p:last-child, .doc__sec ul:last-child, .doc__sec dl:last-child { margin-bottom: 0; }
.doc__sec a:not(.btn) { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.doc__sec ul { display: grid; gap: 9px; margin-bottom: 16px; }
.doc__sec li { position: relative; padding-left: 24px; color: #3a4048; }
.doc__sec li::before { content: ""; position: absolute; left: 0; top: .72em; width: 12px; height: 1px; background: var(--brand); }
.doc__sec ol { counter-reset: dl; display: grid; gap: 9px; margin: 0 0 16px; padding: 0; }
.doc__sec ol li { counter-increment: dl; padding-left: 30px; }
.doc__sec ol li::before { content: counter(dl) "."; background: none; width: auto; height: auto; top: 0; font-family: var(--f-mono); font-size: 12px; color: var(--brand); }

/* definition rows: identification data, legal bases, retention */
.doc__dl { border-top: 1px solid var(--line); margin-bottom: 18px; }
.doc__dl > div { display: grid; grid-template-columns: minmax(0, 13em) minmax(0, 1fr); gap: 6px 22px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.doc__dl dt { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); }
.doc__dl dd { color: #22262c; }

/* purpose / legal-basis table */
.doc__table { border-top: 1px solid var(--ink); margin-bottom: 18px; }
.doc__table > div { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, .9fr); gap: 8px 22px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.doc__table > div:first-child { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); padding-block: 10px; }
.doc__table strong { font-weight: 600; color: var(--ink); display: block; margin-bottom: 4px; }
.doc__table span { color: #3a4048; font-size: 15px; }

/* call-out */
.doc__note { padding: 20px 22px; border-radius: 12px; background: var(--paper); border-left: 2px solid var(--brand); margin-bottom: 18px; }
.doc__note p { margin-bottom: 8px; }
.doc__note p:last-child { margin-bottom: 0; }
.doc__note .mono { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); margin-bottom: 8px; }

.doc__stato { display: block; font-size: 11px; color: var(--brand); margin-bottom: 18px; }

/* ---------- footer ---------- */
.doc__foot { background: var(--black); color: #fff; padding: clamp(46px, 6vw, 80px) 0 32px; }
.doc__footgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: 40px; }
.doc__foot h2 { font-size: 11px; color: rgba(255, 255, 255, .4); margin-bottom: 12px; font-family: var(--f-mono); text-transform: uppercase; letter-spacing: .08em; font-weight: 500; }
.doc__foot p, .doc__foot a { color: rgba(255, 255, 255, .62); font-size: 14px; }
.doc__foot a { display: block; width: max-content; max-width: 100%; transition: color .3s var(--ease); }
.doc__foot a:hover { color: #fff; }
.doc__legalid { color: rgba(255, 255, 255, .45); font-size: 12px; line-height: 1.7; max-width: 40em; }
.doc__footbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: clamp(34px, 5vw, 56px); padding-top: 22px; border-top: 1px solid var(--line-dark); color: rgba(255, 255, 255, .45); font-size: 10px; }

@media (max-width: 960px) {
  /* minmax(0,1fr): con 1fr una parola tedesca lunga allarga la colonna oltre il margine */
  .doc__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .doc__toc { position: static; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
  .doc__footgrid { grid-template-columns: 1fr 1fr; }
  .doc__legalid { grid-column: 1 / -1; }
}
/* sotto i 560px il selettore di lingua e l'etichetta non stanno insieme:
   resta la freccia, il testo passa ai soli lettori di schermo */
@media (max-width: 560px) {
  .doc__backtxt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .doc__back { gap: 0; }
}
@media (max-width: 520px) {
  .doc__back { font-size: 10px; }
  .doc__headright { gap: 12px; }
  .doc__headright .lang { gap: 7px; }
  .doc__headin { gap: 10px; }
}
@media (max-width: 620px) {
  .doc__table > div { grid-template-columns: 1fr; gap: 4px; }
  .doc__table > div:first-child { display: none; }
  .doc__table > div span::before { content: attr(data-l) " — "; color: var(--muted-2); font-family: var(--f-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
  .doc__dl > div { grid-template-columns: 1fr; gap: 3px; }
  .doc__footgrid { grid-template-columns: 1fr; gap: 28px; }
  .doc__sec > h2 { grid-template-columns: 1fr; gap: 6px; }
}
