/* clubmc.world — the material layer: header, buttons, stamps, marginalia.
   Rule of the project: the frame is material, the data is not. */

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--gold); color: var(--ink); padding: .6rem 1rem;
  font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- header */
/* Sticky header: resta in cima ma non copre il contenuto grazie a
   padding-top su #main (vedi più sotto). */
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: var(--ink);
  border-bottom: 1px solid var(--gold-lo);
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  min-height: var(--header-h);
}
.site-header .header-wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0.6rem 1.2rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.header-brand { flex-shrink: 0; }
.header-right { flex-shrink: 0; display: flex; align-items: center; gap: .5rem; }
.brand {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.05rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); text-decoration: none; white-space: nowrap;
}

/* desktop: stats al centro; mobile: nascoste */
.site-stats {
  display: none;
  flex-wrap: wrap; gap: 1rem; align-items: center;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em;
}
.site-stats span:nth-child(2), .site-stats span:nth-child(4) { color: var(--cream); font-variant-numeric: tabular-nums; }
.site-stats span:nth-child(1), .site-stats span:nth-child(3) { color: var(--gold); text-transform: uppercase; }
.site-stats span:nth-child(3) { color: var(--gold); }
.site-stats span:nth-child(4) { color: #F0D88A; }

.nav { display: flex; align-items: center; gap: 1.1rem; }
.nav a {
  font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--cream-dim);
}
.nav a:hover { color: var(--gold); text-decoration: none; }
.nav-toggle {
  display: block; background: none; border: 1px solid var(--gold-lo);
  color: var(--gold); width: 42px; height: 38px; cursor: pointer;
  font-family: var(--font-mono); font-size: 1rem;
  z-index: 100;
}
.nav-shell {
  position: fixed; inset: 0; z-index: 95; overflow: hidden;
  visibility: hidden; background: rgba(10, 10, 10, .85);
}
.nav-shell[data-open="true"] { visibility: visible; }
.nav {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(340px, 88vw);
  background: var(--ink); border-left: 1px solid var(--gold-lo);
  flex-direction: column; align-items: flex-start;
  gap: 0; padding: 1.5rem 1.2rem 4rem; overflow-y: auto;
  transform: translateX(100%); transition: transform .25s ease;
}
.nav[data-open="true"] { transform: translateX(0); }
.nav a {
  padding: .9rem 0; border-bottom: 1px solid var(--rule-soft); width: 100%;
  font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--cream-dim);
}
.nav a:hover { color: var(--gold); text-decoration: none; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-block;
  background: var(--gold); color: var(--ink);
  font-family: var(--font-mono); font-weight: 700;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .12em;
  padding: .8rem 1.4rem; border: 0; border-radius: var(--radius);
  cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 0 #1a1a1a, 0 6px 12px rgba(0, 0, 0, .6);
  transition: transform .1s, box-shadow .1s, background .2s;
}
.btn:hover { background: var(--gold-hi); text-decoration: none; }
.btn:active { box-shadow: inset 0 3px 6px rgba(0, 0, 0, .8); transform: translateY(2px); }
.btn.ghost {
  background: transparent; color: var(--gold);
  border: 1px solid var(--gold-lo); box-shadow: none;
}
.btn.ghost:hover { background: rgba(212, 175, 55, .08); }
.btn.small { padding: .5rem .9rem; font-size: .68rem; }

/* ---------------------------------------------------------------- stamps */
.stamp {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--font-mono); font-size: .64rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  padding: .2rem .55rem; border: 2px solid currentColor; border-radius: 2px;
  transform: rotate(-3deg);
  background: rgba(10, 10, 10, .6);
}
.stamp::before { content: "\2713"; font-size: .8em; }
.stamp.active    { color: var(--verif); }
.stamp.contested { color: var(--contest); }
.stamp.unverified{ color: var(--unverif); }
.stamp.excluded  { color: var(--excl); }
.stamp.contested::before  { content: "!"; }
.stamp.unverified::before { content: "?"; }
.stamp.excluded::before   { content: "\2298"; }
.stamp.active::before     { content: "\2713"; }

/* ---------------------------------------------------------------- marginalia */
.marginalia {
  font-family: var(--font-mono); font-size: .78rem; color: var(--cream-dim);
  border-left: 2px solid var(--rule); padding-left: .8rem;
}

/* ------------------------------------------------------------------- cards */
.card { background: var(--ink-2); border: 1px solid var(--ink-4); padding: 1.1rem 1.2rem; }
.card h3 {
  font-family: var(--font-display); color: var(--gold); font-size: 1rem;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: .4rem;
}
.card p { font-size: .88rem; color: var(--cream-dim); }
.card .counter { margin-bottom: .3rem; }

/* the small uppercase label above a title */
.kicker {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold); margin-bottom: .5rem;
}

/* ---------------------------------------------------------------- layout */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.2rem; }
.section { padding: 3.5rem 0; border-top: 1px solid var(--rule-soft); }
.section > h2 {
  font-family: var(--font-display); color: var(--gold);
  font-size: 1.35rem; letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: .6rem;
}
.lede { color: var(--cream-dim); max-width: 62ch; }
.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--gold-lo);
  padding: 2rem 1.2rem 1.2rem;
  font-size: .78rem; color: var(--cream-dim);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; margin-bottom: 1rem; }
.site-footer a { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; font-size: .68rem; }

/* persistent legal bar (mobile) — thin, never on top of the map */
.legal-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  background: rgba(10, 10, 10, .96);
  border-top: 1px solid var(--rule);
  padding: .35rem .8rem calc(.35rem + env(safe-area-inset-bottom));
  display: none; justify-content: center; gap: 1rem;
  font-family: var(--font-mono); font-size: .64rem; text-transform: uppercase; letter-spacing: .08em;
}
@media (max-width: 860px) { .legal-bar { display: flex; } body { padding-bottom: 2.4rem; } }

/* ---------------------------------------------------------------- shell (guscio)
   Mobile first: NESSUN guscio 9:16 soffocante. Su mobile il contenuto
   scorre a piena larghezza dentro il guscio; su desktop/tablet il guscio
   diventa 16:9 con margini laterali. */
#shell {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: var(--ink);
  border: 1px solid var(--ink-4);
  box-shadow: 0 0 0 1px var(--ink-4), 0 24px 60px rgba(0,0,0,.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  margin: 0 auto;
}
#shell-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  box-sizing: border-box;
}

/* niente sbordature: testo, tabelle, media */
#shell-body,
#shell-body * {
  max-width: 100%;
  box-sizing: border-box;
}
#shell-body p,
#shell-body h1, #shell-body h2, #shell-body h3, #shell-body h4, #shell-body h5, #shell-body h6,
#shell-body li, #shell-body td, #shell-body th, #shell-body span, #shell-body div {
  overflow-wrap: anywhere;
  word-break: normal;
}
#shell-body table {
  display: block;
  overflow-x: auto;
  width: auto;
  min-width: 100%;
  white-space: nowrap;
}
#shell-body img,
#shell-body video,
#shell-body iframe,
#shell-body object,
#shell-body embed {
  max-width: 100%;
  height: auto;
  display: block;
}

/* desktop e tablet: il guscio passa a 16:9 con margini laterali */
@media (min-width: 900px) {
  #shell {
    height: auto;
    min-height: calc(100svh - var(--header-h) - 2rem);
    aspect-ratio: 16 / 9;
    max-width: 1280px;
    margin: 1rem auto;
    border-radius: 3px;
  }
  #shell-body {
    padding: 1.6rem;
  }
  .site-stats {
    display: flex;
  }
}

/* mobile: header compatto, logo più piccolo, hamburger accessibile */
@media (max-width: 899px) {
  .site-header .header-wrap {
    padding: 0.5rem 1rem;
    gap: 0.4rem;
  }
  .brand {
    font-size: 0.9rem;
    white-space: nowrap;
  }
  .header-right .nav-toggle {
    width: 36px;
    height: 32px;
    font-size: 0.9rem;
  }
  .nav-shell {
    width: min(280px, 92vw);
  }
}

/* ---------------------------------------------------------------- header overlay fix */
/* #main deve avere padding-top pari all'altezza dell'header sticky
   affinché il contenuto non venga coperto durante lo scroll. */
#main {
  padding-top: var(--header-h);
}
