/* Palette "Preistorica Calda", la stessa del client (client/autoload/theme_palette.gd). */
@font-face { font-family: "Cinzel"; src: url("fonts/cinzel.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("fonts/alegreya-sans.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  --earth-dark: #2e1f14;
  --earth-mid: #47331f;
  --earth-light: #614733;
  --terracotta: #c75933;
  --terracotta-light: #e67a4d;
  --ochre: #cc9933;
  --ochre-light: #f2bf59;
  --sand: #ebd19e;
  --bone: #f2e6c7;
  --bone-dim: #bfb299;
  --bg: var(--earth-dark);
  --card: var(--earth-mid);
  --text: var(--bone);
  --muted: var(--bone-dim);
  --accent: var(--ochre-light);
  --line: rgba(235, 209, 158, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Alegreya Sans", system-ui, sans-serif;
  font-size: 1.15rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:hover { color: var(--terracotta-light); }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

h1, h2, h3, .brand span, .pill, summary { font-family: "Cinzel", Georgia, serif; }
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); line-height: 1.12; margin: .2em 0 .4em; font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin: 0 0 .4em; font-weight: 600; color: var(--sand); }
h3 { font-size: 1.15rem; margin: .2em 0 .35em; color: var(--accent); font-weight: 600; }

/* Intestazione */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px max(16px, calc((100% - 1080px) / 2));
  background: rgba(46, 31, 20, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--bone); }
.brand span { font-size: 1.3rem; font-weight: 700; letter-spacing: .04em; }
.top nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a { text-decoration: none; color: var(--muted); font-size: 1rem; }
.top nav a:hover { color: var(--bone); }
.top nav a.lang { color: var(--bone); border: 1px solid var(--line); padding: 2px 10px; border-radius: 999px; }

/* Hero */
.hero {
  background:
    linear-gradient(180deg, rgba(46,31,20,.55) 0%, rgba(46,31,20,.82) 70%, var(--bg) 100%),
    url("img/mode_online.webp") center / cover no-repeat;
  padding: clamp(64px, 14vw, 150px) 0 clamp(56px, 10vw, 110px);
}
.kicker { color: var(--accent); letter-spacing: .18em; text-transform: uppercase; font-size: .95rem; margin: 0; }
.lead { max-width: 40rem; font-size: 1.3rem; color: var(--bone); }
.cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-top: 28px; }
.pill {
  display: inline-block; padding: 12px 24px; border-radius: 999px;
  background: var(--terracotta); color: #fff; font-weight: 600; letter-spacing: .03em;
}
.cta-sub { color: var(--muted); font-size: 1rem; }

/* Sezioni */
.block { padding: clamp(40px, 7vw, 80px) 0 0; }
.intro { max-width: 42rem; color: var(--muted); margin: 0 0 1.6em; }
.grid4 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid3 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
article {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px;
}
article p { margin: 0; color: var(--bone); font-size: 1.05rem; }
.mode { padding: 0 0 18px; overflow: hidden; }
.mode img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.mode h3, .mode p { padding: 0 20px; }
.mode h3 { margin-top: 14px; }

/* Carte */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cards figure { margin: 0; }
.cards img {
  width: 100%; aspect-ratio: 464 / 648; object-fit: cover; border-radius: 12px;
  border: 2px solid var(--earth-light); box-shadow: 0 10px 24px rgba(0,0,0,.4);
}
.cards figcaption { text-align: center; margin-top: 8px; font-family: "Cinzel", serif; font-size: .95rem; color: var(--sand); }

/* Pagine di testo */
.doc { padding: clamp(40px, 7vw, 72px) 0 24px; max-width: 760px; }
.doc h2 { margin-top: 1.8em; }
.doc ul { padding-left: 1.2em; }
.doc li { margin: .4em 0; }
.updated { color: var(--muted); margin-top: -.2em; }
.mail { font-family: "Cinzel", serif; font-size: 1.3rem; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px; margin: 10px 0; }
summary { cursor: pointer; padding: 10px 0; color: var(--sand); font-size: 1.05rem; }
details p { margin: 0 0 12px; }

/* Piè di pagina */
footer { margin-top: clamp(48px, 8vw, 96px); border-top: 1px solid var(--line); padding: 28px 0 20px; background: rgba(0,0,0,.18); }
.foot { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); font-size: 1rem; color: var(--muted); }
.foot strong { color: var(--sand); font-family: "Cinzel", serif; }
.rights { text-align: center; color: var(--muted); font-size: .9rem; margin: 22px 16px 0; }

/* Pagina di scelta lingua */
body.choose { min-height: 100vh; display: grid; place-items: center; text-align: center; }
body.choose h1 { margin: .3em 0; }
body.choose img { margin: 0 auto; }

@media (max-width: 560px) {
  .top { flex-wrap: wrap; justify-content: center; }
  .top nav { justify-content: center; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
