/* ============================================================
   AGORÀ — Main Stylesheet
   Aesthetic: Editorial / Scholarly with warm Mediterranean tones
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,400&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  /* Colors */
  --bg: #faf8f4;
  --surface: #ffffff;
  --surface-warm: #f5f0e8;
  --border: #e0d8cc;
  --border-strong: #c8bfb0;

  --text-primary: #1a1714;
  --text-secondary: #5a5248;
  --text-muted: #8a8078;

  --accent: #2d5a8e;        /* Blu profondo - link */
  --accent-warm: #8b4513;   /* Marrone - highlights */
  --accent-teal: #2a7c6f;   /* Verde acqua - header */
  --accent-gold: #c49a1a;   /* Oro - accenti speciali */

  --decay-red: #c0392b;
  --transform-green: #27ae60;
  --speculative-purple: #7b2d8b;
  --meta-yellow: #f39c12;

  --tab-active-bg: #ffffff;
  --tab-border: #a7d7f9;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-ui: 'DM Sans', sans-serif;

  /* Spacing */
  --header-h: 64px;
  --sidebar-w: 280px;
  --max-w: 1280px;
  --content-max: 780px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent-warm); }

/* ── HEADER ── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: var(--accent-teal);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  box-shadow: var(--shadow-md);
}

.header-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.header-logo span {
  font-style: italic;
  font-weight: 400;
}

.header-tagline {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,0.25);
}

/* Header Search */
.header-search {
  flex: 1;
  max-width: 480px;
  margin-left: auto;
  position: relative;
}
.header-search input {
  width: 100%;
  padding: 9px 16px 9px 40px;
  border-radius: 24px;
  border: none;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  outline: none;
  transition: background 0.2s var(--ease);
}
.header-search input::placeholder { color: rgba(255,255,255,0.55); }
.header-search input:focus { background: rgba(255,255,255,0.28); }
.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.65);
  pointer-events: none;
}

/* Search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: none;
  z-index: 300;
}
.search-results.open { display: block; }
.search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface-warm); }
.search-result-item .result-title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
}
.search-result-item .result-category {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Header User */
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 24px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.2s;
  white-space: nowrap;
  border: none;
  text-decoration: none;
}
.header-user:hover { background: rgba(255,255,255,0.25); color: #fff; }
.header-user svg { flex-shrink: 0; }

/* Hamburger */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.9);
  border-radius: 2px;
  transition: all 0.3s var(--ease);
}

/* ── SIDE DRAWER MENU ── */
#drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
#drawer-overlay.open { opacity: 1; pointer-events: all; }

#side-drawer {
  position: fixed;
  top: 0; left: 0;
  width: 320px;
  height: 100%;
  background: var(--surface);
  z-index: 500;
  transform: translateX(-100%);
  transition: transform 0.3s var(--ease);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
#side-drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 20px 24px;
  background: var(--accent-teal);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: #fff;
  font-style: italic;
}
.drawer-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.drawer-section {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.drawer-section-title {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.drawer-link:last-child { border-bottom: none; }
.drawer-link:hover { color: var(--accent); }
.drawer-link .tag {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--surface-warm);
  color: var(--text-muted);
  margin-left: auto;
}

/* ── AUTH MODAL ── */
#auth-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
}
#auth-overlay.open { opacity: 1; pointer-events: all; }

.auth-modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.25s var(--ease);
}
#auth-overlay.open .auth-modal { transform: translateY(0); }

.auth-modal h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 4px;
}
.auth-modal p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 24px; }

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
}
.auth-tab {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  padding: 8px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  transition: all 0.2s;
}
.auth-tab.active { border-bottom-color: var(--accent-teal); color: var(--text-primary); font-weight: 600; }

.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-family: var(--font-ui); font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.form-group input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg);
}
.form-group input:focus { border-color: var(--accent-teal); }

.btn-primary {
  padding: 11px 20px;
  background: var(--accent-teal);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}
.btn-primary:hover { background: #1e6359; }

.auth-close {
  position: absolute;
  top: 12px; right: 16px;
  font-size: 1.4rem;
  background: none; border: none;
  cursor: pointer; color: var(--text-muted);
}
.auth-modal { position: relative; }

/* ── USER BADGE (when logged in) ── */
.user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-family: var(--font-ui);
}
.user-level {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--accent-gold);
  color: #fff;
}

/* ── PAGE LAYOUT ── */
.page-container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

/* ── BREADCRUMBS ── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep {
  margin: 0 6px;
  color: var(--border-strong);
  font-size: 0.7rem;
}
.breadcrumbs .current { color: var(--text-secondary); font-weight: 500; }

/* ── TABS ── */
.page-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
  gap: 0;
}
.page-tab {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 10px 20px;
  text-decoration: none;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}
.page-tab:hover { color: var(--text-primary); background: var(--surface-warm); }
.page-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-teal);
  font-weight: 600;
}
.page-tab.speculative { color: var(--speculative-purple); }
.page-tab.speculative:hover { background: #f9f0fc; }
.page-tab.speculative.active { border-bottom-color: var(--speculative-purple); }
.page-tab.meta { color: var(--meta-yellow); }
.page-tab.meta.active { border-bottom-color: var(--meta-yellow); }

/* ── ARTICLE CONTENT ── */
.article-main { min-width: 0; }

.article-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  border-bottom: 2px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin: 32px 0 14px;
}

.article-body h3 {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text-secondary);
}

.article-body p { margin-bottom: 14px; }
.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 14px;
}
.article-body li { margin-bottom: 6px; }

/* ── ARGUMENT BOXES ── */
.arg-box {
  border-left: 4px solid var(--border-strong);
  background: var(--surface-warm);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
}
.arg-box.decay { border-left-color: var(--decay-red); background: #fdf5f5; }
.arg-box.transform { border-left-color: var(--transform-green); background: #f2faf5; }
.arg-box.neutral { border-left-color: var(--accent); background: #f0f5fc; }
.arg-box.speculative { border-left-color: var(--speculative-purple); background: #f8f0fc; }
.arg-box h3 { margin-top: 0; color: var(--text-primary); font-family: var(--font-ui); font-size: 1rem; }

/* ── SIDEBAR ── */
.article-sidebar { position: sticky; top: calc(var(--header-h) + 20px); }

.infobox {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
}
.infobox-header {
  background: var(--surface-warm);
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.infobox-body { padding: 14px 16px; }
.infobox-body strong { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin: 10px 0 4px; }
.infobox-body strong:first-child { margin-top: 0; }
.infobox-body ul { padding-left: 16px; margin: 0; }
.infobox-body li { font-size: 0.85rem; margin-bottom: 4px; }
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-open { background: #fff3e0; color: #e67e22; }
.status-saturazione { background: #fdecea; color: var(--decay-red); }

/* ── ELEVATOR BOX ── */
.elevator-box {
  background: linear-gradient(135deg, #e8f4fd 0%, #deeef8 100%);
  border: 1px solid #a7d7f9;
  border-radius: 10px;
  padding: 18px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
}
.elevator-box h4 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.elevator-box .question {
  font-style: italic;
  color: var(--text-secondary);
  margin: 8px 0;
}
.elevator-btn {
  display: block;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  margin-top: 12px;
  transition: background 0.2s;
}
.elevator-btn:hover { background: #1e4070; color: #fff; }

/* ── REFERENCES ── */
.references {
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 32px;
  font-family: var(--font-ui);
  line-height: 1.6;
}
.references p { margin-bottom: 6px; }

sup a { color: var(--accent); font-size: 0.75rem; text-decoration: none; }

/* ── DISCUSSION PAGE ── */
.discussion-notice {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  margin-bottom: 24px;
  color: #7a6000;
}

.comment-thread { margin-bottom: 0; }
.comment {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-meta {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.comment-author { font-weight: 700; color: var(--text-secondary); }
.comment-date { color: var(--text-muted); }
.comment-level {
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}
.level-1 { background: #e3f2fd; color: #1565c0; }
.level-2 { background: #e8f5e9; color: #2e7d32; }
.level-3 { background: #fce4ec; color: #c62828; }

.comment.reply {
  margin-left: 40px;
  padding-left: 16px;
  border-left: 3px solid var(--border);
}

.add-comment-box {
  margin-top: 32px;
  padding: 20px;
  background: var(--surface-warm);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.add-comment-box h3 { font-family: var(--font-ui); font-size: 1rem; margin-bottom: 12px; }
.add-comment-box textarea {
  width: 100%;
  min-height: 100px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
  outline: none;
  background: var(--surface);
  margin-bottom: 10px;
}
.add-comment-box textarea:focus { border-color: var(--accent-teal); }

/* ── HOME PAGE ── */
.home-hero {
  background: linear-gradient(135deg, #1a5c50 0%, #2a7c6f 50%, #1e4a72 100%);
  padding: 80px 24px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.home-hero h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
}
.home-hero h1 em { font-style: italic; font-weight: 400; }
.home-hero p {
  font-family: var(--font-ui);
  font-size: 1.05rem;
  opacity: 0.8;
  max-width: 520px;
  margin: 0 auto 32px;
  position: relative;
}

.hero-search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.hero-search input {
  width: 100%;
  padding: 16px 24px 16px 52px;
  border-radius: 50px;
  border: none;
  font-family: var(--font-ui);
  font-size: 1rem;
  outline: none;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}
.hero-search .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.hero-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 100;
}
.hero-search-results.open { display: block; }

/* Home sections */
.home-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
}

.section-label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.page-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary);
  margin-bottom: 14px;
  transition: all 0.2s var(--ease);
  box-shadow: var(--shadow-sm);
}
.page-card:hover {
  border-color: var(--accent-teal);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: var(--text-primary);
}
.page-card-category {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-teal);
  margin-bottom: 6px;
}
.page-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.page-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  line-height: 1.5;
}
.page-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.dot-open { background: var(--meta-yellow); }
.dot-verified { background: var(--transform-green); }
.dot-saturazione { background: var(--decay-red); }

/* Home sidebar */
.home-sidebar-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.home-sidebar-box h3 {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.home-cover-img {
  width: 100%;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

/* ── ACCORDION MENU (HOME PAGE) ── */
.category-accordion {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 24px;
  overflow: hidden;
  transition: border-color 0.3s var(--ease);
  box-shadow: var(--shadow-sm);
}

.category-accordion[open] {
  border-color: var(--accent-teal);
  box-shadow: var(--shadow-md);
}

.accordion-trigger {
  padding: 16px 20px;
  list-style: none; /* Nasconde la freccetta nativa di default */
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-warm);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  user-select: none;
}

/* Rimuove la freccia di default anche su Safari/Chrome */
.accordion-trigger::-webkit-details-marker {
  display: none;
}

.accordion-trigger:hover {
  background: #ede6db; /* Tono leggermente più scuro per l'effetto hover */
  color: var(--text-primary);
}

/* Animazione della freccetta personalizzata quando il menu è aperto */
.category-accordion[open] .accordion-icon {
  transform: rotate(180deg);
}

.accordion-icon {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform 0.3s var(--ease);
}

/* Spaziatura interna per le tue card quando la tendina si apre */
.category-accordion[open] .accordion-content {
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ── FOOTER ── */
footer {
  background: var(--surface-warm);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 60px;
}
footer a { color: var(--accent); }
footer strong { color: var(--text-secondary); }

/* ── EDIT CONTROLS (for logged-in users) ── */
.edit-bar {
  display: none;
  background: #e8f4fd;
  border: 1px solid #a7d7f9;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 20px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  align-items: center;
  gap: 12px;
}
.edit-bar.visible { display: flex; }
.btn-edit {
  padding: 6px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-edit:hover { background: #1e4070; }
.btn-edit.secondary { background: var(--surface); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-edit.secondary:hover { background: var(--surface-warm); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .page-container { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .home-main { grid-template-columns: 1fr; }
  .home-hero h1 { font-size: 2.4rem; }
  .header-tagline { display: none; }
}

@media (max-width: 600px) {
  .article-title { font-size: 1.8rem; }
  .page-container { padding: 16px; }
  #side-drawer { width: 280px; }
}

/* ── ANIMATIONS ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s var(--ease) both; }

/* Stili per commenti modificati ed eliminati */
.badge-edited, .badge-deleted {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 4px;
}

.text-deleted {
  font-style: italic;
  color: var(--text-muted);
}

.deleted-node {
  opacity: 0.8;
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0 4px;
}

.action-btn:hover {
  color: var(--accent);
  text-decoration: underline;
}

.action-delete:hover {
  color: var(--decay-red, #c0392b);
}
         
  
