/*
 * Shared layer for the three legal documents, privacy.html, cookie-policy.html
 * and terms.html. They are read as one set and any drift between them reads as
 * sloppiness on a legal page, so the typography and layout live in one file
 * instead of three copies that have to be kept in sync by hand.
 *
 * Rules only some of the three need (.card, .claim, the table styling) are here
 * too: each is class- or table-scoped, so it costs nothing on a page whose
 * markup never uses it, and it stays identical wherever it does.
 *
 * Colors, fonts and --mx come from /tokens.css. Anything genuinely specific to
 * one document stays in that document's own stylesheet, which loads after this.
 */

/* Shared colors/fonts come from /tokens.css. Only this page's own
   legal-document typography lives here. */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--ombra, #000);
  color: var(--luce, #fafafa);
  font-family: var(--text, system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
}

/*
 * width:100% is load-bearing, not decoration.
 *
 * body is a column flex container, and an `auto` margin on a flex item's
 * cross axis suppresses the default stretch. Without an explicit width the
 * item then shrink-to-fits, which on a phone resolved to 593px inside a
 * 390px viewport and gave all six legal documents 200px of horizontal
 * scroll. max-width still caps the measure at 820px, so desktop is unmoved.
 */
.wrap {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}

main.wrap {
  flex: 1 0 auto;
  padding: var(--sp, 72px) var(--mx, 24px);
}

footer {
  flex-shrink: 0;
}

a {
  color: inherit;
}

/* Language blocks. Both applyLang implementations (site-chrome.js and
   shared-header.js) set document.documentElement.lang, so the whole
   switch is one CSS rule -- no JS, no per-string i18n keys for a
   document this long, and both texts stay in the DOM for search
   engines and for anyone linking to a specific clause. */

.eyebrow {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oro, #b08d57);
}

h1 {
  font-family: var(--display, system-ui, sans-serif);
  font-weight: 700;
  font-size: clamp(28px, 4.5vw, 44px);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-top: 12px;
}

.updated {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--cenere, #6e6e6e);
  margin-top: 16px;
}

/* The three legal documents cross-reference each other constantly, so a
   reader who lands on one needs the other two without going back to the
   footer. Shared markup and rules across privacy / cookie-policy / terms. */

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  row-gap: 8px;
  margin-top: 28px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.doc-nav > * {
  padding: 0 14px;
  border-left: 1px solid var(--grafite, #1c1c1c);
}

.doc-nav > *:first-child {
  padding-left: 0;
  border-left: 0;
}

.doc-nav a {
  color: var(--cenere, #6e6e6e);
  text-decoration: none;
}

@media (hover: hover) {
  .doc-nav a:hover {
    color: var(--luce, #fafafa);
  }
}

.doc-nav .doc-nav-current {
  color: var(--oro, #b08d57);
}

.doc {
  margin-top: clamp(32px, 5vw, 52px);
  font-size: 16px;
  line-height: 1.7;
  color: var(--nebbia, #c9c9c9);
}

.doc h2 {
  font-family: var(--display, system-ui, sans-serif);
  font-weight: 700;
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.25;
  color: var(--luce, #fafafa);
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--grafite, #1c1c1c);
}

.doc h3 {
  font-family: var(--display, system-ui, sans-serif);
  font-weight: 700;
  font-size: 16px;
  color: var(--luce, #fafafa);
  margin-top: 28px;
}

.doc p {
  margin-top: 14px;
}

.doc ul,
.doc ol {
  margin-top: 14px;
  padding-left: 22px;
}

.doc li {
  margin-top: 8px;
}

.doc strong {
  color: var(--luce, #fafafa);
  font-weight: 600;
}

.doc a {
  color: var(--luce, #fafafa);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--cenere, #6e6e6e);
}

@media (hover: hover) {
  .doc a:hover {
    text-decoration-color: var(--luce, #fafafa);
  }
}

/* Identity card for the controller block. */

.card {
  margin-top: 18px;
  border: 1px solid var(--grafite, #1c1c1c);
  padding: 20px 22px;
  font-size: 15px;
}

.card dl {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 8px 20px;
}

.card dt {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cenere, #6e6e6e);
  padding-top: 2px;
}

.card dd {
  color: var(--nebbia, #c9c9c9);
}

.claim {
  margin-top: 24px;
  border: 1px solid var(--oro, #b08d57);
  border-left-width: 3px;
  padding: 18px 22px;
  font-size: 15px;
  color: var(--luce, #fafafa);
}

/* Processing-activity tables. Horizontal scroll rather than a squeezed
   column: retention periods and legal bases must stay readable. */

.table-scroll {
  overflow-x: auto;
  margin-top: 18px;
  border: 1px solid var(--grafite, #1c1c1c);
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--grafite, #1c1c1c);
}

th {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cenere, #6e6e6e);
  font-weight: 400;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* Unresolved facts. Deliberately loud -- this document must not go live
   with any of these still in it. */

.todo {
  background: #3a2a00;
  color: #ffd166;
  padding: 1px 6px;
  border-radius: 2px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 13px;
}

@media (max-width: 560px) {
  .card dl {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .card dt {
    margin-top: 12px;
  }
}

/*
 * The cross-reference strip between the three legal documents is a row of
 * 12px mono links about 29px tall -- fine for a cursor, under the minimum
 * target for a finger, at every width. row-gap on .doc-nav already spaces the
 * wrapped rows, so growing each link vertically does not collide with them.
 */
@media (pointer: coarse) {
  .doc-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/*
 * Legibility floor: nothing below 12px on a small screen.
 *
 * These labels are set at 10-11px mono, which reads as a quiet register on a
 * desktop and as unreadable on a phone. 12px is the smallest mono size the
 * site already uses elsewhere, so this borrows a value rather than inventing
 * one. Gated on width rather than pointer: it is a typographic scale, and
 * above 900px a tablet shows the desktop composition and keeps its type.
 */
@media (max-width: 900px) {
  th {
    font-size: 12px;
  }
}
