/* ═══════════════════════════════════════════════════════
   LINGUA E CULTURA LATINA — CSS CONDIVISO
   Prof. Andrea Vaccaro
   Liceo Classico e Liceo Scientifico
   Design: "Codex Aureus" — manoscritto classico in chiave moderna
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Crimson+Pro:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* ═══ VARIABILI ═══ */
:root {
  --bg: #f5f1e8;
  --bg-warm: #efe9dd;
  --card: #faf8f3;
  --text: #1e1a12;
  --text-dim: #6b6456;
  --text-muted: #9a9286;
  --border: #d6cab4;
  --border-light: #e8dfcf;
  --gold: #9C7A3C;
  --gold-light: #c9a96e;
  --gold-pale: rgba(156, 122, 60, 0.08);
  --gold-glow: rgba(156, 122, 60, 0.25);

  /* Colori per anno */
  --latino1: #c94a4a;
  --latino2: #4a9a5e;
  --latino3: #4a8aaa;
  --latino4: #d4a843;
  --latino5: #9a6ab5;

  /* Colori per indirizzo */
  --classico: #8B1E3F;
  --scientifico: #1E5B8B;

  /* Colori per funzioni grammaticali */
  --soggetto: #c94a4a;
  --verbo: #d4a843;
  --complemento-oggetto: #4a9a5e;
  --complemento-indiretto: #4a8aaa;
  --vocativo: #d47a3a;

  /* Eulalia */
  --eulalia: #2D6A4F;
  --eulalia-light: #d4edda;

  /* Ombre */
  --shadow-sm: 0 1px 3px rgba(30, 26, 18, 0.04), 0 1px 2px rgba(30, 26, 18, 0.06);
  --shadow-md: 0 4px 16px rgba(30, 26, 18, 0.06), 0 2px 6px rgba(30, 26, 18, 0.04);
  --shadow-lg: 0 12px 40px rgba(30, 26, 18, 0.10), 0 4px 12px rgba(30, 26, 18, 0.06);
  --shadow-gold: 0 8px 32px rgba(156, 122, 60, 0.12);

  /* Transizioni */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ═══ ANIMAZIONI KEYFRAME ═══ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shimmerGold {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes dividerExpand {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 140px;
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══ BASE ═══ */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Texture pergamena sottile */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--text);
  transition: color 0.3s var(--ease-out);
}

::selection {
  background: var(--gold-glow);
  color: var(--text);
}

/* ═══ HERO HEADER ═══ */
.hero {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(156, 122, 60, 0.10) 0%, transparent 60%),
    linear-gradient(180deg, rgba(22, 18, 12, 0.95) 0%, rgba(48, 40, 28, 0.92) 100%),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 20px,
      rgba(156, 122, 60, 0.03) 20px,
      rgba(156, 122, 60, 0.03) 21px
    );
  background-color: #14110c;
  color: #f5f0e8;
  padding: 88px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Vignettatura sottile ai bordi */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(10, 8, 4, 0.4) 100%);
  pointer-events: none;
}

/* Bordo inferiore decorativo dorato — doppia linea */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--gold) 15%,
    var(--gold-light) 50%,
    var(--gold) 85%,
    transparent 100%
  );
  box-shadow: 0 -8px 0 0 rgba(156, 122, 60, 0.08);
}

.hero h1 {
  font-family: 'Cormorant Garamond', 'Libre Baskerville', serif;
  font-size: 52px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
  animation: fadeInUp 0.8s var(--ease-out) both;
}

.hero .subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  color: var(--gold-light);
  font-style: italic;
  font-weight: 400;
  animation: fadeInUp 0.8s var(--ease-out) 0.15s both;
}

.hero .school-info {
  font-family: 'Crimson Pro', serif;
  font-size: 15px;
  color: rgba(245, 240, 232, 0.55);
  margin-top: 20px;
  letter-spacing: 0.04em;
  animation: fadeInUp 0.8s var(--ease-out) 0.3s both;
}

.divider {
  width: 140px;
  height: 1px;
  margin: 20px auto;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-light), var(--gold), transparent);
  animation: dividerExpand 1s var(--ease-out) 0.4s both;
}

/* ═══ NAVIGATION BAR ═══ */
.navbar {
  background: rgba(250, 248, 243, 0.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  animation: slideDown 0.5s var(--ease-out) both;
  width: 100%;
  margin: 0;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 1100px;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0;
  overflow: visible;
}

.navbar .site-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-links a {
  text-decoration: none;
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  transition: all 0.3s var(--ease-out);
  letter-spacing: 0.02em;
}

.nav-links a:hover {
  color: var(--gold);
  background: var(--gold-pale);
}

.nav-links a.active {
  color: var(--gold);
  background: var(--gold-pale);
}

/* ═══ BACK LINK ═══ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-dim);
  font-size: 15px;
  margin: 24px 0;
  padding: 6px 0;
  transition: all 0.3s var(--ease-out);
  border-bottom: 1px solid transparent;
}

.back-link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold-light);
}

/* ═══ PAGE HEADER (for subpages) ═══ */
.page-header {
  text-align: center;
  padding: 48px 24px 40px;
  margin-bottom: 32px;
  animation: fadeInUp 0.6s var(--ease-out) both;
}

.page-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 42px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.page-header .subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  color: var(--text-dim);
  font-style: italic;
}

.page-header .divider {
  margin: 18px auto;
}

/* ═══ SECTION ═══ */
.section {
  margin-bottom: 48px;
  animation: fadeInUp 0.6s var(--ease-out) both;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
  position: relative;
  display: inline-block;
}

/* Ornamento dorato sotto il titolo di sezione */
.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  margin-top: 10px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), transparent);
  border-radius: 1px;
}

.section-desc {
  font-size: 17px;
  color: var(--text-dim);
  margin-bottom: 28px;
  line-height: 1.7;
}

.section-header-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-light);
}

.section-header-bar .icon { font-size: 28px; }

/* ═══ CARDS GRID ═══ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 32px;
  transition: all 0.4s var(--ease-out);
  text-decoration: none;
  color: var(--text);
  display: block;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.6s var(--ease-out) both;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  transition: all 0.4s var(--ease-out);
}

.card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--gold-pale);
  border-color: var(--border);
}

.card:hover::before {
  height: 5px;
}

/* Bagliore dorato angolo in alto a destra al hover */
.card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(156, 122, 60, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
}
.card:hover::after {
  opacity: 1;
}

/* Card accent colors by year */
.card[data-level="1"]::before { background: linear-gradient(90deg, var(--latino1), #d87070); }
.card[data-level="2"]::before { background: linear-gradient(90deg, var(--latino2), #6db88a); }
.card[data-level="3"]::before { background: linear-gradient(90deg, var(--latino3), #6da8c8); }
.card[data-level="4"]::before { background: linear-gradient(90deg, var(--latino4), #e0be6a); }
.card[data-level="5"]::before { background: linear-gradient(90deg, var(--latino5), #b48cc8); }
.card[data-level="strumenti"]::before { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.card[data-level="testi"]::before { background: linear-gradient(90deg, var(--eulalia), #4a9a72); }

.card .card-icon {
  font-size: 38px;
  margin-bottom: 16px;
  display: block;
}

.card h2,
.card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: 0.01em;
}

.card p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-dim);
}

.card .badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-family: 'Crimson Pro', serif;
  font-size: 12px;
  font-weight: 700;
  margin-top: 14px;
  color: #fff;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.card[data-level="1"] .badge { background: var(--latino1); }
.card[data-level="2"] .badge { background: var(--latino2); }
.card[data-level="3"] .badge { background: var(--latino3); }
.card[data-level="4"] .badge { background: var(--latino4); color: var(--text); }
.card[data-level="5"] .badge { background: var(--latino5); }

/* ═══ TOPIC TABLE ═══ */
.topic-table {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 28px;
}

.topic-table table {
  width: 100%;
  border-collapse: collapse;
}

.topic-table th {
  background: linear-gradient(135deg, #1e1a12 0%, #3a3024 100%);
  color: #f5f0e8;
  padding: 16px 24px;
  text-align: left;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.topic-table td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.topic-table tr:last-child td {
  border-bottom: none;
}

.topic-table tr {
  transition: background 0.3s var(--ease-out);
}

.topic-table tr:hover {
  background: var(--gold-pale);
}

.topic-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.topic-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Status badges for topics */
.status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: 'Crimson Pro', serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.status.placeholder {
  background: #fef3cd;
  color: #856404;
}

.status.ready {
  background: #d4edda;
  color: #155724;
}

.status.wip {
  background: #cce5ff;
  color: #004085;
}

/* Resource links in tables */
.resources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resource-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s var(--ease-out);
}

.resource-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.resource-link.text { border-color: var(--latino1); color: var(--latino1); }
.resource-link.text:hover { background: var(--latino1); color: white; }

.resource-link.pdf { border-color: var(--latino2); color: var(--latino2); }
.resource-link.pdf:hover { background: var(--latino2); color: white; }

.resource-link.tool { border-color: var(--latino3); color: var(--latino3); }
.resource-link.tool:hover { background: var(--latino3); color: white; }

.resource-link.grammar { border-color: var(--latino4); color: #8a6a1a; }
.resource-link.grammar:hover { background: var(--latino4); color: var(--text); }

/* ═══ EULALIA SECTION ═══ */
.eulalia-section {
  background: var(--card);
  border: 1px solid var(--eulalia);
  border-left: 4px solid var(--eulalia);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.eulalia-section .eulalia-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--eulalia-light);
}

.eulalia-section .eulalia-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--eulalia);
}

.eulalia-level {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  background: var(--eulalia);
  color: white;
  font-family: 'Crimson Pro', serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Checklist */
.checklist {
  list-style: none;
  padding: 0;
}

.checklist li {
  padding: 12px 16px;
  border-left: 3px solid var(--eulalia);
  margin-bottom: 8px;
  margin-left: 4px;
  font-size: 15px;
  line-height: 1.6;
  background: var(--eulalia-light);
  border-radius: 0 10px 10px 0;
  transition: all 0.3s var(--ease-out);
}

.checklist li:hover {
  transform: translateX(4px);
  background: rgba(45, 106, 79, 0.12);
}

.checklist li::before {
  content: '\2610';
  margin-right: 12px;
  font-size: 18px;
  color: var(--eulalia);
}

/* ═══ INDIRIZZO TABS ═══ */
.track-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
}

.track-tab {
  flex: 1;
  padding: 16px 24px;
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: var(--bg);
  color: var(--text-dim);
  transition: all 0.3s var(--ease-out);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.track-tab:first-child {
  border-radius: 12px 0 0 12px;
}

.track-tab:last-child {
  border-radius: 0 12px 12px 0;
}

.track-tab.classico.active,
.track-tab.classico:hover {
  background: var(--classico);
  color: white;
  border-color: var(--classico);
  box-shadow: 0 4px 16px rgba(139, 30, 63, 0.2);
}

.track-tab.scientifico.active,
.track-tab.scientifico:hover {
  background: var(--scientifico);
  color: white;
  border-color: var(--scientifico);
  box-shadow: 0 4px 16px rgba(30, 91, 139, 0.2);
}

/* ═══ TOOLS SECTION ═══ */
.tools-section {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 36px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.6s var(--ease-out) both;
}

.tools-section h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
  letter-spacing: 0.01em;
  position: relative;
  display: inline-block;
  width: 100%;
}

/* Ornamento simmetrico ai lati del titolo strumenti */
.tools-section h2::before,
.tools-section h2::after {
  content: '';
  display: inline-block;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
  vertical-align: middle;
  margin: 0 16px;
}
.tools-section h2::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.tool-link {
  padding: 18px 20px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.35s var(--ease-out);
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

/* Linea dorata a sinistra che appare al hover */
.tool-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(180deg, var(--gold), var(--gold-light));
  transition: width 0.3s var(--ease-out);
  border-radius: 12px 0 0 12px;
}

.tool-link:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.tool-link:hover::before {
  width: 4px;
}

.tool-link .tool-icon { font-size: 22px; }

.tool-link .tool-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ═══ EMPTY STATE ═══ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-dim);
}

.empty-state .icon {
  font-size: 56px;
  display: block;
  margin-bottom: 20px;
}

.empty-state h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  margin-bottom: 10px;
  color: var(--text);
}

.empty-state p {
  font-size: 16px;
  line-height: 1.7;
}

/* ═══ FOOTER ═══ */
footer {
  background: #14110c !important;
  color: rgba(245, 240, 232, 0.65);
  padding: 48px 24px 40px;
  text-align: center;
  margin-top: 80px;
  position: relative;
  width: 100%;
  border-radius: 0 !important;
  box-shadow: none !important;
  max-width: none;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 15%, var(--gold-light) 50%, var(--gold) 85%, transparent 100%);
  box-shadow: 0 8px 0 0 rgba(156, 122, 60, 0.05);
}

footer p {
  margin-bottom: 6px;
  font-size: 15px;
}

footer strong {
  color: var(--gold-light);
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.02em;
}

footer .footer-links {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

footer .footer-links a {
  color: var(--gold-light);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: all 0.3s var(--ease-out);
  letter-spacing: 0.03em;
}

footer .footer-links a:hover {
  color: #fff;
  border-bottom-color: var(--gold-light);
}

/* ═══ RESPONSIVE ═══ */

/* Tablet */
@media (max-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
  .tools-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .card { padding: 24px; }
  .hero h1 { font-size: 40px; }
}

/* Mobile */
@media (max-width: 768px) {
  .hero h1 { font-size: 34px; }
  .hero { padding: 56px 20px 48px; }
  .page-header h1 { font-size: 30px; }
  .page-header { padding: 36px 20px; }
  .cards-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .navbar .container { flex-direction: column; text-align: center; gap: 8px; }
  .nav-links { justify-content: center; gap: 6px; }
  .nav-links a { font-size: 13px; padding: 5px 10px; }
  .track-tabs { flex-direction: column; }
  .track-tab:first-child { border-radius: 12px 12px 0 0; }
  .track-tab:last-child { border-radius: 0 0 12px 12px; }
  .container { padding: 0 16px; }
  .section-title { font-size: 24px; }
  .tools-section { padding: 24px; }
}

/* Telefoni piccoli */
@media (max-width: 480px) {
  .hero h1 { font-size: 28px; }
  .hero .subtitle { font-size: 18px; }
  .hero .school-info { font-size: 13px; }
  .page-header h1 { font-size: 24px; }
  .card { padding: 20px; }
  .card h3 { font-size: 19px; }
  .navbar .site-name { font-size: 15px; }
  .nav-links { gap: 4px; }
  .nav-links a { font-size: 12px; padding: 4px 8px; }
  footer { padding: 28px 16px; }
  .footer-links { gap: 14px; }
}

/* ═══════════════════════════════════════════════════════
   COMPONENTI LEZIONI — estratti da pagine autori
   ═══════════════════════════════════════════════════════ */

/* ═══ LESSON INTRO ═══ */
.lesson-intro {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.lesson-intro::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}

.lesson-intro h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 16px;
}

.lesson-intro p {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 10px;
}

/* ═══ CONTEXT BADGES ═══ */
.context-badge {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 20px;
  font-family: 'Crimson Pro', serif;
  font-size: 13px;
  font-weight: 700;
  margin-right: 8px;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
  transition: transform 0.2s var(--ease-out);
}

.context-badge:hover {
  transform: scale(1.05);
}

.context-badge.autore { background: rgba(156, 122, 60, 0.12); color: var(--gold); }
.context-badge.opera { background: rgba(45, 106, 79, 0.10); color: var(--eulalia); }
.context-badge.data { background: rgba(107, 100, 86, 0.10); color: var(--text-dim); }
.context-badge.genere { background: rgba(154, 106, 181, 0.10); color: #7a3a9a; }

/* ═══ TLAC BOXES ═══ */
.tlac-box {
  border-radius: 14px;
  padding: 22px 26px;
  margin: 24px 0;
  font-size: 15px;
  line-height: 1.7;
  transition: transform 0.3s var(--ease-out);
}

.tlac-box:hover {
  transform: translateX(4px);
}

.tlac-box .tlac-label {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tlac-donow {
  background: rgba(201, 74, 74, 0.06);
  border-left: 4px solid var(--latino1);
}
.tlac-donow .tlac-label { color: var(--latino1); }

.tlac-coldcall {
  background: rgba(74, 138, 170, 0.07);
  border-left: 4px solid var(--latino3);
}
.tlac-coldcall .tlac-label { color: #1a6b8a; }

.tlac-turntalk {
  background: rgba(74, 154, 94, 0.06);
  border-left: 4px solid var(--latino2);
}
.tlac-turntalk .tlac-label { color: #2a7a2a; }

.tlac-stretch {
  background: rgba(154, 106, 181, 0.06);
  border-left: 4px solid var(--latino5);
}
.tlac-stretch .tlac-label { color: #7a3a9a; }

.tlac-exit {
  background: rgba(212, 168, 67, 0.08);
  border-left: 4px solid var(--latino4);
}
.tlac-exit .tlac-label { color: #8a6a0a; }

.tlac-reveal-btn {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  color: var(--text-dim);
}

.tlac-reveal-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: var(--shadow-sm);
}

.tlac-hint {
  display: none;
  margin-top: 12px;
  padding: 14px 18px;
  background: var(--gold-pale);
  border-radius: 10px;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.7;
}

.tlac-hint.visible { display: block; }

/* ═══ SEZIONE CONTENUTO ═══ */
.content-section {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  margin-bottom: 32px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.content-header {
  background: linear-gradient(135deg, #1e1a12 0%, #3a3024 100%);
  color: #f5f0e8;
  padding: 26px 32px;
  position: relative;
}

.content-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}

.content-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 4px;
}

.content-header .section-ref {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  color: var(--gold-light);
  font-style: italic;
}

.content-body {
  padding: 32px;
}

.content-body h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px;
  font-weight: 600;
  color: var(--text);
  margin: 28px 0 14px;
}

.content-body h3:first-child { margin-top: 0; }

.content-body p {
  font-size: 16px;
  line-height: 1.85;
  margin-bottom: 14px;
}

/* ═══ CITAZIONI E FONTI ═══ */
.lat-cite {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--gold);
  font-weight: 600;
}

.nota-fonte {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 4px;
}

/* ═══ BRANO ANTOLOGICO ═══ */
.brano-box {
  background: var(--gold-pale);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  padding: 24px 28px;
  margin: 24px 0;
  font-size: 15px;
  line-height: 1.85;
  transition: border-left-width 0.2s var(--ease-out);
}

.brano-box:hover {
  border-left-width: 6px;
}

.brano-box .brano-titolo {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--gold);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brano-box .brano-testo {
  font-family: 'Crimson Pro', serif;
  font-size: 16px;
  line-height: 1.95;
  color: var(--text);
}

.brano-box .brano-commento {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ═══ CONFRONTO TABLE ═══ */
.confronto-grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
}

.confronto-grid .cg-header {
  background: linear-gradient(135deg, #1e1a12, #3a3024);
  color: #f5f0e8;
  padding: 16px 20px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

.confronto-grid .cg-label {
  padding: 16px 20px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  background: var(--gold-pale);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
}

.confronto-grid .cg-cell {
  padding: 16px 20px;
  font-size: 15px;
  line-height: 1.7;
  border-bottom: 1px solid var(--border-light);
  background: var(--card);
  transition: background 0.2s var(--ease-out);
}

.confronto-grid .cg-cell:hover {
  background: var(--gold-pale);
}

.confronto-grid .cg-cell.left {
  border-right: 1px solid var(--border-light);
}

.cg-highlight {
  font-weight: 700;
  color: var(--gold);
}

/* ═══ QUIZ / ESERCIZI ═══ */
.esercizio-section {
  background: var(--card);
  border: 1px solid var(--eulalia);
  border-left: 4px solid var(--eulalia);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}

.esercizio-section h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--eulalia);
  margin-bottom: 22px;
}

.esercizio-section h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: var(--text);
  margin: 22px 0 14px;
}

.quiz-item {
  background: rgba(45, 106, 79, 0.04);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.quiz-item .quiz-q {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  line-height: 1.6;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  padding: 14px 18px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  font-size: 15px;
  background: var(--card);
}

.quiz-option:hover {
  border-color: var(--eulalia);
  background: rgba(45, 106, 79, 0.04);
  transform: translateX(4px);
}

.quiz-option.correct {
  border-color: #28a745;
  background: rgba(40, 167, 69, 0.1);
  color: #155724;
}

.quiz-option.wrong {
  border-color: #dc3545;
  background: rgba(220, 53, 69, 0.08);
  color: #721c24;
}

.quiz-option.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.quiz-feedback {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  display: none;
}

.quiz-feedback.show { display: block; }

.quiz-feedback.correct-fb {
  background: rgba(40, 167, 69, 0.1);
  border-left: 3px solid #28a745;
  color: #155724;
}

.quiz-feedback.wrong-fb {
  background: rgba(220, 53, 69, 0.08);
  border-left: 3px solid #dc3545;
  color: #721c24;
}

/* ═══ SCORE BAR ═══ */
.score-bar {
  background: rgba(250, 248, 243, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  position: sticky;
  top: 64px;
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.score-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 700;
}

.score-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--eulalia);
}

/* ═══ STEMMA SINTATTICO (Tesniere) ═══ */
.legenda-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px 18px;
  margin: 18px 0 32px;
}

.legenda-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Crimson Pro', serif;
  letter-spacing: 0.02em;
}

.legenda-dot {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-spring);
}

.legenda-item:hover .legenda-dot {
  transform: scale(1.2);
}

.ld-v  { background: rgba(212, 168, 67, 0.30); border-color: var(--latino4); }
.ld-s  { background: rgba(201, 74, 74, 0.20); border-color: var(--latino1); }
.ld-o  { background: rgba(74, 154, 94, 0.22); border-color: var(--latino2); }
.ld-i  { background: rgba(74, 138, 170, 0.22); border-color: var(--latino3); }
.ld-rg { background: linear-gradient(90deg, rgba(201, 74, 74, 0.22) 50%, rgba(74, 154, 94, 0.28) 50%); border-color: #9b3a3a; }
.ld-g  { background: rgba(173, 181, 189, 0.25); border-color: #adb5bd; }

.stemma-wrap {
  overflow-x: auto;
  padding-bottom: 8px;
}

.nota-sintattica {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--gold-pale);
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dim);
}

.nota-sintattica strong { color: var(--text); }

.intro-tesniere {
  background: linear-gradient(135deg, var(--gold-pale) 0%, rgba(212, 168, 67, 0.06) 100%);
  border: 1px solid var(--gold);
  border-left: 4px solid var(--gold);
  border-radius: 0 16px 16px 0;
  padding: 26px 30px;
  margin-bottom: 32px;
}

.intro-tesniere .intro-label {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  margin-bottom: 12px;
}

.intro-tesniere p {
  font-size: 15px;
  line-height: 1.85;
  margin-bottom: 8px;
  color: var(--text-dim);
}

.intro-tesniere p:last-child { margin-bottom: 0; }

/* ═══ RESPONSIVE LEZIONI ═══ */
@media (max-width: 768px) {
  .content-body { padding: 22px; }
  .content-header { padding: 20px 22px; }
  .confronto-grid { grid-template-columns: 1fr; }
  .confronto-grid .cg-header { display: block; }
  .score-bar { flex-direction: column; gap: 8px; top: 54px; }
  .lesson-intro { padding: 24px; }
  .brano-box { padding: 18px 20px; }
  .esercizio-section { padding: 24px; }
}

/* ═══ CALENDARIO (stili specifici) ═══ */
@media print {
  .navbar, footer, .no-print { display: none !important; }
  body { background: white; }
  .hero { background: none; color: var(--text); padding: 20px; }
  .hero h1 { font-size: 24px; }
  .hero::after { display: none; }
}

/* ═══ STEMMA INTERATTIVO — toolbar, zoom, breadcrumb ═══ */
.stemma-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.stemma-info {
  font-family: 'Crimson Pro', serif;
  font-size: 14px;
  color: var(--text-dim);
  flex: 1;
  min-width: 0;
}

.stemma-crumb {
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
  font-weight: 600;
}

.stemma-crumb:hover {
  color: var(--gold);
  background: var(--gold-pale);
}

.stemma-crumb.active {
  color: var(--text);
  background: rgba(156, 122, 60, 0.12);
}

.stemma-arrow {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0 2px;
}

.stemma-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.stemma-btn {
  font-family: 'Crimson Pro', serif;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.stemma-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: var(--shadow-sm);
}

.stemma-btn-reset {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
}

.stemma-btn-reset:hover {
  background: var(--text);
  border-color: var(--text);
  color: white;
}

.stemma-btn-zoom {
  min-width: 36px;
  text-align: center;
  font-size: 18px;
  padding: 4px 10px;
  font-weight: 700;
}

.stemma-svg {
  transition: filter 0.3s;
}

.stemma-node {
  transition: opacity 0.4s;
}

.stemma-rect {
  transition: filter 0.25s;
}

.stemma-edge {
  transition: opacity 0.4s;
}

/* Fullscreen mode */
.content-section:fullscreen,
.content-section:-webkit-full-screen {
  background: var(--bg);
  padding: 32px;
  overflow: auto;
}

.content-section:fullscreen .stemma-svg,
.content-section:-webkit-full-screen .stemma-svg {
  min-width: 0 !important;
}

.content-section:fullscreen .content-header,
.content-section:-webkit-full-screen .content-header {
  border-radius: 14px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .stemma-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .stemma-btns {
    width: 100%;
    justify-content: flex-end;
  }
  .stemma-btn-fs {
    display: none;
  }
}

/* ═══ SMOOTH SCROLL ═══ */
html {
  scroll-behavior: smooth;
}

/* ═══ FOCUS STATES (accessibilità) ═══ */
a:focus-visible,
button:focus-visible,
.quiz-option:focus-visible,
.track-tab:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════
   LIQUID GLASS — design system v1 (Fase 2 restyling)
   Attivazione per pagina: <body class="liquid-glass">
   Nessun effetto sulle pagine prive della classe.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Materiali vetro */
  --glass-bg: rgba(250, 248, 243, 0.40);
  --glass-bg-strong: rgba(250, 248, 243, 0.70);
  --glass-border: rgba(255, 255, 255, 0.55);
  --glass-border-warm: rgba(156, 122, 60, 0.18);
  --glass-blur: 18px;
  --glass-saturate: 1.35;
  --glass-shadow: 0 8px 32px rgba(30, 26, 18, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.60);
  --glass-shadow-hover: 0 16px 48px rgba(30, 26, 18, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  --glass-highlight: linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.05) 40%);

  /* Scala radius */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

/* ── Fondo: la "materia" dietro il vetro ── */
body.liquid-glass {
  background:
    radial-gradient(900px 620px at 12% -6%, rgba(156, 122, 60, 0.17), transparent 60%),
    radial-gradient(720px 520px at 96% 10%, rgba(139, 30, 63, 0.10), transparent 55%),
    radial-gradient(820px 620px at 70% 108%, rgba(30, 91, 139, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-warm) 100%);
  background-attachment: fixed;
}

/* ── Utilità vetro generica ── */
.liquid-glass .glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-bottom-color: var(--glass-border-warm);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-md);
}

/* ── Navbar ── */
.liquid-glass .navbar {
  /* !important necessario: la regola base .navbar usa !important sul background */
  background: var(--glass-bg-strong) !important;
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border-bottom: 1px solid var(--glass-border-warm);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 8px 24px rgba(30, 26, 18, 0.05) !important;
}

.liquid-glass .nav-links a {
  border-radius: 999px;
}

.liquid-glass .nav-links a:hover,
.liquid-glass .nav-links a.active {
  background: rgba(156, 122, 60, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ── Card ── */
.liquid-glass .card {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-bottom-color: var(--glass-border-warm);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

.liquid-glass .card:hover {
  box-shadow: var(--glass-shadow-hover), 0 0 0 1px var(--gold-pale);
}

/* riflesso superiore */
.liquid-glass .card::after {
  background: var(--glass-highlight);
  border-radius: var(--radius-lg) var(--radius-lg) 60% 60%;
  height: 46%;
  opacity: 0.5;
}

/* ── Tool link ── */
.liquid-glass .tool-link {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px) saturate(var(--glass-saturate));
  backdrop-filter: blur(12px) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-bottom-color: var(--glass-border-warm);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
}

.liquid-glass .tool-link:hover {
  /* vetro scuro: ripristina il contrasto pieno dell'inversione originale */
  background: rgba(30, 26, 18, 0.88);
  -webkit-backdrop-filter: blur(12px) saturate(var(--glass-saturate));
  backdrop-filter: blur(12px) saturate(var(--glass-saturate));
  color: var(--bg);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: var(--glass-shadow-hover);
}

/* ── Pannello testo lungo: SEMPRE pieno, mai vetro ── */
.liquid-glass .panel-solid {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px 32px;
}

/* ── Breadcrumb (nuovo componente, per le sezioni profonde) ── */
.liquid-glass .breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px) saturate(var(--glass-saturate));
  backdrop-filter: blur(12px) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  font-size: 14px;
  color: var(--text-dim);
  margin: 20px 0;
}

.liquid-glass .breadcrumb a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.liquid-glass .breadcrumb .sep { opacity: 0.45; }

/* ── Bottone vetro ── */
.liquid-glass .btn-glass {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(12px) saturate(var(--glass-saturate));
  backdrop-filter: blur(12px) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-bottom-color: var(--glass-border-warm);
  box-shadow: var(--glass-shadow);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s var(--ease-out);
}

.liquid-glass .btn-glass:hover {
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-hover);
  color: var(--gold);
}

/* ── Footer ── */
.liquid-glass footer {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-top: 1px solid var(--glass-border-warm);
}

/* ═══ FALLBACK E RISPETTO DELLE PREFERENZE ═══ */

/* Browser senza backdrop-filter: superfici piene */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .liquid-glass .glass,
  .liquid-glass .navbar,
  .liquid-glass .card,
  .liquid-glass .tool-link,
  .liquid-glass .breadcrumb,
  .liquid-glass .btn-glass,
  .liquid-glass footer {
    background: var(--card) !important;
  }
}

/* Chi chiede meno trasparenza: superfici piene */
@media (prefers-reduced-transparency: reduce) {
  .liquid-glass .glass,
  .liquid-glass .navbar,
  .liquid-glass .card,
  .liquid-glass .tool-link,
  .liquid-glass .breadcrumb,
  .liquid-glass .btn-glass,
  .liquid-glass footer {
    background: var(--card) !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Chi chiede meno movimento: stop ad animazioni e transizioni (vale per tutto il sito) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Card links indirizzo (classico/scientifico) — sostituisce gli stili inline della home ── */
.card-links {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.card-links a {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.3s var(--ease-out);
}

.card-links .indirizzo-classico { background: #f0d4dc; color: var(--classico); }
.card-links .indirizzo-scientifico { background: #d4e4f0; color: var(--scientifico); }

/* variante vetro */
.liquid-glass .card-links a {
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.liquid-glass .card-links .indirizzo-classico { background: rgba(139, 30, 63, 0.12); }
.liquid-glass .card-links .indirizzo-scientifico { background: rgba(30, 91, 139, 0.12); }

.liquid-glass .card-links .indirizzo-classico:hover { background: rgba(139, 30, 63, 0.22); }
.liquid-glass .card-links .indirizzo-scientifico:hover { background: rgba(30, 91, 139, 0.22); }

/* ── Tipografia di sistema (stile Apple/SF) per le pagine liquid glass ── */
:root {
  --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
                 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body.liquid-glass {
  font-family: var(--font-system);
  font-size: 16px;
  letter-spacing: -0.011em; /* tracking SF */
}

.liquid-glass h1,
.liquid-glass h2,
.liquid-glass h3,
.liquid-glass h4,
.liquid-glass .site-name,
.liquid-glass .section-title,
.liquid-glass .tool-link .tool-name,
.liquid-glass .hero h1,
.liquid-glass .hero .subtitle {
  font-family: var(--font-system);
}

.liquid-glass .hero h1 {
  font-weight: 700;
  letter-spacing: -0.022em; /* display tightening */
}

.liquid-glass .hero .subtitle {
  font-style: normal;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.liquid-glass .section-title,
.liquid-glass .card h3 {
  font-weight: 650;
  letter-spacing: -0.018em;
}

.liquid-glass .nav-links a,
.liquid-glass .tool-link .tool-name {
  font-family: var(--font-system);
  font-weight: 590; /* peso "medium" SF; i sistemi senza pesi variabili arrotondano a 600 */
}

/* ═══════════════════════════════════════════════════════════
   LIQUID GLASS v1.1 — "aula viva": aurora, tinte per anno,
   chip icona, reveal in cascata. Sempre scoped a .liquid-glass.
   ═══════════════════════════════════════════════════════════ */

/* ── Aurora animata dietro il vetro ── */
@keyframes auroraDrift {
  from { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) rotate(4deg) scale(1.08); }
}

body.liquid-glass::after {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 35% at 25% 30%, rgba(156, 122, 60, 0.16), transparent 70%),
    radial-gradient(35% 30% at 75% 20%, rgba(139, 30, 63, 0.11), transparent 70%),
    radial-gradient(45% 40% at 60% 80%, rgba(30, 91, 139, 0.11), transparent 70%);
  filter: blur(48px);
  animation: auroraDrift 26s ease-in-out infinite alternate;
}

/* ── Hero: titolo con riflesso dorato che scorre ── */
.liquid-glass .hero h1 {
  background: linear-gradient(110deg, #f5f0e8 35%, var(--gold-light) 50%, #f5f0e8 65%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fadeInUp 0.8s var(--ease-out) both, shimmerGold 7s linear 1.2s infinite;
}

/* ── Card: icona in chip di vetro tinto per anno ── */
.liquid-glass .card .card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 4px 12px rgba(30, 26, 18, 0.06);
  margin-bottom: 12px;
  transition: transform 0.45s var(--ease-spring);
}

.liquid-glass .card:hover .card-icon {
  transform: rotate(-6deg) scale(1.12);
}

.liquid-glass .card[data-level="1"] .card-icon { background: rgba(201, 74, 74, 0.14); }
.liquid-glass .card[data-level="2"] .card-icon { background: rgba(74, 154, 94, 0.14); }
.liquid-glass .card[data-level="3"] .card-icon { background: rgba(74, 138, 170, 0.14); }
.liquid-glass .card[data-level="4"] .card-icon { background: rgba(212, 168, 67, 0.16); }
.liquid-glass .card[data-level="5"] .card-icon { background: rgba(154, 106, 181, 0.14); }

/* ── Card: al passaggio si accende del colore del suo anno ── */
.liquid-glass .card[data-level="1"]:hover { box-shadow: var(--glass-shadow-hover), 0 14px 44px rgba(201, 74, 74, 0.26); }
.liquid-glass .card[data-level="2"]:hover { box-shadow: var(--glass-shadow-hover), 0 14px 44px rgba(74, 154, 94, 0.26); }
.liquid-glass .card[data-level="3"]:hover { box-shadow: var(--glass-shadow-hover), 0 14px 44px rgba(74, 138, 170, 0.26); }
.liquid-glass .card[data-level="4"]:hover { box-shadow: var(--glass-shadow-hover), 0 14px 44px rgba(212, 168, 67, 0.30); }
.liquid-glass .card[data-level="5"]:hover { box-shadow: var(--glass-shadow-hover), 0 14px 44px rgba(154, 106, 181, 0.26); }

/* ── Badge: lucentezza vetro ── */
.liquid-glass .card .badge {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 8px rgba(30, 26, 18, 0.12);
}

/* ── Tool-link: icona in chip dorato che reagisce ── */
.liquid-glass .tool-link .tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(156, 122, 60, 0.12);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
  transition: transform 0.4s var(--ease-spring), background 0.3s var(--ease-out);
}

.liquid-glass .tool-link:hover .tool-icon {
  transform: scale(1.15) rotate(5deg);
  background: rgba(255, 255, 255, 0.12);
}

/* ── Reveal in cascata dei tool-link ── */
.liquid-glass .tools-grid .tool-link { animation: fadeInUp 0.6s var(--ease-out) both; }
.liquid-glass .tools-grid .tool-link:nth-child(1)  { animation-delay: 0.05s; }
.liquid-glass .tools-grid .tool-link:nth-child(2)  { animation-delay: 0.10s; }
.liquid-glass .tools-grid .tool-link:nth-child(3)  { animation-delay: 0.15s; }
.liquid-glass .tools-grid .tool-link:nth-child(4)  { animation-delay: 0.20s; }
.liquid-glass .tools-grid .tool-link:nth-child(5)  { animation-delay: 0.25s; }
.liquid-glass .tools-grid .tool-link:nth-child(6)  { animation-delay: 0.30s; }
.liquid-glass .tools-grid .tool-link:nth-child(7)  { animation-delay: 0.35s; }
.liquid-glass .tools-grid .tool-link:nth-child(8)  { animation-delay: 0.40s; }
.liquid-glass .tools-grid .tool-link:nth-child(9)  { animation-delay: 0.45s; }
.liquid-glass .tools-grid .tool-link:nth-child(10) { animation-delay: 0.50s; }
.liquid-glass .tools-grid .tool-link:nth-child(11) { animation-delay: 0.55s; }
.liquid-glass .tools-grid .tool-link:nth-child(12) { animation-delay: 0.60s; }

/* ── Utilità spaziatura (consolidamento stili inline) ── */
.mt-20 { margin-top: 20px; }

/* ── Track tabs (percorsi) in vetro ── */
.liquid-glass .track-tab {
  font-family: var(--font-system);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px) saturate(var(--glass-saturate));
  backdrop-filter: blur(12px) saturate(var(--glass-saturate));
  border-color: var(--glass-border);
}

.mt-24 { margin-top: 24px; }

/* badge verde Eulalia del raccoglitore (consolidamento inline) */
.author-year-eulalia {
  background: var(--eulalia-light);
  color: #155724;
}

/* ── Utilità spaziatura/colore (consolidamento inline sezione autori) ── */
.mb-14 { margin-bottom: 14px; }
.mt-14 { margin-top: 14px; }
.mt-1r { margin-top: 1rem; }
.mt-2r { margin-top: 2rem; }
.text-dim { color: var(--text-dim); }

/* ── Utilità sezione grammatica (consolidamento inline) ── */
.mb-30 { margin-bottom: 30px; }
.my-20 { margin: 20px 0; }
.nota-piccola { color: #888; font-size: 0.9em; }
.nota-sotto { margin-top: 10px; font-size: 0.9em; color: #666; }
.tag-funzione {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid;
}

/* ── Utilità calendari/flashcard (consolidamento inline) ── */
.cal-stats .stat-box, .stat-box {
  background: linear-gradient(135deg, #1e1a12, #3a3024);
  color: #f5f0e8;
  border: none;
  flex: 1;
  min-width: 180px;
  text-align: center;
  padding: 16px 20px;
}
.cal-stats .stat-numero, .stat-numero {
  font-size: 32px;
  font-weight: 700;
  color: var(--gold-light);
  font-family: 'Cormorant Garamond', serif;
}
.cal-stats .stat-etichetta, .stat-etichetta { font-size: 13px; opacity: .7; }
.cella-centrata { text-align: center; width: 100%; padding: 20px; }
.btn-stampa {
  padding: 8px 20px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  background: var(--card);
  color: var(--text);
  transition: all 0.2s;
}
