/* ========================================
   LA COMPTA FACILE - Pages interieures
   ======================================== */

/* Banniere page */
.page-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 40px 0;
}
.page-banner h1 {
  color: #fff;
  font-size: 1.9rem;
  margin-bottom: 8px;
}
.page-banner .banner-subtitle {
  color: rgba(255,255,255,0.82);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}
.page-banner .banner-tag {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
}

/* Fil d'Ariane */
.breadcrumb-bar {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.breadcrumb ol {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-light);
}
.breadcrumb li + li::before {
  content: '›';
  color: var(--text-light);
  margin-right: 6px;
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb [aria-current] { color: var(--primary); font-weight: 500; }

/* Layout article + sidebar */
.article-wrap { padding: 48px 0 64px; }
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}
.article-body h2 { font-size: 1.4rem; margin: 36px 0 14px; }
.article-body h3 { font-size: 1.1rem; margin: 24px 0 10px; }
.article-body p { margin-bottom: 18px; line-height: 1.85; }
.article-body ul, .article-body ol { margin: 0 0 18px 24px; list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 8px; line-height: 1.7; }
.article-body strong { color: var(--dark); }

/* Encadres */
.info-box {
  background: var(--primary-pale);
  border-left: 4px solid var(--primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
  margin: 28px 0;
}
.info-box h3 { margin: 0 0 8px !important; font-size: 0.95rem !important; color: var(--primary) !important; }
.info-box p:last-child { margin-bottom: 0; }
.highlight-box {
  background: #fff8f0;
  border: 1px solid #e9a84c;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
}
.highlight-box h3 { color: #b7650a !important; margin: 0 0 8px !important; font-size: 0.95rem !important; }

/* Tableaux */
.table-responsive { overflow-x: auto; margin: 24px 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { background: var(--primary); color: #fff; padding: 12px 16px; text-align: left; font-weight: 600; font-family: 'Inter', sans-serif; }
td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:nth-child(even) td { background: var(--bg-alt); }
tr:last-child td { border-bottom: none; }

/* Sidebar */
.sidebar { position: sticky; top: 88px; }
.sidebar-block {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.sidebar-block h4 {
  font-size: 0.82rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  font-family: 'Inter', sans-serif;
}
.sidebar-toc { list-style: none; }
.sidebar-toc li { border-bottom: 1px solid var(--border); padding: 8px 0; font-size: 0.88rem; }
.sidebar-toc li:last-child { border-bottom: none; }
.sidebar-toc a { color: var(--text); display: flex; gap: 8px; align-items: flex-start; }
.sidebar-toc a::before { content: '#'; color: var(--primary-light); font-weight: 700; flex-shrink: 0; }
.sidebar-toc a:hover { color: var(--primary); }
.sidebar-links { list-style: none; }
.sidebar-links li { margin-bottom: 10px; }
.sidebar-links a { font-size: 0.88rem; color: var(--text); display: flex; align-items: center; gap: 6px; }
.sidebar-links a::before { content: ''; display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--primary-light); flex-shrink: 0; }
.sidebar-links a:hover { color: var(--primary); }
.sidebar-cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-lg);
  padding: 24px;
  color: #fff;
  margin-bottom: 20px;
}
.sidebar-cta h4 { color: #fff; font-size: 0.95rem; margin-bottom: 8px; font-family: 'Merriweather', serif; }
.sidebar-cta p { font-size: 0.85rem; color: rgba(255,255,255,0.85); margin-bottom: 14px; }
.sidebar-cta a { display: inline-block; background: #fff; color: var(--primary); padding: 8px 18px; border-radius: 6px; font-weight: 600; font-size: 0.85rem; font-family: 'Inter', sans-serif; }

/* Lexique */
.definition-letter-badge {
  width: 56px; height: 56px;
  background: var(--primary); color: #fff;
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Merriweather', serif; font-size: 1.5rem; font-weight: 900;
}
.definition-category-tag {
  display: inline-block;
  background: var(--primary-pale); color: var(--primary);
  padding: 3px 10px; border-radius: 4px;
  font-size: 0.78rem; font-weight: 500; font-family: 'Inter', sans-serif;
}
.terms-section { margin-top: 48px; padding-top: 32px; border-top: 2px solid var(--border); }
.terms-section h2 { font-size: 1.2rem; margin-bottom: 20px; }
.terms-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.terms-grid span, .terms-grid a {
  display: block; padding: 8px 12px;
  background: var(--bg-alt); border-radius: 6px;
  font-size: 0.85rem; color: var(--text); border: 1px solid var(--border);
}
.terms-grid a:hover { background: var(--primary-pale); color: var(--primary); }

/* Navigation lettres */
.letter-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0; }
.letter-nav a {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; font-weight: 700; font-size: 0.9rem;
  background: var(--primary-pale); color: var(--primary);
  border: 1px solid var(--border); transition: background 0.2s, color 0.2s;
}
.letter-nav a:hover, .letter-nav a.current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Grille guides */
.page-section { padding: 48px 0; }
.page-section h2 { font-size: 1.5rem; margin-bottom: 8px; }
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.content-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px;
  box-shadow: 0 2px 10px var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex; flex-direction: column;
}
.content-card:hover { box-shadow: 0 6px 24px var(--shadow); transform: translateY(-2px); }
.card-tag {
  display: inline-block; background: var(--primary-pale); color: var(--primary);
  padding: 4px 10px; border-radius: 4px; font-size: 0.75rem; font-weight: 600;
  margin-bottom: 12px; font-family: 'Inter', sans-serif;
}
.content-card h3 { font-size: 1rem; margin-bottom: 10px; line-height: 1.4; }
.content-card h3 a { color: var(--dark); }
.content-card h3 a:hover { color: var(--primary); }
.content-card p { font-size: 0.88rem; color: var(--text-light); flex: 1; margin-bottom: 16px; line-height: 1.7; }
.card-link { font-size: 0.85rem; font-weight: 600; color: var(--primary-light); display: flex; align-items: center; gap: 4px; font-family: 'Inter', sans-serif; }
.card-link:hover { color: var(--primary); }

/* Lexique index */
.lexique-index-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 32px; }
.lexique-letter-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 16px; text-align: center; transition: box-shadow 0.2s, transform 0.2s; }
.lexique-letter-card:hover { box-shadow: 0 4px 16px var(--shadow); transform: translateY(-2px); }

/* Contact */
.contact-form { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; max-width: 640px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; color: var(--dark); font-family: 'Inter', sans-serif; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.95rem; font-family: 'Inter', sans-serif;
  color: var(--text); background: var(--bg-alt); transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary-light); background: #fff; }
.form-group textarea { min-height: 140px; resize: vertical; }

/* FAQ */
.faq-list { max-width: 760px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.faq-question {
  padding: 18px 24px; background: var(--bg-alt);
  font-weight: 600; font-size: 0.95rem; color: var(--dark);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none;
}
.faq-question::after { content: '+'; font-size: 1.2rem; color: var(--primary); }
.faq-item.open .faq-question::after { content: '−'; }
.faq-answer { padding: 0 24px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; font-size: 0.92rem; line-height: 1.8; }
.faq-item.open .faq-answer { max-height: 600px; padding: 16px 24px 20px; }

/* Etapes */
.steps-list { list-style: none; counter-reset: step-counter; margin: 0 0 20px; }
.steps-list li { counter-increment: step-counter; display: flex; gap: 16px; margin-bottom: 20px; align-items: flex-start; }
.steps-list li::before { content: counter(step-counter); display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: var(--primary); color: #fff; border-radius: 50%; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; margin-top: 2px; }

/* Lettre sans terme */
.empty-letter-box { text-align: center; padding: 60px 20px; background: var(--bg-alt); border-radius: var(--radius-lg); border: 1px dashed var(--border); }
.empty-letter-box .big-letter { font-family: 'Merriweather', serif; font-size: 5rem; color: var(--border); line-height: 1; margin-bottom: 16px; }

/* Texte legal */
.prose h2 { font-size: 1.25rem; margin: 32px 0 12px; }
.prose p { margin-bottom: 16px; line-height: 1.85; font-size: 0.95rem; }
.prose ul { margin: 0 0 16px 24px; list-style: disc; }
.prose li { margin-bottom: 6px; font-size: 0.95rem; line-height: 1.7; }

/* Responsive */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr 260px; gap: 28px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .lexique-index-grid { grid-template-columns: repeat(3, 1fr); }
  .terms-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .cards-grid { grid-template-columns: 1fr; }
  .lexique-index-grid { grid-template-columns: repeat(2, 1fr); }
  .terms-grid { grid-template-columns: repeat(2, 1fr); }
  .page-banner h1 { font-size: 1.5rem; }
  .contact-form { padding: 24px; }
}
@media (max-width: 480px) {
  .terms-grid { grid-template-columns: 1fr; }
  .letter-nav a { width: 38px; height: 38px; font-size: 0.82rem; }
}

/* ========================================
   ILLUSTRATIONS SVG PEDAGOGIQUES
   ======================================== */

.svg-illustration {
  margin: 28px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}
.svg-illustration svg {
  display: block;
  width: 100%;
  min-width: 480px;
  height: auto;
}
