/* Act Local — stile "archivio Notion" in dark mode */
:root {
  --bg: #191919;
  --bg-hover: rgba(255, 255, 255, 0.055);
  --bg-soft: #202020;
  --text: rgba(255, 255, 255, 0.81);
  --text-strong: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.46);
  --line: rgba(255, 255, 255, 0.094);
  --border: rgba(255, 255, 255, 0.13);
  --link: rgba(255, 255, 255, 0.81);
  --teal: #4dab9a;
  --red: #df5452;
  --purple: #9a6dd7;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- Barra superiore ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 45px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--bg);
}
.topbar { justify-content: space-between; gap: 12px; border-bottom: 1px solid transparent; }
.crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; font-size: 14px; }
.crumbs a {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  padding: 2px 6px; border-radius: 4px;
  text-decoration: none; color: var(--text);
}
.crumbs a span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a:hover { background: var(--bg-hover); }
.crumbs .sep { color: var(--muted); padding: 0 2px; flex: 0 0 auto; }
.crumbs .ico { width: 16px; height: 16px; flex: 0 0 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; line-height: 16px; color: var(--muted); }
.crumbs .ico svg, .crumbs img.ico { width: 16px; height: 16px; object-fit: contain; }
body.nav-open .topbar { border-bottom-color: var(--line); }

/* Pulsante a panino */
.burger {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 0; border: 0; border-radius: 4px;
  background: transparent; color: var(--text);
  cursor: pointer;
}
.burger:hover { background: var(--bg-hover); }
.burger:focus-visible, .nav-link:focus-visible, .crumbs a:focus-visible { outline: 2px solid rgba(255,255,255,0.35); outline-offset: 1px; }
.burger span {
  display: block; width: 16px; height: 1.5px; border-radius: 1px;
  background: currentColor;
  transition: transform .18s ease, opacity .18s ease;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Pannello del menù */
.nav-panel {
  position: absolute; top: 44px; right: 12px;
  width: 260px;
  padding: 6px;
  background: #252525;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}
.nav-panel[hidden] { display: none; }
.nav-panel ul { list-style: none; margin: 0; padding: 0; }
.nav-panel li { padding: 0; }
.nav-link {
  display: block;
  padding: 6px 10px;
  border-radius: 4px;
  color: var(--text-strong);
  text-decoration: none;
  font-weight: 500;
}
.nav-link:hover { background: var(--bg-hover); }
.nav-link[aria-current="page"] { background: rgba(255,255,255,0.08); }
.nav-sub { margin: 0 0 4px 10px !important; padding-left: 8px !important; border-left: 1px solid var(--line); }
.nav-link.sub { color: var(--muted); font-weight: 400; padding: 4px 10px; }
.nav-link.sub:hover, .nav-link.sub[aria-current="page"] { color: var(--text-strong); }

@media (max-width: 720px) {
  .nav-panel {
    position: fixed; top: 45px; left: 0; right: 0; bottom: 0;
    width: auto; border: 0; border-radius: 0; box-shadow: none;
    background: var(--bg);
    padding: 16px 18px;
    font-size: 18px;
  }
  .nav-link { padding: 10px 8px; }
  .nav-link.sub { padding: 8px 8px; }
  body.nav-open { overflow: hidden; }
}

/* ---------- Pagina ---------- */
.page {
  width: 100%;
  padding: 0 96px 120px;
}
@media (max-width: 720px) { .page { padding: 0 24px 80px; } }

.page-icon {
  display: block;
  font-size: 72px;
  line-height: 1;
  margin: 72px 0 8px;
  width: 78px; height: 78px;
}
.page-icon svg, .page-icon img { width: 78px; height: 78px; object-fit: contain; }
.page-icon svg { color: var(--muted); }

h1.title {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-strong);
  margin: 0 0 12px;
  padding-top: 4px;
}

h2 { font-size: 1.5em; font-weight: 600; line-height: 1.3; color: var(--text-strong); margin: 1.6em 0 4px; }
h4 { font-size: 1.1em; font-weight: 600; line-height: 1.3; color: var(--text-strong); margin: 1.2em 0 4px; }
p { margin: 2px 0; padding: 3px 2px; min-height: 1em; white-space: pre-wrap; }
p a, li a { text-decoration: underline; text-decoration-color: rgba(255,255,255,0.3); text-underline-offset: 2px; }
p a:hover, li a:hover { text-decoration-color: var(--text); }
strong { font-weight: 600; color: var(--text-strong); }

ul, ol { margin: 2px 0; padding-left: 1.7em; }
li { padding: 3px 0; }
li::marker { color: var(--text); }

hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.spacer { height: 1.5em; }

/* ---------- Colonne ---------- */
.columns { display: flex; gap: 46px; width: 100%; }
.columns > .col { flex: 1 1 0; min-width: 0; }
.columns.tight { gap: 12px; }
@media (max-width: 720px) {
  .columns { flex-direction: column; gap: 4px; }
  .columns.tight { flex-direction: row; gap: 12px; flex-wrap: wrap; }
}

/* ---------- Toggle ---------- */
details.toggle { margin: 2px 0; }
details.toggle > summary {
  list-style: none;
  display: flex; align-items: center; gap: 4px;
  cursor: pointer;
  padding: 3px 2px;
  border-radius: 4px;
  user-select: none;
}
details.toggle > summary::-webkit-details-marker { display: none; }
details.toggle > summary .tri {
  width: 22px; height: 22px; flex: 0 0 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  transition: transform .15s ease;
}
details.toggle > summary .tri:hover { background: var(--bg-hover); }
details.toggle > summary .tri svg { width: 10px; height: 10px; fill: currentColor; transform: rotate(90deg); transition: transform .15s ease; }
details.toggle[open] > summary .tri svg { transform: rotate(180deg); }
details.toggle > .toggle-body { padding-left: 26px; }
details.toggle.gray > summary { color: var(--muted); }
details.toggle.gray-bg { background: rgba(255,255,255,0.035); border-radius: 4px; }

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px;
  padding: 0 8px;
  margin: 4px 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .1s ease;
}
.btn:hover { background: var(--bg-hover); }
.btn:active { background: rgba(255,255,255,0.09); }
.btn .emo { font-size: 13px; line-height: 1; }
.btn svg { width: 16px; height: 16px; color: var(--muted); }
.btn.teal { color: var(--teal); }
.btn.red { color: var(--red); }
.btn.purple { color: var(--purple); }
.btn.gray { color: var(--muted); }
.btn-row { display: flex; flex-direction: column; align-items: flex-start; }

/* ---------- Link a sottopagine ---------- */
a.subpage {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 2px;
  margin: 1px 0;
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
}
a.subpage:hover { background: var(--bg-hover); }
a.subpage .ico { width: 20px; height: 20px; flex: 0 0 20px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
a.subpage .ico svg, a.subpage .ico img { width: 18px; height: 18px; object-fit: contain; }
a.subpage .label { border-bottom: 1px solid rgba(255,255,255,0.2); font-weight: 500; line-height: 1.3; }

/* ---------- Media ---------- */
figure.image { margin: 8px 0; }
figure.image img { display: block; max-width: 100%; border-radius: 2px; }
.embed {
  width: 100%;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-soft);
}
.embed iframe { display: block; width: 100%; border: 0; }
.embed.ig iframe { height: 620px; background: #fff; }
.embed-caption { font-size: 12px; color: var(--muted); padding: 6px 2px; }

.muted { color: var(--muted); }

/* ---------- Approfondimenti: galleria articoli ---------- */
.gallery-head {
  display: flex; align-items: center; gap: 6px;
  margin: 20px 0 8px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-weight: 500; color: var(--text-strong);
}
.gallery-head .gh-ico { display: inline-flex; width: 16px; height: 16px; color: var(--muted); }
.gallery-head .gh-ico svg { width: 16px; height: 16px; }
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 12px 0 8px;
}
.card {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #202020;
  text-decoration: none; color: var(--text);
  transition: background .12s ease;
}
.card:hover { background: #262626; }
.card-cover { aspect-ratio: 16 / 10; background: #2a2a2a; overflow: hidden; border-bottom: 1px solid var(--line); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.card-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-strong); line-height: 1.35; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; } /* tutta la scheda è cliccabile */
.card-title a:focus-visible { outline: none; }
.card:focus-within { outline: 2px solid rgba(255,255,255,0.35); outline-offset: 1px; }
.card[hidden] { display: none; }
.card-desc { color: var(--muted); font-size: 13px; line-height: 1.45; }
.card-meta { font-size: 12px; color: var(--muted); }
.card-tags { display: flex; flex-wrap: wrap; gap: 4px; position: relative; z-index: 1; }
.tag {
  display: inline-block;
  padding: 0 6px; border-radius: 3px;
  font-size: 12px; line-height: 20px;
  background: rgba(255,255,255,0.08); color: var(--text);
  text-decoration: none;
  transition: background .1s ease;
}
a.tag:hover { background: rgba(255,255,255,0.16); }
.tag.is-active { background: rgba(255,255,255,0.85); color: #191919; }

/* ---------- Filtri per tag ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 2px; }
.filters-label { color: var(--muted); font-size: 13px; margin-right: 4px; }
.filter-chip, .filter-clear {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: 13px;
  background: transparent; color: var(--text);
  font: inherit; font-size: 13px;
  cursor: pointer;
  transition: background .1s ease, color .1s ease, border-color .1s ease;
}
.filter-chip:hover, .filter-clear:hover { background: var(--bg-hover); }
.filter-chip .count { color: var(--muted); font-size: 12px; }
.filter-chip[aria-pressed="true"] { background: rgba(255,255,255,0.85); border-color: transparent; color: #191919; }
.filter-chip[aria-pressed="true"] .count { color: rgba(0,0,0,0.55); }
.filter-chip:focus-visible, .filter-clear:focus-visible, a.tag:focus-visible { outline: 2px solid rgba(255,255,255,0.35); outline-offset: 1px; }
.filter-clear { border-style: dashed; color: var(--muted); }
.filter-clear[hidden] { display: none; }
.filter-status { font-size: 13px; margin: 6px 0 0; }
.filter-status[hidden] { display: none; }

/* ---------- Pagina articolo ---------- */
.page.narrow { max-width: 900px; margin: 0 auto; }
.page.narrow > h1.title { margin-top: 72px; }
.article { font-size: 16px; line-height: 1.65; }
.article h1.title { font-size: 36px; }
.article p { white-space: normal; margin: 4px 0; padding: 4px 2px; }
.article li { padding: 4px 0; }
.article figure.image { margin: 16px 0; }
.article figure.image img { margin: 0 auto; border-radius: 4px; }
.article figcaption { font-size: 13px; color: var(--muted); line-height: 1.5; padding: 8px 2px 0; }
.props { margin: 8px 0 4px; font-size: 14px; }
.props > div { display: flex; align-items: center; min-height: 34px; }
.props dt { width: 140px; flex: 0 0 140px; color: var(--muted); }
.props dd { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.embed.spotify { border: 0; background: transparent; border-radius: 12px; }
.embed.spotify iframe { border-radius: 12px; }
@media (max-width: 720px) {
  .page.narrow > h1.title { margin-top: 40px; }
  .article h1.title { font-size: 28px; }
  .props dt { width: 90px; flex-basis: 90px; }
}

/* ---------- Testata: percorso visibile solo allo scroll (o al passaggio del mouse) ---------- */
.topbar .crumbs { opacity: 0; transition: opacity .2s ease; }
.topbar:hover .crumbs,
.topbar .crumbs:focus-within,
.topbar.scrolled .crumbs { opacity: 1; }
.topbar { transition: border-color .2s ease; }
.topbar.scrolled { border-bottom-color: var(--line); }
@media (hover: none) { .topbar:hover .crumbs { opacity: 0; } .topbar.scrolled .crumbs { opacity: 1; } }
/* solo l'ultima voce del percorso si accorcia con i puntini */
.crumbs a { flex: 0 0 auto; }
.crumbs a:last-child { flex: 0 1 auto; min-width: 0; }
@media (max-width: 720px) {
  .crumbs a:not(:first-child):not(:last-child) > span:last-child { display: none; } /* su mobile le voci intermedie mostrano solo l'icona */
}
.article a { overflow-wrap: anywhere; }
a.subpage .ico.emoji { font-size: 16px; line-height: 20px; }

/* ---------- Reel (Oltre i CPR): solo video ---------- */
.reel {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 9 / 16;
  margin: 8px 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.reel video, .reel > img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  cursor: pointer;
}
.reel-play {
  position: absolute; left: 50%; top: 50%;
  width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity .2s ease, background .15s ease;
}
.reel-play:hover { background: rgba(0, 0, 0, 0.6); }
.reel-play svg { width: 26px; height: 26px; margin-left: 3px; }
.reel.is-playing .reel-play { opacity: 0; pointer-events: none; }
.reel-play:focus-visible, .reel-ig:focus-visible { outline: 2px solid #fff; outline-offset: 2px; opacity: 1; }

.reel-progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 14px;               /* area cliccabile */
  display: flex; align-items: flex-end;
  cursor: pointer;
}
.reel-progress span {
  display: block; height: 3px; width: 0;
  background: rgba(255, 255, 255, 0.85);
}
.reel-progress::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(255, 255, 255, 0.18);
}

.reel-ig {
  position: absolute; right: 10px; bottom: 12px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.9);
  opacity: 0.75;
  transition: opacity .15s ease, background .15s ease;
}
.reel-ig:hover { opacity: 1; background: rgba(0, 0, 0, 0.55); }
.reel-ig svg { width: 17px; height: 17px; }
@media (max-width: 720px) { .reel { max-width: min(100%, calc(78vh * 9 / 16)); margin-left: auto; margin-right: auto; } }

/* griglia dei reel: ogni riga allineata, didascalie di lunghezza diversa non spostano i video */
.reel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 46px;
  row-gap: 0;
  align-items: stretch; /* stessa altezza per riga: video in alto e linee di separazione allineate */
}
.reel-item { padding: 8px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.reel-item .reel { margin-top: 0; }
@media (max-width: 720px) { .reel-grid { grid-template-columns: 1fr; } }
