/*
 * PartyCrime — stile delle Guide (indice e articoli) e dei riquadri "Dalle guide" della pagina iniziale.
 * Si appoggia alle variabili di style.css. Le pagine sono generate da scripts/build-guides.mjs.
 * Dopo una modifica aumenta il numero in "guide.css?v=N" (in scripts/build-guides.mjs e site/index.html).
 */
.g-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 32px;
}
.g-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ───────── Barra di avanzamento della lettura ───────── */
.g-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 3px;
  pointer-events: none;
}
.g-progress span {
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

/* ───────── Etichette di categoria ───────── */
.g-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}
.g-chip--delitto {
  color: var(--blood-light);
  border-color: color-mix(in srgb, var(--blood-light) 45%, transparent);
  background: rgba(160, 48, 56, 0.18);
}
.g-chip--impostore {
  color: var(--gold-light);
  border-color: rgba(231, 198, 94, 0.45);
  background: rgba(201, 162, 39, 0.12);
}
.g-chip--idee {
  color: var(--ok-light);
  border-color: rgba(108, 192, 139, 0.45);
  background: rgba(63, 143, 95, 0.14);
}
a.g-chip:hover {
  filter: brightness(1.2);
}

/* ───────── Articolo: testata ───────── */
.g-hero {
  padding-top: 20px;
}
.g-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
}
.g-crumbs a {
  color: var(--muted);
  text-decoration: none;
}
.g-crumbs a:hover {
  color: var(--gold-light);
}
.g-hero-media {
  position: relative;
  max-height: 440px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  aspect-ratio: 1200 / 630;
}
.g-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18, 16, 19, 0) 55%, rgba(18, 16, 19, 0.55));
}
.g-hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.g-hero-body {
  display: flex;
  max-width: 820px;
  flex-direction: column;
  gap: 14px;
  padding: 26px 0 8px;
}
.g-hero h1,
.g-idx-hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(30px, 5.2vw, 50px);
  font-weight: 700;
  line-height: 1.1;
  color: #f6f0e4;
}
.g-lead {
  margin: 0;
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.6;
  color: #cfc7bb;
}
.g-lead strong {
  color: var(--cream);
}
.g-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  font-size: 14px;
  color: var(--muted);
}
.g-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cream);
  font-weight: 600;
}
.g-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(201, 162, 39, 0.5);
  border-radius: 50%;
  background: var(--panel);
  color: var(--gold-light);
}
.g-avatar svg {
  width: 16px;
  height: 16px;
}
.g-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.g-share-btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font: 600 14px var(--font-sans);
  color: var(--cream);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.g-share-btn:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  background: rgba(201, 162, 39, 0.07);
}

/* ───────── Articolo: corpo e sommario ───────── */
.g-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 20px;
}
.g-side {
  align-self: start;
}
.g-toc {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}
.g-toc summary {
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.g-toc summary::-webkit-details-marker {
  display: none;
}
.g-toc summary::after {
  content: "▾";
  transition: transform 0.2s;
}
.g-toc[open] summary::after {
  transform: rotate(180deg);
}
.g-toc ol {
  margin: 0;
  padding: 0 10px 12px;
  list-style: none;
  counter-reset: t;
}
.g-toc li {
  counter-increment: t;
}
.g-toc a {
  display: flex;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 14.5px;
  line-height: 1.35;
  color: #d1c9be;
  text-decoration: none;
}
.g-toc a::before {
  content: counter(t);
  flex: none;
  min-width: 1.2em;
  font-weight: 700;
  color: var(--muted);
}
.g-toc a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
}
.g-toc a[aria-current="true"] {
  background: rgba(201, 162, 39, 0.1);
  color: var(--gold-light);
}
.g-toc a[aria-current="true"]::before {
  color: var(--gold-light);
}

.g-article {
  font-size: 18px;
  line-height: 1.8;
  color: #d9d2c7;
}
.g-article > * {
  max-width: 680px;
}
.g-article p {
  margin: 0 0 1.15em;
}
.g-article h2 {
  position: relative;
  margin: 2.4em 0 0.6em;
  padding-top: 1.1em;
  font-family: var(--font-display);
  font-size: clamp(25px, 3.6vw, 32px);
  line-height: 1.2;
  color: #f6f0e4;
  scroll-margin-top: 24px;
}
.g-article h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--blood-light));
}
.g-article h2:first-child {
  margin-top: 0.4em;
}
.g-article h3 {
  margin: 1.8em 0 0.4em;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold-light);
}
.g-article strong {
  font-weight: 600;
  color: var(--cream);
}
.g-article a {
  color: var(--gold-light);
  text-decoration: underline;
  text-decoration-color: rgba(231, 198, 94, 0.5);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.g-article a:hover {
  color: var(--cream);
  text-decoration-color: currentColor;
}

/* elenchi puntati: segno dorato */
.g-article ul {
  margin: 0 0 1.3em;
  padding: 0;
  list-style: none;
}
.g-article ul li {
  position: relative;
  margin: 0.55em 0;
  padding-left: 26px;
}
.g-article ul li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}
/* elenchi numerati: numeri in evidenza, ottimi per i passaggi */
.g-article ol {
  margin: 0 0 1.4em;
  padding: 0;
  list-style: none;
  counter-reset: n;
}
.g-article ol li {
  position: relative;
  min-height: 36px;
  margin: 1em 0;
  padding-left: 52px;
  counter-increment: n;
}
.g-article ol li::before {
  content: counter(n);
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  font: 700 15px var(--font-sans);
  color: var(--ink);
}

/* riquadri "Consiglio" / "Attenzione" / "Nota" */
.g-callout {
  margin: 1.8em 0;
  padding: 18px 20px 18px 22px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-left: 4px solid var(--gold);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.1), rgba(201, 162, 39, 0.04));
}
.g-article .g-callout p {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.7;
  color: #e9e2d5;
}
.g-article .g-callout .g-callout-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.g-callout--attenzione {
  border-color: color-mix(in srgb, var(--blood-light) 40%, transparent);
  border-left-color: var(--blood-light);
  background: linear-gradient(180deg, rgba(160, 48, 56, 0.2), rgba(160, 48, 56, 0.06));
}
.g-article .g-callout--attenzione .g-callout-title {
  color: var(--blood-light);
}
.g-article blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--line-strong);
  font-style: italic;
}

/* ───────── Invito finale, precedente/successiva, correlate ───────── */
.g-cta {
  position: relative;
  margin: 56px 0 0;
  overflow: hidden;
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(18, 16, 19, 0.95) 30%, rgba(18, 16, 19, 0.55)),
    var(--cover) center / cover no-repeat,
    var(--panel);
}
.g-cta > div {
  max-width: 640px;
  padding: 40px 28px;
}
.g-cta h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.15;
  color: #f6f0e4;
}
.g-cta p {
  margin: 0 0 20px;
  font-size: 17px;
  line-height: 1.6;
  color: #d6cec2;
}
.g-prevnext {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 28px;
}
.g-prevnext a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--card), var(--panel));
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.g-prevnext a:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.g-prevnext a span {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.g-prevnext a strong {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.3;
  color: var(--cream);
}
.g-related,
.g-games {
  margin-top: 56px;
}
.g-related h2,
.g-games h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 32px);
  color: #f6f0e4;
}

/* ───────── Riquadri (indice, correlate, home) ───────── */
.g-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.g-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--card), var(--panel));
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.g-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}
.g-card[hidden],
.g-featured[hidden] {
  display: none;
}
.g-card-media {
  display: block;
  overflow: hidden;
  background: var(--ink);
  aspect-ratio: 1200 / 630;
}
.g-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.g-card:hover .g-card-media img {
  transform: scale(1.05);
}
.g-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px 20px;
}
.g-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.25;
  color: var(--cream);
}
.g-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--muted);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.g-card-meta {
  margin-top: auto;
  padding-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-light);
}

/* ───────── Indice ───────── */
.g-idx-hero {
  max-width: 820px;
  padding: 40px 0 8px;
}
.g-idx-hero .eyebrow {
  margin-bottom: 10px;
}
.g-idx-hero h1 {
  margin-bottom: 14px;
  font-size: clamp(34px, 6vw, 56px);
}
.g-tools {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 26px;
}
.g-tools[hidden] {
  display: none;
}
.g-search input {
  width: 100%;
  max-width: 460px;
  padding: 14px 16px 14px 46px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3aaa2' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 15px center / 20px no-repeat;
  font: inherit;
  font-size: 16px;
  color: var(--cream);
}
.g-search input::placeholder {
  color: var(--muted);
}
.g-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.g-filter {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font: 600 14px var(--font-sans);
  color: var(--cream);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.g-filter span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.g-filter:hover {
  border-color: var(--gold);
}
.g-filter[aria-pressed="true"] {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}
.g-filter[aria-pressed="true"] span {
  color: rgba(18, 16, 19, 0.7);
}

.g-featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 32px 0 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--card), var(--panel));
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.g-featured:hover {
  border-color: var(--gold);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}
.g-featured-media {
  display: block;
  min-height: 220px;
  overflow: hidden;
}
.g-featured-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.g-featured:hover .g-featured-media img {
  transform: scale(1.04);
}
.g-featured-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 26px 24px 28px;
}
.g-badge {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.g-featured h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1.15;
  color: #f6f0e4;
}
.g-featured p {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: #cfc7bb;
}
.g-empty {
  padding: 28px 0;
  text-align: center;
  color: var(--muted);
}
.g-empty[hidden] {
  display: none;
}
.g-games-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.g-game {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(160, 48, 56, 0.22), transparent 70%),
    linear-gradient(180deg, var(--card), var(--panel));
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}
.g-game:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
}
.g-game strong {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold-light);
}
.g-game span {
  color: var(--muted);
}
.g-game em {
  margin-top: 6px;
  font-style: normal;
  font-weight: 600;
  color: var(--cream);
}

/* ───────── Pagina iniziale: sezione "Dalle guide" ───────── */
.guide-home {
  padding: 48px 0 8px;
}
.guide-all {
  margin: 18px 0 0;
  text-align: center;
}
.guide-all a {
  color: var(--gold-light);
}

/* ───────── Schermi larghi ───────── */
@media (min-width: 700px) {
  .g-prevnext {
    grid-template-columns: 1fr 1fr;
  }
  .g-next {
    text-align: right;
  }
  .g-cta > div {
    padding: 48px 44px;
  }
}
@media (min-width: 860px) {
  .g-featured {
    grid-template-columns: 1.15fr 1fr;
  }
  .g-featured-body {
    padding: 34px 36px;
  }
}
@media (min-width: 980px) {
  .g-layout {
    grid-template-columns: minmax(0, 680px) 280px;
    justify-content: center;
    gap: 64px;
    margin-top: 36px;
  }
  .g-article {
    order: 1;
  }
  .g-side {
    position: sticky;
    top: 24px;
    order: 2;
  }
  .g-toc {
    max-height: calc(100vh - 48px);
    overflow: auto;
  }
  .g-toc summary {
    pointer-events: none;
  }
  .g-toc summary::after {
    display: none;
  }
}
@media (max-width: 600px) {
  .g-article {
    font-size: 17px;
    line-height: 1.75;
  }
  .g-hero-media {
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .g-card,
  .g-card-media img,
  .g-featured,
  .g-featured-media img,
  .g-prevnext a,
  .g-game,
  .g-share-btn {
    transition: none;
  }
  .g-card:hover,
  .g-prevnext a:hover,
  .g-game:hover {
    transform: none;
  }
  .g-card:hover .g-card-media img,
  .g-featured:hover .g-featured-media img {
    transform: none;
  }
}
