/* Controls */
  .controls {
    position: relative; z-index: 10;
    padding: 20px 40px;
    background: #ffffff;
    border-bottom: 1px solid rgba(96,92,60,0.12);
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  }

  .search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 300px; }
  .search-wrap input {
    width: 100%; background: #f5f3ee;
    border: 1px solid rgba(96,92,60,0.2); color: #2a2820;
    padding: 9px 14px 9px 36px;
    font-size: 0.86rem; font-family: 'DM Sans', sans-serif; outline: none; transition: border-color 0.3s;
  }
  .search-wrap input:focus { border-color: rgba(96,92,60,0.5); }
  .search-wrap input::placeholder { color: var(--text-muted); }
  .search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #7a7460; font-size: 0.8rem; pointer-events: none; }

  .filter-sep { width: 1px; height: 26px; background: rgba(96,92,60,0.15); flex-shrink: 0; }
  .filter-label { font-size: 0.73rem; letter-spacing: 0.1em; text-transform: uppercase; color: #7a7460; white-space: nowrap; }

  .filter-tags { display: flex; gap: 5px; flex-wrap: wrap; }
  .tag {
    background: transparent; border: 1px solid rgba(96,92,60,0.2); color: #7a7460;
    padding: 5px 11px; font-size: 0.74rem; letter-spacing: 0.05em;
    cursor: pointer; transition: all 0.2s; font-family: 'DM Sans', sans-serif;
  }
  .tag:hover { border-color: var(--gold); color: var(--gold); }
  .tag.active { background: rgba(96,92,60,0.1); border-color: #605c3c; color: #605c3c; }

  .view-toggle { margin-left: auto; display: flex; gap: 3px; }
  .view-btn {
    background: none; border: 1px solid rgba(96,92,60,0.2); color: #7a7460;
    padding: 7px 11px; cursor: pointer; font-size: 0.9rem; transition: all 0.2s;
  }
  .view-btn.active, .view-btn:hover { border-color: #605c3c; color: #605c3c; }

  /* Sort bar */
  .sort-bar {
    position: relative; z-index: 10;
    padding: 11px 40px; background: #faf9f6;
    border-bottom: 1px solid rgba(96,92,60,0.08);
    display: flex; align-items: center; gap: 16px;
  }
  .sort-label { font-size: 0.73rem; color: #7a7460; }
  .sort-btn {
    background: none; border: none; border-bottom: 1px solid transparent;
    color: #7a7460; font-size: 0.74rem; letter-spacing: 0.05em;
    cursor: pointer; font-family: 'DM Sans', sans-serif; padding: 2px 0; transition: all 0.2s;
  }
  .sort-btn.active, .sort-btn:hover { color: #605c3c; border-bottom-color: #605c3c; }
  .results-count { margin-left: auto; font-size: 0.77rem; color: #7a7460; }

  /* Grille */
  #figures-grid {
    position: relative; z-index: 10;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1px;
    background: rgba(96,92,60,0.12);
    border-top: 1px solid rgba(96,92,60,0.12);
    min-height: 200px;
  }
  #figures-grid.list-view { grid-template-columns: 1fr; }

  .figure-card {
    background: #ffffff;
    padding: 26px 30px;
    display: flex; gap: 18px; align-items: flex-start;
    cursor: pointer; transition: background 0.22s;
    text-decoration: none; color: inherit;
    animation: cardIn 0.3s ease both;
  }
  .figure-card:hover { background: #f5f3ee; }

  .figure-avatar {
    width: 50px; height: 50px; flex-shrink: 0;
    border: 1px solid rgba(96,92,60,0.2);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Scheherazade New', serif; font-size: 1.3rem;
    color: #605c3c; background: #ebe8e0; position: relative;
  }
  .figure-avatar::after { content: ''; position: absolute; inset: -4px; border: 1px solid rgba(96,92,60,0.1); }

  .figure-info { flex: 1; min-width: 0; }
  .figure-name {
    font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; font-weight: 600;
    margin-bottom: 2px; color: #2a2820; transition: color 0.22s;
  }
  .figure-card:hover .figure-name { color: #605c3c; }
  .figure-arabic-name { font-family: 'Scheherazade New', serif; font-size: 0.92rem; color: #605c3c; margin-bottom: 5px; display: block; }
  .figure-dates { font-size: 0.75rem; color: #7a7460; margin-bottom: 7px; }
  .figure-excerpt {
    font-size: 0.83rem; color: #6b6454; line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 10px;
  }
  .figure-tags { display: flex; gap: 4px; flex-wrap: wrap; }
  .ftag { font-size: 0.66rem; letter-spacing: 0.06em; color: #605c3c; border: 1px solid rgba(96,92,60,0.2); padding: 2px 7px; background: rgba(96,92,60,0.05); }

  .figure-arrow { flex-shrink: 0; align-self: center; color: rgba(96,92,60,0.2); font-size: 1rem; transition: all 0.22s; transform: translateX(-4px); }
  .figure-card:hover .figure-arrow { color: #605c3c; transform: translateX(0); }

  /* États */
  .state-empty {
    grid-column: 1 / -1; padding: 80px 40px; text-align: center; color: #7a7460;
  }
  .state-empty .empty-icon { font-size: 2.5rem; margin-bottom: 14px; display: block; opacity: 0.4; }
  .state-empty p { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; font-style: italic; }

  .state-loading { grid-column: 1 / -1; padding: 80px; text-align: center; }
  .spinner {
    width: 32px; height: 32px; margin: 0 auto 14px;
    border: 2px solid rgba(96,92,60,0.15); border-top-color: #605c3c;
    border-radius: 50%; animation: spin 0.7s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* Pagination */
  .pagination {
    position: relative; z-index: 10;
    display: flex; align-items: center; justify-content: center; gap: 5px;
    padding: 32px 40px; background: #faf9f6;
    border-top: 1px solid rgba(96,92,60,0.12);
  }
  .page-btn {
    background: none; border: 1px solid rgba(96,92,60,0.2); color: #7a7460;
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    font-size: 0.84rem; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s;
  }
  .page-btn.active, .page-btn:hover { background: rgba(96,92,60,0.08); border-color: #605c3c; color: #605c3c; }
  .page-btn:disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
  .page-btn.ellipsis { border: none; cursor: default; width: auto; padding: 0 4px; }
  .page-btn.ellipsis:hover { background: none; color: #7a7460; }
  .page-info { font-size: 0.76rem; color: #7a7460; margin: 0 10px; }

  mark { background: rgba(96,92,60,0.14); color: inherit; padding: 0 1px; border-radius: 1px; }

  @keyframes cardIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @media (max-width: 768px) {
    header, .controls, .sort-bar, .category-hero, .pagination { padding-left: 20px; padding-right: 20px; }
    .category-hero { flex-direction: column; }
    #figures-grid { grid-template-columns: 1fr; }
    .filter-sep { display: none; }
    nav { gap: 16px; }
    .hero-stats { gap: 24px; }
  }