/* passaportodigitaleprodotto.eu · guida a cura di Ekatekai */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/fraunces-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/fraunces-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/fraunces-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); }

:root {
  --bg: #f7f4ef;
  --paper: #fffdf9;
  --ink: #1a1a1a;
  --muted: #6b6560;
  --line: #e3ddd3;
  --soft: #efeae2;
  --accent: #277f48;
  --accent-soft: #e6efe7;
  --deciso: #277f48;
  --previsto: #9a6a12;
  --lettura: #5a5f8a;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --text: 42rem;
  --max: 72rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a18;
    --paper: #23221f;
    --ink: #f2efe9;
    --muted: #aaa49c;
    --line: #3a3833;
    --soft: #2a2925;
    --accent: #6cc58e;
    --accent-soft: #1f3327;
    --deciso: #6cc58e;
    --previsto: #e0b45a;
    --lettura: #a9aee0;
  }
  .logo-light { display: none; }
  .logo-dark { display: inline; }
}
.logo-dark { display: none; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.7 var(--sans);
}
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; height: auto; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem 1rem; z-index: 10; }

/* Testata */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1rem; padding-bottom: 1rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; letter-spacing: -.01em; }
.brand-sub { font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.curated { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.curated img { height: 22px; width: auto; }
.nav { border-bottom: 1px solid var(--line); }
.nav ul { list-style: none; margin: 0 auto; padding: 0 1.25rem; max-width: var(--max); display: flex; gap: 1.4rem; overflow-x: auto; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav a { display: block; padding: .7rem 0; font-size: .9rem; color: var(--muted); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* Pagina */
.page { max-width: var(--max); margin: 0 auto; padding: 2.5rem 1.25rem 4rem; display: grid; grid-template-columns: 13rem minmax(0, var(--text)); gap: 3.5rem; justify-content: center; }
.page.no-toc { grid-template-columns: minmax(0, var(--text)); }
.toc { position: sticky; top: 1.5rem; align-self: start; font-size: .85rem; padding-top: .4rem; }
.toc-title { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem; font-weight: 600; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: .3rem 0 .3rem .9rem; color: var(--muted); text-decoration: none; line-height: 1.35; margin-left: -1px; border-left: 2px solid transparent; }
.toc li a:hover { color: var(--ink); border-left-color: var(--line); }
.toc li a.active { color: var(--ink); border-left-color: var(--accent); }

article { min-width: 0; }
.kicker { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 .8rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); margin: 0 0 1rem; }
h2 { font-size: 1.6rem; margin: 3rem 0 .8rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 .5rem; }
.lede { font-size: 1.2rem; line-height: 1.6; color: var(--ink); margin: 0 0 1.2rem; font-family: var(--serif); font-weight: 400; }
.meta { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .6rem 0; margin: 1.5rem 0 2rem; display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
p { margin: 0 0 1.1rem; }
ul, ol { padding-left: 1.3rem; margin: 0 0 1.2rem; }
li { margin-bottom: .45rem; }
strong { font-weight: 600; }

/* Riquadri */
.summary { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1.3rem 1.5rem; margin: 0 0 2rem; }
.summary h2 { font-size: 1.05rem; font-family: var(--sans); margin: 0 0 .7rem; letter-spacing: 0; }
.summary ul { margin: 0; }
.summary li:last-child { margin-bottom: 0; }
.note { border-left: 3px solid var(--line); padding: .2rem 0 .2rem 1.1rem; color: var(--muted); font-size: .95rem; margin: 1.5rem 0; }

/* Etichette di stato */
.tag { display: inline-block; font: 600 .68rem/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: .32rem .5rem .28rem; border-radius: 3px; border: 1px solid currentColor; vertical-align: .15em; margin-right: .35rem; white-space: nowrap; }
.tag.deciso { color: var(--deciso); }
.tag.previsto { color: var(--previsto); }
.tag.lettura { color: var(--lettura); }
.legend { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; font-size: .9rem; color: var(--muted); margin: 1rem 0 1.5rem; }

/* Elenco delle date */
.timeline { list-style: none; padding: 0; margin: 1.5rem 0 2rem; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 1.4rem 1.4rem; margin: 0; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: .45rem; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--muted); }
.timeline li.done::before { background: var(--accent); border-color: var(--accent); }
.timeline li.now::before { background: var(--ink); border-color: var(--ink); }
.timeline .when { display: block; font-weight: 600; font-size: .95rem; }
.timeline .what { display: block; color: var(--ink); }
.timeline .src { display: block; font-size: .85rem; color: var(--muted); }

/* Tabelle */
.table-wrap { overflow-x: auto; margin: 1.2rem 0 1.8rem; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: .75rem .9rem; border-bottom: 1px solid var(--line); }
th { font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--soft); }
tr:last-child td { border-bottom: 0; }

/* Schede della home */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 1.2rem 0 2rem; }
.card { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.2rem; text-decoration: none; color: var(--ink); }
.card:hover { border-color: var(--muted); }
.card strong { display: block; font-family: var(--serif); font-size: 1.1rem; margin-bottom: .3rem; }
.card span { font-size: .92rem; color: var(--muted); line-height: 1.5; display: block; }

/* Schema */
.diagram { margin: 1.5rem 0 2rem; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1.2rem; }
.diagram figcaption { font-size: .85rem; color: var(--muted); margin-top: .8rem; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.flow div { border: 1px solid var(--line); border-radius: 5px; padding: .75rem; font-size: .88rem; line-height: 1.45; background: var(--bg); position: relative; }
.flow b { display: block; font-family: var(--serif); font-size: 1rem; margin-bottom: .2rem; }
.flow small { color: var(--muted); }
@media (max-width: 40rem) { .flow { grid-template-columns: 1fr 1fr; } }

.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.levels div { border: 1px solid var(--line); border-radius: 5px; padding: .8rem; background: var(--bg); font-size: .9rem; line-height: 1.45; }
.levels b { display: block; font-family: var(--serif); font-size: 1.05rem; }
@media (max-width: 40rem) { .levels { grid-template-columns: 1fr; } }

/* FAQ */
details { border-bottom: 1px solid var(--line); padding: .9rem 0; }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; font-family: var(--serif); font-weight: 600; font-size: 1.12rem; line-height: 1.35; list-style: none; padding-right: 2rem; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: .2rem; top: -.1rem; font-family: var(--sans); font-weight: 400; font-size: 1.4rem; color: var(--muted); }
details[open] summary::after { content: "–"; }
details > div { padding-top: .7rem; }

/* Checklist */
.checklist { list-style: none; padding: 0; }
.checklist li { display: flex; gap: .8rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px dashed var(--line); margin: 0; }
.checklist input { margin-top: .4rem; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); flex: none; }
.checklist label { cursor: pointer; }
.checklist small { display: block; color: var(--muted); font-size: .88rem; }

.btn { display: inline-block; font: 500 .95rem/1 var(--sans); padding: .8rem 1.2rem; border-radius: 4px; text-decoration: none; border: 1px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer; }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(.92); background: var(--accent); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.2rem 0 2rem; }

form.signup { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1.3rem 1.5rem; margin: 2rem 0; }
form.signup h2 { margin-top: 0; font-size: 1.3rem; }
form.signup label.field { display: block; font-size: .9rem; font-weight: 500; margin-bottom: .3rem; }
form.signup input[type=email] { width: 100%; font: inherit; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--ink); margin-bottom: .8rem; }
form.signup .consent { display: flex; gap: .6rem; font-size: .88rem; color: var(--muted); margin-bottom: 1rem; align-items: flex-start; }
form.signup .consent input { margin-top: .3rem; accent-color: var(--accent); }
.hp { position: absolute; left: -5000px; }

/* Spazio Ekatekai */
.sponsor { margin: 3rem 0 1rem; border: 1px solid var(--line); border-radius: 6px; padding: 1.3rem 1.5rem; background: var(--accent-soft); }
.sponsor .label { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 .5rem; }
.sponsor h2 { font-size: 1.25rem; margin: 0 0 .5rem; }
.sponsor p { font-size: .97rem; margin-bottom: .9rem; }
.sponsor .links { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; font-size: .92rem; }

/* Fonti */
.sources { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .88rem; color: var(--muted); }
.sources h2 { font-family: var(--sans); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .8rem; color: var(--muted); }
.sources ol { padding-left: 1.2rem; }
.sources li { margin-bottom: .35rem; }

.updates { list-style: none; padding: 0; }
.updates li { border-top: 1px solid var(--line); padding: 1rem 0; margin: 0; }
.updates time { font-size: .85rem; color: var(--muted); font-weight: 600; display: block; margin-bottom: .2rem; }

/* Piede */
.site-footer { border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.site-footer .wrap { padding-top: 2rem; padding-bottom: 2.5rem; display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.site-footer p { margin: 0 0 .6rem; }
.site-footer a { color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; }
.foot-curated { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.foot-curated img { height: 26px; width: auto; }

@media (max-width: 56rem) {
  .page { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 1.8rem; }
  .toc { position: static; margin-bottom: 1.5rem; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: .9rem 1rem; }
  .toc ol { border-left: 0; }
  .toc li a { padding-left: 0; border-left: 0; }
  .site-footer .wrap { grid-template-columns: 1fr; gap: 1rem; }
  .curated span { display: none; }
}
@media (max-width: 30rem) {
  body { font-size: 1rem; }
  .brand-sub { display: none; }
  .summary, .sponsor, form.signup { padding: 1.1rem; }
}

@media print {
  .site-header, .nav, .toc, .site-footer, .sponsor, form.signup, .actions, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page { display: block; padding: 0; }
  a { color: #000; text-decoration: none; }
  .checklist li { break-inside: avoid; }
  h2 { break-after: avoid; margin-top: 1.4rem; }
  .print-only { display: block !important; }
}
.print-only { display: none; }

/* Tabelle impilate sul telefono */
@media (max-width: 40rem) {
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { border: 0; padding: .25rem .9rem; }
  .table-wrap td[data-label]::before { content: attr(data-label); display: block; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
  .table-wrap td:first-child::before { display: none; }
  .table-wrap td:first-child { font-weight: 600; }
}

/* Sottomenu della sezione moda */
.subnav { display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: center; margin: 0 0 1.6rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); font-size: .85rem; }
.subnav span { font-weight: 600; color: var(--accent); margin-right: .4rem; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
.subnav a { text-decoration: none; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: .25rem .7rem; }
.subnav a:hover { color: var(--ink); border-color: var(--muted); }
.subnav a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }
