/* ============================================================
 * notes/notes.css
 * Foglio di stile per le pagine pubbliche di Notes.
 * Eredita la palette e tipografia del sito principale (styles.css).
 * Carica gli stessi font Google Fonts del sito.
 * ============================================================ */

:root {
  --bg:           #060708;
  --bg-2:         #0a0b0d;
  --surface:      #11161a;
  --surface-2:    #161c22;
  --line:         rgba(255, 255, 255, 0.08);
  --line-strong:  rgba(255, 255, 255, 0.16);
  --ink:          #e9eef2;
  --ink-dim:      #9aa6af;
  --ink-mute:     #5d6770;
  --primary:      #007A99;
  --primary-soft: #0a8fb0;
  --primary-glow: rgba(0, 122, 153, 0.35);
  --accent:       #e9eef2;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body { position: relative; min-height: 100vh; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ============================================================
 * SVG ARCS BACKGROUND (statico, generato server-side con seed)
 * Gli archi vengono renderizzati direttamente da PHP con attributi
 * inline (stroke, opacity, dasharray, etc). Nessuna animazione.
 * Questo blocco contiene solo posizionamento e dimensione del
 * container fixed.
 * ============================================================ */
.arcs-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.arcs-bg svg {
  position: absolute;
  width: 140%;
  height: 140%;
  top: -20%;
  left: -20%;
}

/* Grain overlay (come nel sito) */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.30;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ============================================================
 * HEADER
 * ============================================================ */
.notes-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(6,7,8,0.85), rgba(6,7,8,0));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.notes-header > * { pointer-events: auto; }

.notes-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.notes-header .logo img {
  width: 36px;
  height: 40px;
  display: block;
}
.notes-header .logo .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.2s;
}
.notes-header .logo:hover .label { color: var(--ink); }

.notes-header .nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.notes-header .lang-pick {
  display: flex;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.notes-header .lang-pick a {
  color: var(--ink-mute);
  padding: 6px 10px;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s;
}
.notes-header .lang-pick a:hover { color: var(--ink); }
.notes-header .lang-pick a.active {
  color: var(--ink);
  background: rgba(255,255,255,0.06);
}
.notes-header .back-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 6px 10px;
  transition: color 0.2s;
}
.notes-header .back-link:hover { color: var(--ink); }

@media (max-width: 600px) {
  .notes-header { padding: 14px 18px; }
  .notes-header .nav { gap: 8px; }
  .notes-header .back-link { display: none; }
}

/* ============================================================
 * MAIN CONTAINER & PAGE CHROME
 * ============================================================ */
.notes-main {
  position: relative;
  z-index: 2;
  padding-top: 120px;  /* spazio sotto l'header fisso */
  padding-bottom: 120px;
}

/* ============================================================
 * INDEX (lista articoli) — layout editoriale
 * ============================================================ */
.index-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.index-hero {
  padding: 60px 0 80px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 80px;
}
.index-hero .eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary-soft);
  margin-bottom: 20px;
}
.index-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.5vw, 64px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--ink);
  margin: 0 0 20px;
  max-width: 18ch;
}
.index-hero .lede {
  font-size: clamp(16px, 1.4vw, 19px);
  color: var(--ink-dim);
  max-width: 60ch;
  line-height: 1.6;
}

/* Lista editoriale verticale */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.article-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
  align-items: start;
  transition: opacity 0.2s;
}
.article-row:first-child { border-top: none; padding-top: 0; }
.article-row:last-child { border-bottom: 1px solid var(--line); }
.article-row:hover { opacity: 0.95; }

.article-row .cover-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 4px;
  background: var(--surface);
}
.article-row .cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.15);
  transition: filter 0.4s, transform 0.4s;
}
.article-row:hover .cover-wrap img {
  filter: grayscale(0);
  transform: scale(1.02);
}
.article-row .cover-wrap.no-cover {
  background: linear-gradient(135deg, var(--surface), var(--bg-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.article-row .meta-line {
  display: flex;
  gap: 12px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.article-row .meta-line .sep { color: var(--ink-mute); }
.article-row .meta-line .badge-lead {
  color: var(--primary-soft);
  border: 1px solid rgba(10,143,176,0.4);
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 0.18em;
}

.article-row h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 14px;
  color: var(--ink);
}
.article-row h2 a { color: inherit; transition: color 0.2s; }
.article-row h2 a:hover { color: var(--primary-soft); }

.article-row .excerpt {
  font-size: 16px;
  color: var(--ink-dim);
  line-height: 1.65;
  max-width: 60ch;
  margin-bottom: 16px;
}

.article-row .read-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s, color 0.2s;
}
.article-row .read-link:hover { color: var(--ink); gap: 10px; }

@media (max-width: 720px) {
  .article-row { grid-template-columns: 1fr; gap: 18px; }
  .article-row .cover-wrap { aspect-ratio: 16/9; }
}

/* Empty state */
.empty-notes {
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-dim);
}
.empty-notes h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--ink);
}

/* ============================================================
 * ARTICLE PAGE
 * ============================================================ */
.article-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.article-hero {
  padding: 40px 0 60px;
  margin-bottom: 60px;
  border-bottom: 1px solid var(--line);
  max-width: 1000px;
}
.article-hero .meta-top {
  display: flex;
  gap: 14px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 24px;
}
.article-hero .meta-top a { color: var(--ink-dim); transition: color 0.2s; }
.article-hero .meta-top a:hover { color: var(--ink); }
.article-hero .meta-top .sep { opacity: 0.5; }
.article-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 24px;
}
.article-hero .lede {
  font-size: clamp(17px, 1.5vw, 21px);
  color: var(--ink-dim);
  line-height: 1.6;
  max-width: 100%;
}

.article-cover {
  margin: 0 0 60px;
  border-radius: 4px;
  overflow: hidden;
  max-width: 1000px;
}
.article-cover img {
  width: 100%;
  height: auto;
  display: block;
}

/* Body in colonna lettura */
.article-body {
  max-width: 1000px;
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink);
}
.article-body p { margin: 0 0 1.4em; color: var(--ink); }
.article-body p:last-child { margin-bottom: 0; }
.article-body strong { font-weight: 600; color: var(--ink); }
.article-body em { color: var(--ink-dim); }
.article-body a {
  color: var(--primary-soft);
  border-bottom: 1px solid rgba(10,143,176,0.3);
  transition: border-color 0.2s, color 0.2s;
}
.article-body a:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 2em 0 0.6em;
  color: var(--ink);
}
.article-body h3 {
  font-family: var(--font-display);
  font-size: clamp(20px, 1.9vw, 24px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 1.6em 0 0.5em;
  color: var(--ink);
}
.article-body h4 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  margin: 1.4em 0 0.4em;
  color: var(--ink);
}

.article-body blockquote {
  border-left: 3px solid var(--primary);
  padding: 0.4em 0 0.4em 1.4em;
  margin: 1.6em 0;
  color: var(--ink-dim);
  font-style: italic;
  font-size: 1em;
}
.article-body blockquote p { margin: 0.4em 0; color: inherit; }

.article-body img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.6em 0;
}

.article-body ul, .article-body ol {
  margin: 1em 0 1.4em 1.6em;
  padding: 0;
}
.article-body li { margin-bottom: 0.4em; color: var(--ink); }
.article-body li::marker { color: var(--ink-mute); }

.article-body code {
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--primary-soft);
}
.article-body pre {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 18px 20px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.6em 0;
  font-size: 14px;
  line-height: 1.6;
}
.article-body pre code {
  background: transparent;
  padding: 0;
  color: var(--ink);
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.2em 0;
}

/* ============================================================
 * CTA blocks (lead articles)
 * ============================================================ */
.cta-top {
  max-width: 1000px;
  margin: 0 0 60px;
  padding: 22px 26px;
  background: rgba(0, 122, 153, 0.06);
  border: 1px solid rgba(10,143,176,0.25);
  border-radius: 6px;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.cta-top .text {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.005em;
  flex: 1;
  min-width: 240px;
}
.cta-top .btn {
  flex-shrink: 0;
}

.cta-bottom {
  max-width: 1000px;
  margin: 80px 0 0;
  padding: 48px 36px 44px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-top: 3px solid var(--primary);
  border-radius: 6px;
  position: relative;
}
.cta-bottom .cta-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary-soft);
  margin-bottom: 14px;
}
.cta-bottom h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 14px;
}
.cta-bottom .subtitle {
  font-size: 16px;
  color: var(--ink-dim);
  line-height: 1.6;
  margin: 0 0 28px;
  max-width: 56ch;
}

/* ============================================================
 * BUTTONS
 * ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary-soft);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

/* ============================================================
 * ARTICLE FOOTER (bottom navigation)
 * ============================================================ */
.article-footer {
  max-width: 1000px;
  margin: 80px 0 0;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  flex-wrap: wrap;
  gap: 16px;
}
.article-footer a {
  color: var(--ink-dim);
  transition: color 0.2s;
}
.article-footer a:hover { color: var(--ink); }

/* ============================================================
 * 404 / NOT FOUND PAGE
 * ============================================================ */
.notfound-shell {
  max-width: 700px;
  margin: 0 auto;
  padding: 100px 32px 80px;
  text-align: center;
}
.notfound-shell .code {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary-soft);
  margin-bottom: 24px;
}
.notfound-shell h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--ink);
}
.notfound-shell .lede {
  font-size: 18px;
  color: var(--ink-dim);
  line-height: 1.6;
  max-width: 50ch;
  margin: 0 auto 36px;
}
.notfound-shell .actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
 * PAGE FOOTER (layout B: una riga di dati + link + copyright)
 * ============================================================ */
.page-footer {
  position: relative;
  z-index: 2;
  margin-top: 120px;
  padding: 40px 32px 36px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.page-footer a {
  color: var(--ink-dim);
  transition: color 0.2s;
}
.page-footer a:hover { color: var(--ink); }

.page-footer .info-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 10px;
  line-height: 2;
}
.page-footer .info-line .brand {
  color: var(--ink);
  font-weight: 500;
}
.page-footer .info-line .sep {
  color: var(--ink-mute);
  opacity: 0.6;
}
.page-footer .info-line a {
  color: var(--primary-soft);
  text-transform: none;
  letter-spacing: 0.04em;
}
.page-footer .info-line a:hover { color: var(--ink); }
.page-footer .info-line .vat {
  color: var(--ink-dim);
  font-feature-settings: "tnum";
}

.page-footer .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 10px;
  align-items: center;
}
.page-footer .links .sep {
  color: var(--ink-mute);
  opacity: 0.6;
}

.page-footer .copy {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  opacity: 0.7;
}

@media (max-width: 600px) {
  .page-footer .info-line .sep,
  .page-footer .links .sep { display: none; }
  .page-footer .info-line,
  .page-footer .links {
    flex-direction: column;
    gap: 6px;
  }
}
