/* ===========================================================
   Stile Personalizzato: Rust and Wood (Elegante & Funzionale)
   =========================================================== */

:root {
  /* Tavolozza Colori */
  --bg-dark-grey: #232526; /* Grigio scuro caldo di fondo */
  --bg-card-grey: #2d3032; /* Grigio per card e sezioni */
  --emerald-main: #005a43; /* Verde smeraldo scuro (Scritte principali) */
  --emerald-light: #007a5b; /* Verde smeraldo luminoso per hover */
  --text-white: #f5f6f7; /* Bianco primario per testi leggibili */
  --text-muted: #b3b9bc; /* Bianco opaco/grigio chiaro per testi secondari */
  --border-wood: #3e4244; /* Linee di divisione e bordi */

  /* Font e Layout */
  --font-family:
    "Georgia", Cambria, "Times New Roman", Times, serif; /* Tocco Rust/Classico per i titoli */
  --font-sans:
    "Helvetica Neue", Helvetica, Arial, sans-serif; /* Pulito per i testi */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 1.25rem 5rem;
  background: var(--bg-dark-grey);
  color: var(--text-white);
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
}

/* Layout centrale pulito */
header,
main,
footer {
  max-width: 46rem;
  margin: 0 auto;
}

/* --- Header Migliorato & Più Strutturato -------------------- */

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2.5rem 1.5rem;
  background: var(--bg-card-grey);
  border: 1px solid var(--border-wood);
  border-radius: 12px;
  margin-top: 2rem;
  margin-bottom: 3rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

header .site-name {
  font-family: var(--font-family);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-white);
  letter-spacing: 0.5px;
}

/* --- Pulsanti di Navigazione (Sessioni) -------------------- */

header nav {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

header nav a {
  color: var(--text-white);
  background: var(--bg-dark-grey);
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--border-wood);
  transition: all 0.2s ease-in-out;
}

header nav a:hover {
  background: var(--text-white);
  color: var(--bg-dark-grey);
  border-color: var(--text-white);
}

/* Se vuoi dare un risalto "Smeraldo" al pulsante della sessione attiva (aggiungendo la classe .active nell'HTML) */
header nav a.active {
  background: var(--emerald-main);
  border-color: var(--emerald-main);
  color: var(--text-white);
}

/* --- Elementi di Testo ------------------------------------- */

h1,
h2,
h3 {
  font-family: var(--font-family);
  color: var(
    --emerald-main
  ); /* Verde Smeraldo Scuro per le scritte principali */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); /* Migliora il contrasto sul grigio */
}

h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.6rem;
  margin: 3rem 0 1rem;
  border-bottom: 1px solid var(--border-wood);
  padding-bottom: 0.5rem;
}

.tagline {
  color: var(--text-muted);
  font-size: 1.15rem;
  margin: 0 0 2.5rem;
  font-style: italic;
}

a {
  color: var(--text-white);
  text-decoration-thickness: 1px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--text-muted);
}

/* --- Griglia / Lista di Card (Progetti o Sezioni) ---------- */

.card-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

.card-list li {
  background: var(--bg-card-grey);
  border: 1px solid var(--border-wood);
  border-radius: 10px;
  margin-bottom: 1.2rem;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.card-list li:hover {
  border-color: var(--emerald-light);
  transform: translateY(-2px);
}

.card-list a {
  display: block;
  padding: 1.3rem 1.5rem;
  text-decoration: none;
  color: inherit;
}

.card-list .title {
  font-family: var(--font-family);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-white); /* Testo titolo card in bianco per leggibilità */
  display: block;
  margin-bottom: 0.25rem;
}

.card-list li:hover .title {
  color: var(
    --emerald-light
  ); /* Il titolo si illumina di smeraldo al passaggio */
}

.card-list .description {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- Pulsante Indietro (Sketch Pages) ---------------------- */

.back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 2rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-wood);
  border-radius: 6px;
  background: var(--bg-card-grey);
  transition: all 0.2s ease;
}

.back:hover {
  color: var(--text-white);
  border-color: var(--text-white);
}

canvas {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* --- Footer -------------------------------------------------- */

footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-wood);
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}
