/* ─── KITAB HEADER ─── */

.section-kitab-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-bottom: 4px solid var(--gold);
    padding: 40px 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.section-kitab-hero::before {
    content: '';
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    background: url(../../resources/img/jumbotron.svg);
    background-size: 500px;
    background-repeat: no-repeat;
    background-position: -40px 20px;
    opacity: 0.7;
    z-index: 1;
}
  .kitab-header {
    position: relative;
    z-index: 5;
    padding: 3rem 4rem 2rem;
    border-bottom: 1px solid var(--border);
    max-width: 1400px;
    margin: 0 auto;
  }

  .kitab-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
  }

  .kitab-tag {
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1rem;
    display: block;
  }

  .kitab-ar {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 2.2rem;
    color: var(--parchment);
    direction: rtl;
    line-height: 1.3;
    margin-bottom: 0.3rem;
  }

  .kitab-fr {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--parchment-dark);
    margin-bottom: 0.4rem;
  }

  .kitab-source {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
  }

  .kitab-meta-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
  }

  .km {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }

  .km-label {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .km-val {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold-light);
    line-height: 1;
  }

  .chapter-nav {
          max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 240px;
    max-height: 220px;
    overflow-y: auto;
    background: rgba(245,239,228,0.025);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.8rem;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) transparent;
  }

  .chapter-nav-title {
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.4rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
  }

  .chapter-nav a {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.25rem 0.4rem;
    border-radius: 2px;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .chapter-nav a:hover, .chapter-nav a.active {
    background: rgba(200,146,42,0.1);
    color: var(--parchment-dark);
  }

  .chap-count {
    font-size: 0.7rem;
    color: var(--gold);
    opacity: 0.6;
  }
  
  
  
  /* ─── CONTROLS ─── */
  .controls {
    position: relative;
    z-index: 5;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 4rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
  }

  .count-info {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-muted);
    flex: 1;
  }

  .ctrl-btns {
    display: flex;
    gap: 0.3rem;
  }

  .ctrl-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--parchment-dark);
    padding: 0.35rem 0.85rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 2px;
  }

  .ctrl-btn.active, .ctrl-btn:hover {
    background: rgba(200,146,42,0.12);
    border-color: var(--gold);
    color: var(--gold-light);
  }
  
  
  
  /* ─── CHAPTER SEPARATOR ─── */
  .chapter-sep {
    position: relative;
    z-index: 5;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.5rem 4rem 1.5rem;
    scroll-margin-top: 80px;
  }

  .chapter-sep-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .chap-sep-num {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
    opacity: 1;
    min-width: 2.5rem;
  }

  .chap-sep-names {
    flex: 1;
  }

  .chap-sep-ar {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.15rem;
        color: var(--gold);
    direction: rtl;
    text-align: right;
    line-height: 1.4;
  }

  .chap-sep-fr {
    font-size: 0.9rem;
    font-style: italic;
        color: var(--gold);
  }
  
  .chap-sep-content-ar {
        padding: 12px;
        font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.15rem;

    direction: rtl;
    text-align: right;
    line-height: 1.4;
    }

  .chap-sep-count {
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
        color: var(--gold);
    white-space: nowrap;
  }
  
  
  
  
  
  /* ─── HADITH CARD ─── */
  .hadith-card {
    margin: 0 4rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
    transition: border-color 0.3s;
    animation: fadeCard 0.4s ease both;
  }

  .hadith-card:hover { border-color: rgba(200,146,42,0.4); }

  @keyframes fadeCard {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* ─── HADITH HEADER ─── */
  .hadith-head {
     background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gold);
    cursor: pointer;
    user-select: none;
  }

  .hadith-head:hover { }

  .hadith-num {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
    opacity: 1;
    min-width: 3rem;
  }

  .hadith-source-badge {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgb(74 57 26 / 25%);
    border: 1px solid rgb(74 53 26 / 40%);
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    white-space: nowrap;
  }

  .hadith-preview-fr {
    flex: 1;
    font-size: 0.9rem;
    font-style: italic;
    color: rgba(245,239,228,0.55);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hadith-expand-btn {
    color: var(--gold);
    opacity: 0.5;
    font-size: 0.9rem;
    transition: all 0.25s;
    flex-shrink: 0;
  }

  .hadith-card.open .hadith-expand-btn {
    opacity: 1;
    transform: rotate(90deg);
  }

  /* ─── HADITH BODY ─── */
  .hadith-body {
      background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: none;
  }

  .hadith-card.open .hadith-body {
    display: block;
  }

  /* ─── ARABIC TEXT ─── */
  .hadith-ar-block {
    padding: 1.8rem 2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(200,146,42,0.025);
    text-align: right;
    direction: rtl;
  }

  .hadith-ar-text {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.45rem;
    line-height: 2.2;
    color: var(--parchment);
    letter-spacing: 0.02em;
  }

  /* ─── FRENCH TEXT ─── */
  .hadith-fr-block {
    padding: 1.8rem 2rem;
    border-bottom: 1px solid var(--border);
  }

  .hadith-fr-label {
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.8rem;
    display: block;
    opacity: 0.7;
  }

  .hadith-fr-text {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--parchment-dark);
   
  }

  /* ─── ISNAD (CHAÎNE) ─── */
  .hadith-isnad-block {
    padding: 1.2rem 2rem;
    border-bottom: 1px solid var(--border);
  }

  .isnad-label {
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.8rem;
    display: block;
    opacity: 0.7;
  }

  .isnad-chain {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
  }

  .isnad-person {
    display: flex;
    align-items: center;
    gap: 0;
  }

  .isnad-name {
    background: rgba(245,239,228,0.04);
    border: 1px solid var(--border);
    padding: 0.3rem 0.7rem;
    font-size: 0.82rem;
    color: var(--parchment-dark);
    border-radius: 2px;
    white-space: nowrap;
    cursor: default;
    transition: all 0.2s;
    position: relative;
  }

  .isnad-name:hover {
    background: rgba(200,146,42,0.1);
    border-color: var(--gold);
    color: var(--gold-light);
    z-index: 2;
  }

  .isnad-name.prophet {
    background: rgba(200,146,42,0.12);
    border-color: rgba(200,146,42,0.4);
    color: var(--gold-light);
    font-weight: 600;
  }

  .isnad-arrow {
    color: var(--gold);
    opacity: 0.35;
    font-size: 0.75rem;
    padding: 0 0.4rem;
  }

  .isnad-ar-block {
    margin-top: 0.8rem;
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.05rem;
    color: rgba(245,239,228,0.5);
    direction: rtl;
    text-align: right;
    line-height: 1.8;
    font-style: normal;
    border-top: 1px dashed rgba(200,146,42,0.15);
    padding-top: 0.8rem;
  }

  /* ─── FOOTER META ─── */
  .hadith-footer {
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .hadith-meta-items {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
  }

  .hadith-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
  }

  .meta-item-label {
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .meta-item-val {
    font-size: 0.85rem;
    color: var(--parchment-dark);
  }

  .meta-item-val.sahih { color: #7ecfcf; }
  .meta-item-val.hasan { color: #e8956a; }

  .hadith-actions {
    display: flex;
    gap: 0.5rem;
  }

  .action-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: 1px solid var(--border);
    color: var(--parchment-dark);
    padding: 0.4rem 0.9rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 2px;
    text-decoration: none;
  }

  .action-btn:hover {
    background: rgba(245,239,228,0.05);
    border-color: var(--parchment-dark);
    color: var(--parchment);
  }

  .action-btn.propose {
    background: rgba(200,146,42,0.08);
    border-color: rgba(200,146,42,0.35);
    color: var(--gold-light);
  }

  .action-btn.propose:hover {
    background: rgba(200,146,42,0.18);
    border-color: var(--gold);
  }

  /* ─── TRANSLATION PROPOSAL MODAL ─── */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
  }

  .modal-overlay.open { display: flex; }

  .modal {
    background: #211808;
    border: 1px solid rgba(200,146,42,0.4);
    border-radius: 4px;
    padding: 2.5rem;
    max-width: 620px;
    width: 90%;
    position: relative;
    animation: modalIn 0.3s ease;
  }

  @keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }

  .modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
  }

  .modal-close:hover { color: var(--parchment); }

  .modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 0.4rem;
  }

  .modal-sub {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
  }

  .modal-hadith-ref {
    background: rgba(200,146,42,0.05);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    font-style: italic;
    color: rgba(245,239,228,0.55);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .modal-field label {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.7;
    margin-bottom: 0.5rem;
  }

  .modal-field textarea, .modal-field input {
    width: 100%;
    background: rgba(245,239,228,0.04);
    border: 1px solid var(--border);
    color: var(--parchment);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    padding: 0.7rem 0.9rem;
    border-radius: 2px;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s;
  }

  .modal-field textarea:focus, .modal-field input:focus {
    border-color: var(--gold);
  }

  .modal-field { margin-bottom: 1rem; }

  .modal-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    margin-top: 1.5rem;
  }

  .modal-cancel {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.6rem 1.3rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s;
  }

  .modal-cancel:hover { color: var(--parchment-dark); border-color: var(--parchment-dark); }

  .modal-submit {
    background: var(--gold);
    border: none;
    color: var(--ink);
    padding: 0.6rem 1.5rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    font-weight: 600;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.2s;
  }

  .modal-submit:hover { background: var(--gold-light); }
  
  @media (max-width: 1200px) {
      main{
          padding:20px;
      }
  }
  
  @media (max-width: 768px) {
    .hadith-content {
        padding: 0px;
    }
    header { padding: 1rem 1.5rem; }
    .kitab-header, .controls, .chapter-sep { padding-left: 1.5rem; padding-right: 1.5rem; }
    .hadith-card { margin: 0 1.5rem 1rem; }
    .kitab-header-inner { flex-direction: column; }
    .chapter-nav { display: none; }
    .hadith-ar-text { font-size: 1.2rem; }
    footer { padding: 1rem 1.5rem; }
  }
  