/* ============================================================
   Archives Départementales de France
   Style cohérent avec le design system GeneBase
   ============================================================ */

/* ─── LAYOUT PRINCIPAL ──────────────────────────────────────── */

.arch-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-4) var(--space-12);
}

/* ─── INTRODUCTION ──────────────────────────────────────────── */

.tool-intro {
  text-align: center;
  margin-bottom: var(--space-8);
  padding: var(--space-8);
  background: var(--clr-bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--clr-accent);
  position: relative;
  overflow: hidden;
}

.tool-intro::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-accent), var(--clr-accent-hover));
}

.tool-intro h2 {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--space-3);
}

.tool-intro p {
  font-size: var(--text-base);
  color: var(--clr-text-secondary);
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
}

/* ─── OUTIL DE RECHERCHE ────────────────────────────────────── */

.archives-tool {
  background: var(--clr-bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-10);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--clr-border);
  border-left: 4px solid var(--clr-accent);
  margin-bottom: var(--space-8);
  position: relative;
  overflow: hidden;
}

.archives-tool::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-accent), var(--clr-accent-hover));
}

/* ─── ÉTAPES ────────────────────────────────────────────────── */

.step-container {
  margin-bottom: var(--space-8);
}

.step-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  background: var(--clr-accent);
  color: #fff;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--text-base);
}

.step-header h3 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--clr-text);
  margin: 0;
  flex: 1;
}

.step-actions {
  display: flex;
  gap: var(--space-2);
}

/* ─── BOUTONS D'ACTION ──────────────────────────────────────── */

.report-button,
.favorites-button {
  border: none;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--ease-fast), box-shadow var(--ease-fast), background var(--ease-fast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.report-button {
  background: var(--clr-accent);
  color: #fff;
}

.report-button:hover {
  background: var(--clr-accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.favorites-button {
  background: #f59e0b;
  color: #fff;
}

.favorites-button:hover {
  background: #d97706;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.favorites-button.added {
  background: var(--clr-success);
}

.favorites-button.added:hover {
  background: var(--clr-primary);
}

.report-button:active,
.favorites-button:active {
  transform: translateY(0);
}

/* ─── SECTION FAVORIS ───────────────────────────────────────── */

.favorites-container {
  background: rgba(199, 144, 30, 0.08);
  border: 1px solid rgba(199, 144, 30, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  border-left: 4px solid #f59e0b;
}

.favorites-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.favorites-header h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--clr-text);
  margin: 0;
}

.clear-favorites-btn {
  background: var(--clr-error);
  color: #fff;
  border: none;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ease-fast), transform var(--ease-fast);
}

.clear-favorites-btn:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

.favorites-selector {
  max-width: 400px;
}

/* ─── SÉLECTEUR DE DÉPARTEMENT ──────────────────────────────── */

.department-selector {
  max-width: 420px;
}

.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  background: var(--clr-bg);
  color: var(--clr-text);
  cursor: pointer;
  transition: border-color var(--ease-base), box-shadow var(--ease-base), transform var(--ease-base);
}

.form-select:focus {
  outline: none;
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px var(--clr-accent-light);
  transform: translateY(-1px);
}

.form-select:hover {
  border-color: var(--clr-accent-hover);
}

/* ─── GRILLE DES SECTIONS ───────────────────────────────────── */

.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.section-card {
  background: var(--clr-bg);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  text-align: center;
  cursor: pointer;
  transition: transform var(--ease-base), box-shadow var(--ease-base), border-color var(--ease-base);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--clr-text);
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--clr-accent);
  transform: scaleX(0);
  transition: transform var(--ease-base);
}

.section-card:hover::before {
  transform: scaleX(1);
}

.section-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--clr-accent);
}

.section-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--clr-bg-elevated);
}

.section-card.disabled:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--clr-border);
}

.section-card.disabled::before {
  background: var(--clr-text-muted);
}

.section-icon {
  font-size: 2rem;
  margin-bottom: var(--space-3);
  display: block;
}

.section-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: var(--clr-text);
}

.section-description {
  font-size: var(--text-xs);
  color: var(--clr-text-secondary);
  line-height: 1.4;
}

.section-card.disabled .section-title,
.section-card.disabled .section-description {
  color: var(--clr-text-muted);
}

/* ─── MESSAGE D'INFORMATION ─────────────────────────────────── */

.info-message {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6);
  background: var(--clr-accent-light);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text);
}

.info-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.info-message p {
  margin: 0;
  font-size: var(--text-base);
}

/* ─── HISTOIRE DU DÉPARTEMENT ───────────────────────────────── */

.department-story {
  background: var(--clr-bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  border: 1px solid var(--clr-border);
  border-left: 4px solid var(--clr-primary);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  margin-top: var(--space-8);
}

.department-story::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
}

.department-story h3 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--space-6);
  text-align: center;
}

.story-content {
  font-size: var(--text-base);
  color: var(--clr-text);
  line-height: 1.7;
  text-align: justify;
}

.story-content p {
  margin-bottom: var(--space-4);
}

.story-content p:last-child {
  margin-bottom: 0;
}

.story-highlight {
  color: var(--clr-accent);
  font-weight: 600;
}

/* ─── SECTIONS SEO ──────────────────────────────────────────── */

.arch-seo-section {
  padding: var(--space-12) 0 var(--space-8);
  border-top: 1px solid var(--clr-separator);
}

.faq-section,
.document-types,
.popular-departments {
  background: var(--clr-bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-10);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--clr-border);
  border-left: 4px solid var(--clr-accent);
  position: relative;
  overflow: hidden;
}

.faq-section::before,
.document-types::before,
.popular-departments::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-accent), var(--clr-accent-hover));
}

.faq-section h2,
.document-types h2,
.popular-departments h2 {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: var(--space-8);
  text-align: center;
}

.faq-item {
  margin-bottom: var(--space-6);
  padding: var(--space-6);
  background: var(--clr-accent-light);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--clr-accent);
}

.faq-item h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--clr-accent);
  margin-bottom: var(--space-3);
}

.faq-item p {
  line-height: 1.6;
  color: var(--clr-text);
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.document-type {
  padding: var(--space-6);
  background: var(--clr-accent-light);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--clr-accent);
}

.document-type h3 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--clr-accent);
  margin-bottom: var(--space-3);
}

.document-type p {
  line-height: 1.6;
  color: var(--clr-text);
  font-size: var(--text-sm);
}

.dept-list p {
  line-height: 1.8;
  color: var(--clr-text);
  text-align: justify;
}

/* ─── RESPONSIVE ────────────────────────────────────────────── */

@media (max-width: 768px) {
  .arch-layout {
    padding: var(--space-6) var(--space-4) var(--space-10);
  }

  .tool-intro {
    padding: var(--space-6);
    margin-bottom: var(--space-6);
  }

  .tool-intro h2 {
    font-size: var(--text-xl);
  }

  .archives-tool {
    padding: var(--space-6);
  }

  .step-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .sections-grid {
    grid-template-columns: 1fr;
  }

  .section-card {
    padding: var(--space-4);
  }

  .department-story {
    padding: var(--space-6);
  }

  .faq-section,
  .document-types,
  .popular-departments {
    padding: var(--space-6);
    margin-bottom: var(--space-6);
  }

  .faq-section h2,
  .document-types h2,
  .popular-departments h2 {
    font-size: var(--text-xl);
  }

  .document-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .faq-item,
  .document-type {
    padding: var(--space-4);
  }
}

@media (max-width: 480px) {
  .archives-tool {
    padding: var(--space-4);
  }

  .step-number {
    width: 2rem;
    height: 2rem;
    font-size: var(--text-sm);
  }

  .step-header h3 {
    font-size: var(--text-base);
  }

  .form-select {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
  }

  .section-icon {
    font-size: 1.75rem;
  }

  .section-title {
    font-size: var(--text-sm);
  }
}
