/* =========================================================
   lanaro.io — tutto lo stile del sito.
   Per cambiare colori e font modifica solo le variabili qui sotto.
   ========================================================= */

:root {
  /* Colori */
  --bg: #ffffff;
  --text: #24231f;
  --muted: #77746c;
  --line: #e8e6e1;
  --accent: #2c5a85;          /* link */
  --accent-hover: #173a5c;

  /* Font (caricati in base.njk da fonts.bunny.net) */
  --font-text: "Literata", Georgia, serif;
  --font-ui: "Inter", system-ui, -apple-system, sans-serif;

  /* Misure */
  --size-text: 1.125rem;
  --line-height: 1.7;
  --width: 40rem;             /* larghezza colonna di testo */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191917;
    --text: #e6e3dc;
    --muted: #9a968c;
    --line: #33322e;
    --accent: #8db6dd;
    --accent-hover: #b9d4ee;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: calc(var(--width) + 3rem);
  padding: 0 1.5rem;
  background: var(--bg);
  color: var(--text);
  font: var(--size-text) / var(--line-height) var(--font-text);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { line-height: 1.25; font-weight: 600; }
h1 { font-size: 2rem; margin: 0 0 1rem; }
h2 { font-size: 1.35rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 2rem 0 0.5rem; }

img { max-width: 100%; height: auto; border-radius: 4px; }

/* ---------- Header e footer ---------- */
.site-header, .site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
}
.site-header { padding: 2rem 0 3.5rem; }
.site-footer {
  margin-top: 5rem;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
.site-header nav, .site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-header a, .site-footer a { color: inherit; text-decoration: none; }
.site-header a:hover, .site-footer a:hover, .site-header [aria-current="page"] { color: var(--accent); }
.site-name { font-weight: 500; }
.site-footer p { margin: 0; }

/* ---------- Elenchi di post ---------- */
.lead { color: var(--muted); }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.4rem 0;
}
.post-list a { text-decoration: none; }
.post-list a:hover { text-decoration: underline; }
.post-list time {
  flex-shrink: 0;
  color: var(--muted);
  font: 0.85rem var(--font-ui);
  font-variant-numeric: tabular-nums;
}

/* Anno in colonna a sinistra sugli schermi larghi */
.year h2 { color: var(--muted); font: 500 0.95rem var(--font-ui); margin: 2.5rem 0 0.5rem; }
@media (min-width: 60rem) {
  .year { position: relative; }
  .year h2 { position: absolute; left: -6rem; top: 0.45rem; margin: 0; }
  .year + .year { margin-top: 2rem; }
}

.tag {
  display: inline-block;
  margin: 0 0.6rem 0.3rem 0;
  font: 0.85rem var(--font-ui);
  color: var(--muted);
  text-decoration: none;
}
.tag::before { content: "#"; opacity: 0.6; }
.tag:hover { color: var(--accent); }
.tag-cloud { margin-bottom: 1rem; }

/* ---------- Singolo post ---------- */
.post-header { margin-bottom: 2.5rem; }
.meta { color: var(--muted); font: 0.9rem var(--font-ui); }
.meta time { margin-right: 1rem; }

.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
  font-style: italic;
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.prose code { font-size: 0.9em; background: var(--line); padding: 0.1em 0.3em; border-radius: 3px; }
.prose pre { overflow-x: auto; background: var(--line); padding: 1rem; border-radius: 4px; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.4rem 0.7rem; }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.post-nav a { text-decoration: none; line-height: 1.4; }
.post-nav span { display: block; color: var(--muted); font: 0.8rem var(--font-ui); margin-bottom: 0.25rem; }
.post-nav .older { text-align: right; grid-column: 2; }

@media (max-width: 30rem) {
  :root { --size-text: 1.0625rem; }
  h1 { font-size: 1.65rem; }
  .post-list li { flex-direction: column; gap: 0; }
}

/* ---------- Pagine di risorse ---------- */
.prose h2[id] { margin-top: 3rem; scroll-margin-top: 1.5rem; }
.prose h2 a { text-decoration: none; color: var(--text); }
.prose h2 a:hover { color: var(--accent); }
.item-meta { margin-top: -0.4rem; color: var(--muted); font: 0.85rem var(--font-ui); }
.count { color: var(--muted); font: 0.85rem var(--font-ui); }
:target { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ---------- Episodi del podcast ---------- */
.episodi { list-style: none; padding: 0; }
.episodi li { padding: 0.3rem 0; }
.episodi a { text-decoration: none; }
.episodi span { display: inline-block; width: 3.5rem; color: var(--muted); font: 0.85rem var(--font-ui); font-variant-numeric: tabular-nums; }
