/* ==========================================================================
   Stile del sito principale — "Moderno minimal".
   Colori e font vengono da tokens.css (generato da Sites/tools/sync.mjs),
   condiviso con i siti di appunti Quartz. Niente !important.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  color: var(--heading);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.3rem;
  margin: 2.5rem 0 1rem;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main.container {
  padding-top: 2.5rem;
  min-height: 60vh;
}

.lead {
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 1rem;
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 1.5rem;
}

/* --- Skip link --- */
.skip-to-content {
  position: absolute;
  left: 0;
  top: -100px;
  z-index: 1000;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 6px 0;
}

.skip-to-content:focus {
  top: 0;
}

/* --- Barra del sito (identica a quella dei siti Quartz) --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1rem, 3vw, 2rem);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.topbar a {
  text-decoration: none;
}

.brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--heading);
  white-space: nowrap;
}

.brand-dot {
  color: var(--accent);
  margin-right: 0.35rem;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.topbar ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.topbar nav a {
  display: block;
  padding: 0.35rem 0.6rem;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.topbar nav a:hover {
  color: var(--heading);
  background: var(--surface);
}

.topbar nav a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-left: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--heading);
  font-size: 1rem;
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--surface);
}

@media (max-width: 640px) {
  .topbar {
    gap: 0.5rem;
  }
  .brand-name,
  .topbar li:first-child {
    display: none;
  }
  .topbar nav a {
    padding: 0.35rem 0.45rem;
    font-size: 0.85rem;
  }
}

/* --- Hero --- */
.hero {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.avatar {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.hero h1 {
  margin-bottom: 0.4rem;
}

@media (max-width: 560px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- Pulsanti --- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.btn-secondary {
  border: 1px solid var(--border);
  color: var(--heading);
}

.btn-secondary:hover {
  background: var(--surface);
  color: var(--heading);
}

/* --- Card e griglia --- */
.grid,
.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 0.9rem;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px var(--shadow);
}

.card-title {
  font-size: 1.02rem;
  margin: 0 0 0.25rem;
}

.card-sub {
  flex-grow: 1;
  margin: 0 0 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-link {
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.pill {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
}

/* --- Chi sono --- */
.block h2 {
  margin-top: 2rem;
}

.stack {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.25rem;
  margin: 0;
}

.stack dt {
  font-weight: 600;
  color: var(--heading);
}

.stack dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

@media (max-width: 560px) {
  .stack {
    grid-template-columns: 1fr;
  }
  .stack dd {
    margin-bottom: 0.6rem;
  }
}

/* --- 404 --- */
.empty {
  padding: 3rem 0;
}

/* --- Footer --- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 4rem;
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}
