/* PURSUE 2026 — stile condiviso delle pagine dell'Osservatorio
   (archivio, aggiornamenti, registro, glossario, cronologia, metodo).
   Palette e tipografia riprendono index.html e news.html. */

:root {
    --primary: #1a1a1a;
    --primary-light: #2d2d2d;
    --accent: #b8860b;
    --accent-dark: #8a6508;
    --accent-light: #daa520;
    --text: #1a202c;
    --text-light: #4a5568;
    --bg: #f4f1e8;
    --bg-paper: #fdfaf2;
    --line: rgba(0, 0, 0, 0.08);
    --white: #ffffff;
    --tier-a: #2f6b3a;
    --tier-b: #2c5282;
    --tier-c: #8a6508;
    --tier-d: #9b2c2c;
    --gradient: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: var(--text); background: var(--bg); line-height: 1.7; }
h1, h2, h3, h4 { font-family: 'Playfair Display', serif; font-weight: 600; line-height: 1.3; }
a { color: var(--accent-dark); }
code, .mono { font-family: 'JetBrains Mono', monospace; }
code { font-size: 0.85em; background: var(--bg); padding: 0.1em 0.4em; border-radius: 3px; word-break: break-word; }
.rec-link code { padding: 0.05em 0.25em; }

/* Barra di navigazione */
.topbar { background: var(--primary); color: var(--white); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0.8rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topbar-logo { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.15rem; color: var(--white); text-decoration: none; letter-spacing: 0.5px; white-space: nowrap; }
.topbar-logo span { color: var(--accent-light); }
.topbar-links { display: flex; gap: 1.25rem; list-style: none; flex-wrap: wrap; justify-content: flex-end; }
.topbar-links a { color: rgba(255, 255, 255, 0.82); text-decoration: none; font-size: 0.85rem; font-weight: 500; }
.topbar-links a:hover, .topbar-links a[aria-current="page"] { color: var(--accent-light); }
.topbar-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,0.3); color: var(--white); border-radius: 4px; padding: 0.3rem 0.6rem; font-size: 0.85rem; cursor: pointer; }

/* Intestazione di pagina */
.page-header { background: var(--gradient); color: var(--white); padding: 3rem 1.25rem 2.5rem; position: relative; overflow: hidden; }
.page-header::after {
    content: attr(data-watermark);
    position: absolute; top: 12%; right: -2%;
    font-family: 'JetBrains Mono', monospace; color: rgba(184, 134, 11, 0.08);
    font-size: 5rem; font-weight: 700; letter-spacing: 6px; transform: rotate(-12deg);
    pointer-events: none; user-select: none; white-space: nowrap;
}
.page-header-inner { max-width: 1000px; margin: 0 auto; position: relative; z-index: 1; }
.kicker { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--accent-light); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 0.6rem; }
.page-header h1 { font-size: 2.3rem; margin-bottom: 0.6rem; text-wrap: balance; }
.page-header .lead { opacity: 0.85; font-size: 1.05rem; max-width: 760px; }
.breadcrumb { font-size: 0.82rem; margin-bottom: 0.9rem; opacity: 0.8; }
.breadcrumb a { color: var(--accent-light); text-decoration: none; }

/* Contenuto */
.main { max-width: 1000px; margin: 0 auto; padding: 2.5rem 1.25rem 3.5rem; }
.main.narrow { max-width: 820px; }
.prose p { margin-bottom: 1rem; }
.prose h2 { font-size: 1.6rem; margin: 2.5rem 0 1rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--accent); }
.prose h3 { font-size: 1.2rem; margin: 1.8rem 0 0.6rem; }
.prose ul, .prose ol { margin: 0 0 1rem 1.4rem; }
.prose li { margin-bottom: 0.4rem; }
.prose blockquote { border-left: 3px solid var(--accent); background: var(--bg-paper); padding: 0.9rem 1.2rem; margin: 1rem 0 1.3rem; color: var(--text-light); border-radius: 0 6px 6px 0; }
.muted { color: var(--text-light); }
.small { font-size: 0.88rem; }

.box { background: var(--bg-paper); border-left: 4px solid var(--accent); padding: 1.2rem 1.5rem; border-radius: 0 8px 8px 0; margin: 0 0 2rem; }
.box p:last-child { margin-bottom: 0; }
.box.warn { border-left-color: var(--tier-d); }
.box.info { border-left-color: var(--tier-b); }

.section-title { font-size: 1.6rem; margin: 2.5rem 0 1rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--accent); }
.section-title:first-child { margin-top: 0; }

/* Card */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.card { background: var(--bg-paper); border-radius: 8px; padding: 1.3rem 1.4rem; border-left: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.03); text-decoration: none; color: inherit; display: block; transition: box-shadow 0.2s ease, transform 0.2s ease; }
a.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-1px); }
.card-kicker { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; color: var(--accent-dark); letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 0.35rem; font-weight: 600; }
.card h3 { font-size: 1.1rem; margin-bottom: 0.4rem; color: var(--primary); }
.card p { color: var(--text-light); font-size: 0.92rem; }

.news-item { background: var(--bg-paper); border-radius: 8px; padding: 1.3rem 1.5rem; margin-bottom: 1rem; border-left: 3px solid var(--accent); }
.news-item h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.news-item h3 a { color: var(--primary); text-decoration: none; }
.news-item h3 a:hover { color: var(--accent-dark); }
.news-item p { color: var(--text-light); font-size: 0.94rem; }
.read-more { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; text-decoration: none; color: var(--accent-dark); }

/* Livelli delle fonti */
.tier { display: inline-flex; align-items: center; gap: 0.35rem; font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.5px; padding: 0.15rem 0.5rem; border-radius: 3px; border: 1px solid currentColor; white-space: nowrap; text-decoration: none; }
.tier-a { color: var(--tier-a); }
.tier-b { color: var(--tier-b); }
.tier-c { color: var(--tier-c); }
.tier-d { color: var(--tier-d); }
.sources { margin-top: 1.6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sources h2 { font-size: 1.1rem; margin-bottom: 0.7rem; }
.sources ul { list-style: none; }
.sources li { margin-bottom: 0.45rem; font-size: 0.9rem; display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap; }

/* Tabelle */
.table-wrap { overflow-x: auto; margin: 0 0 1.8rem; }
table.data { width: 100%; border-collapse: collapse; background: var(--bg-paper); border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.04); font-size: 0.88rem; }
table.data th, table.data td { padding: 0.65rem 0.85rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { background: var(--primary); color: var(--white); font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; font-size: 0.74rem; }
table.data tr:last-child td { border-bottom: none; }
table.data td.num { font-family: 'JetBrains Mono', monospace; text-align: right; white-space: nowrap; }
table.data td.code { font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; white-space: nowrap; }

/* Archivio */
.filters { background: var(--bg-paper); border-radius: 8px; padding: 1rem 1.2rem; margin-bottom: 1.2rem; display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 0.7rem; align-items: end; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.filters label { font-size: 0.72rem; font-family: 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); display: block; margin-bottom: 0.25rem; }
.filters input, .filters select { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid rgba(0,0,0,0.15); border-radius: 5px; font: inherit; font-size: 0.9rem; background: var(--white); color: var(--text); }
.filters .checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: 0.88rem; }
.filters .checks label { font-family: inherit; text-transform: none; letter-spacing: 0; font-size: 0.88rem; color: var(--text); display: inline-flex; gap: 0.4rem; align-items: center; margin: 0; }
.filters .checks input { width: auto; }
.result-count { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; color: var(--text-light); margin-bottom: 0.8rem; }
.rec-list { list-style: none; }
.rec-row { background: var(--bg-paper); border-radius: 6px; padding: 0.75rem 1rem; margin-bottom: 0.45rem; display: grid; grid-template-columns: 9.5rem 1fr auto; gap: 0.9rem; align-items: baseline; border-left: 3px solid transparent; }
.rec-row:hover { border-left-color: var(--accent); }
.rec-row > * { min-width: 0; }
.rec-title, .rec-meta, .page-header h1, .prose li, .prose p { overflow-wrap: anywhere; }
.rec-row[hidden] { display: none; }
.rec-code { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--accent-dark); font-weight: 600; word-break: break-all; }
.rec-title a { color: var(--primary); text-decoration: none; font-weight: 500; font-size: 0.93rem; }
.rec-title a:hover { color: var(--accent-dark); }
.rec-meta { font-size: 0.78rem; color: var(--text-light); margin-top: 0.15rem; }
.rec-badges { display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: flex-end; }
.badge { font-family: 'JetBrains Mono', monospace; font-size: 0.66rem; padding: 0.1rem 0.4rem; border-radius: 3px; background: var(--bg); color: var(--text-light); white-space: nowrap; }
.badge.book { background: #f3e6c4; color: var(--accent-dark); }
.badge.flag { background: #f7dcdc; color: var(--tier-d); }

/* Scheda file */
.meta-grid { display: grid; grid-template-columns: 11rem 1fr; gap: 0; background: var(--bg-paper); border-radius: 8px; overflow: hidden; margin-bottom: 1.8rem; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.meta-grid dt, .meta-grid dd { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.meta-grid dt { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-light); background: rgba(0,0,0,0.02); }
.official-desc { background: var(--white); border: 1px solid var(--line); border-radius: 8px; padding: 1.2rem 1.4rem; margin-bottom: 1.8rem; }
.official-desc .label { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); margin-bottom: 0.5rem; }
.official-desc p { font-size: 0.93rem; color: var(--text); }
.actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 2rem; }
.btn { display: inline-block; padding: 0.65rem 1.2rem; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 0.9rem; border: 2px solid var(--primary); }
.btn-dark { background: var(--primary); color: var(--white); }
.btn-dark:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { color: var(--primary); }
.btn-ghost:hover { background: var(--primary); color: var(--white); }
.thumb { max-width: 260px; width: 100%; border-radius: 6px; border: 1px solid var(--line); margin-bottom: 1.5rem; display: block; }
.flag-list { list-style: none; }
.flag-list li { background: #fbefef; border-left: 3px solid var(--tier-d); padding: 0.7rem 1rem; border-radius: 0 6px 6px 0; margin-bottom: 0.5rem; font-size: 0.9rem; }

/* Glossario e cronologia */
.search-box { width: 100%; padding: 0.75rem 1rem; border: 1px solid rgba(0,0,0,0.15); border-radius: 6px; font: inherit; margin-bottom: 1.5rem; background: var(--white); }
.term { background: var(--bg-paper); border-radius: 6px; padding: 0.9rem 1.2rem; margin-bottom: 0.6rem; scroll-margin-top: 5rem; }
.term:target { box-shadow: 0 0 0 2px var(--accent); }
.term p { margin: 0; font-size: 0.94rem; }
.term .permalink { font-size: 0.75rem; text-decoration: none; margin-left: 0.4rem; opacity: 0.5; }
.term .added { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--tier-b); text-transform: uppercase; letter-spacing: 0.8px; display: block; margin-bottom: 0.25rem; }
.update-note { margin-top: 0.6rem !important; padding-top: 0.6rem; border-top: 1px dashed var(--line); font-size: 0.86rem !important; color: var(--text-light); }
.timeline { position: relative; margin-left: 0.6rem; padding-left: 1.6rem; border-left: 2px solid rgba(184,134,11,0.4); }
.tl-entry { position: relative; margin-bottom: 1.4rem; scroll-margin-top: 5rem; }
.tl-entry::before { content: ''; position: absolute; left: -2.05rem; top: 0.45rem; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.tl-entry.after-book::before { background: var(--accent); }
.tl-entry h3 { font-size: 1.02rem; font-family: 'Inter', sans-serif; font-weight: 600; margin-bottom: 0.25rem; }
.tl-entry p { font-size: 0.93rem; color: var(--text-light); }
.epoch { font-size: 1.5rem; margin: 2.2rem 0 1rem; }
.epoch-intro { color: var(--text-light); margin-bottom: 1.4rem; font-size: 0.95rem; }

/* Newsletter */
.newsletter { background: var(--primary); color: var(--white); border-radius: 10px; padding: 1.8rem 1.8rem; margin: 2.5rem 0 0; }
.newsletter h2 { font-size: 1.4rem; margin-bottom: 0.4rem; border: none; padding: 0; }
.newsletter p { opacity: 0.85; font-size: 0.93rem; margin-bottom: 1rem; }
.newsletter form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.newsletter input[type=email] { flex: 1 1 240px; padding: 0.7rem 0.9rem; border-radius: 6px; border: none; font: inherit; }
.newsletter button { padding: 0.7rem 1.3rem; border-radius: 6px; border: none; background: var(--accent); color: var(--white); font-weight: 600; cursor: pointer; font: inherit; }
.newsletter button:hover { background: var(--accent-light); }
.newsletter button:disabled { opacity: 0.6; cursor: wait; }
.newsletter .fine { font-size: 0.78rem; opacity: 0.7; margin: 0.7rem 0 0; }
.newsletter .fine a { color: var(--accent-light); }
.newsletter .ok { display: none; color: var(--accent-light); font-weight: 600; }
.newsletter .err { color: #feb2b2; font-size: 0.85rem; margin-top: 0.5rem; }

/* Footer */
.site-footer { background: #000; color: rgba(255,255,255,0.75); padding: 2rem 1.25rem; font-size: 0.86rem; }
.site-footer-inner { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.site-footer a { color: var(--accent-light); text-decoration: none; }
.site-footer a:hover { color: var(--white); }
.site-footer .links { display: flex; gap: 1rem; flex-wrap: wrap; }

@media (max-width: 860px) {
    .filters { grid-template-columns: 1fr 1fr; }
    .filters .search { grid-column: 1 / -1; }
    .rec-row { grid-template-columns: 1fr; gap: 0.2rem; }
    .rec-badges { justify-content: flex-start; }
}
@media (max-width: 720px) {
    .topbar-toggle { display: block; }
    .topbar-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--primary); flex-direction: column; padding: 0.8rem 1.25rem 1.2rem; gap: 0.8rem; }
    .topbar-links.open { display: flex; }
    .page-header { padding: 2.2rem 1rem 2rem; }
    .page-header h1 { font-size: 1.7rem; }
    .page-header::after { font-size: 3rem; right: -20%; }
    .main { padding: 2rem 1rem 3rem; }
    .meta-grid { grid-template-columns: 1fr; }
    .meta-grid dt { border-bottom: none; padding-bottom: 0.1rem; }
    .meta-grid dd { padding-top: 0.1rem; }
    .newsletter { padding: 1.4rem 1.2rem; }
}
