/* ============================================================
   Avis-SCPI.fr — Design minimaliste
   ============================================================ */

:root {
  --accent: #1d6fa4;
  --accent-light: #e8f2fa;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* ---- Navigation ---- */
nav {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 2rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color .15s;
}
.nav-links a:hover { color: var(--accent); }

/* ---- Layout ---- */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
h2 { font-size: 1.2rem; font-weight: 600; margin: 2rem 0 1rem; color: var(--text); }
h3 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }

p { margin-bottom: 1rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Breadcrumb ---- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--border); }

/* ---- Hero / intro ---- */
.page-intro {
  margin-bottom: 2rem;
}
.page-intro .subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* ---- Métriques ---- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.metric-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.metric-card .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.metric-card .value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.metric-card .value.accent { color: var(--accent); }

/* ---- Note globale ---- */
.note-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  padding: 0.2rem 0.75rem;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ---- Sections texte IA ---- */
.ia-section {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.ia-section h3 { margin: 0 0 0.5rem; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.ia-section p { margin: 0; font-size: 0.95rem; }

/* ---- Points positifs / négatifs ---- */
.points-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
@media (max-width: 640px) { .points-grid { grid-template-columns: 1fr; } }

.points-list { list-style: none; }
.points-list li {
  padding: 0.4rem 0;
  font-size: 0.9rem;
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
}
.points-list li:last-child { border-bottom: none; }
.points-list .icon { flex-shrink: 0; font-size: 0.85rem; margin-top: 0.1rem; }

/* ---- Tableaux ---- */
.table-wrap { overflow-x: auto; margin: 1rem 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
thead th {
  background: var(--bg-alt);
  border-bottom: 2px solid var(--border);
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
thead th:hover { color: var(--accent); }
thead th.sorted { color: var(--accent); }
thead th.sorted::after { content: " ↓"; }
thead th.sorted.asc::after { content: " ↑"; }

tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:hover { background: var(--accent-light); }
tbody td { padding: 0.6rem 0.75rem; vertical-align: top; }
tbody td:first-child { font-weight: 500; }

.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }

/* ---- Search ---- */
.search-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: center;
}
#search-input {
  flex: 1;
  max-width: 360px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color .15s;
}
#search-input:focus { border-color: var(--accent); }
#result-count { font-size: 0.85rem; color: var(--text-muted); }

/* ---- Graphiques ---- */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.chart-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.chart-card h3 {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.chart-card canvas { max-height: 220px; }

/* ---- Liens documents ---- */
.doc-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin: 0.75rem 0; }
.doc-list li a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.doc-list li a:hover { border-color: var(--accent); background: var(--accent-light); text-decoration: none; }
.doc-list .pdf-icon { color: #e53e3e; font-size: 0.8rem; }

/* ---- Bouton téléchargement PDF ---- */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity .15s;
}
.btn-download:hover { opacity: 0.88; text-decoration: none; }

/* ---- Tags type actif ---- */
.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--accent-light);
  color: var(--accent);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.4rem; }
}

/* ---- Footer ---- */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}
