/* === Nav dropdown menus (hover, no XenForo JS) === */
.p-navEl[data-has-children] { position: relative; }
.p-navEl[data-has-children]:hover > .menu {
    display: block;
    opacity: 1;
    top: 100%;
    left: 0;
    margin-top: 0;
}

/* === Hadith App — scoped under .hadith-app === */

.hadith-app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    min-height: 60vh;
    background: #f0f4f8;
}

/* --- Page header --- */
.hadith-page-header {
    margin-bottom: 28px;
    text-align: center;
}
.hadith-page-header h1 {
    font-size: 1.6em;
    color: #0f578a;
    margin: 0 0 8px;
    border-bottom: 3px solid #0f578a;
    display: inline-block;
    padding-bottom: 6px;
}
.hadith-page-header p {
    color: #666;
    margin: 0;
}
.hadith-page-header-arabic {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.6em;
    color: #3b1f7a;
    margin: 0 0 10px;
    line-height: 1.8;
    font-weight: 700;
}
.hadith-page-header-english {
    font-size: 1.15em;
    color: #0f578a;
    margin: 0 0 6px;
    font-weight: 600;
}

/* --- Search bar --- */
.hadith-search-bar {
    margin-bottom: 28px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.hadith-search-bar form {
    display: flex;
    gap: 8px;
}
.hadith-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #d4dce5;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s;
}
.hadith-search-input:focus {
    border-color: #0f578a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 87, 138, 0.15);
}
.hadith-search-btn {
    padding: 10px 20px;
    background: #0f578a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.hadith-search-btn:hover {
    background: #0d4a73;
}

/* --- Toolbar (unified bar) --- */
.hadith-toolbar {
    display: flex;
    align-items: stretch;
    margin-bottom: 28px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    border: 2px solid #0f578a;
    border-radius: 8px;
    overflow: hidden;
}
.hadith-toolbar-search {
    display: flex;
    flex: 1;
    min-width: 0;
}
.hadith-toolbar .hadith-search-input {
    border: none;
    border-radius: 0;
    padding: 11px 14px;
    font-size: 14px;
    flex: 1;
    min-width: 0;
    background: transparent;
}
.hadith-toolbar .hadith-search-input:focus {
    outline: none;
    box-shadow: none;
    background: #f0f5fa;
}
.hadith-toolbar-sep {
    width: 1px;
    background: #d4dce5;
    flex-shrink: 0;
}
.hadith-toolbar-jump {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}
.hadith-jump-select {
    padding: 11px 10px;
    border: none;
    border-left: 1px solid #d4dce5;
    border-radius: 0;
    font-size: 14px;
    max-width: 160px;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s;
}
.hadith-jump-select:focus {
    outline: none;
    box-shadow: none;
    background: #f0f5fa;
}
.hadith-jump-num {
    width: 72px;
    padding: 11px 10px;
    border: none;
    border-left: 1px solid #d4dce5;
    border-radius: 0;
    font-size: 14px;
    background: transparent;
    transition: background 0.15s;
}
.hadith-jump-num:focus {
    outline: none;
    box-shadow: none;
    background: #f0f5fa;
}
@media (max-width: 600px) {
    .hadith-toolbar {
        flex-wrap: wrap;
    }
    .hadith-toolbar-search {
        width: 100%;
        flex: 1 1 100%;
    }
    .hadith-toolbar-sep {
        width: 100%;
        height: 1px;
    }
    .hadith-toolbar-jump {
        width: 100%;
        flex: 1 1 100%;
    }
    .hadith-jump-select {
        flex: 1;
        max-width: none;
        border-left: none;
        border-top: 1px solid #d4dce5;
    }
    .hadith-jump-num {
        width: 60px;
        border-top: 1px solid #d4dce5;
    }
}

/* --- Card grid (books + chapters) --- */
.hadith-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
    margin-bottom: 30px;
}
.hadith-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #f8fafb;
    border: 1px solid #d4dce5;
    border-top: 5px solid #0f578a;
    border-bottom: 4px solid #d4dce5;
    border-radius: 14px;
    padding: 35px 20px 25px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(.25, .8, .25, 1);
    box-shadow: 0 8px 20px rgba(15, 87, 138, 0.04);
    overflow: hidden;
}
.hadith-card::before {
    content: "\01F4D6";
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 90px;
    opacity: 0.03;
    transform: rotate(20deg);
    pointer-events: none;
    filter: grayscale(100%);
}
.hadith-card:hover {
    transform: translateY(-6px);
    border-color: #0f578a;
    border-top-color: #0d4a73;
    border-bottom-color: #0f578a;
    box-shadow: 0 16px 35px rgba(15, 87, 138, 0.14);
}

/* Card number badge */
.hadith-card-num {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #0f578a;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 5px;
    min-width: 24px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(15, 87, 138, 0.2);
    border: 2px solid #1a6faa;
    z-index: 2;
}

/* Card Arabic title (primary — shown first) */
.hadith-card-arabic-title {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.3em;
    color: #3b1f7a;
    margin: 0 0 6px;
    line-height: 1.7;
    z-index: 2;
    font-weight: 700;
}
.hadith-card-arabic-title::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    background-color: #0f578a;
    margin: 10px auto 0;
    border-radius: 2px;
    opacity: 0.4;
}

/* Card English title (secondary — shown after Arabic) */
.hadith-card-title {
    font-size: 1em;
    color: #0f578a;
    margin: 8px 0 6px;
    font-weight: 500;
    line-height: 1.4;
    z-index: 2;
    transition: color 0.3s;
}
.hadith-card:hover .hadith-card-title {
    color: #0a3d60;
}

/* Card meta (author, count, range) */
.hadith-card-meta {
    color: #777;
    font-size: 0.85em;
    margin: 4px 0 0;
    line-height: 1.5;
    z-index: 2;
}

/* --- Hadith list (chapter / search) --- */
.hadith-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 24px;
}
.hadith-list-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #eaedf1;
    border-left: 3px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, border-color 0.15s;
}
.hadith-list-item:hover {
    background: #e8f0f7;
    border-left-color: #0f578a;
}
.hadith-list-num {
    flex-shrink: 0;
    color: #0f578a;
    font-weight: 600;
    font-size: 0.9em;
    min-width: 80px;
}
.hadith-list-text {
    color: #444;
    font-size: 0.92em;
    line-height: 1.5;
}

/* --- Subchapter headings --- */
.hadith-subchapter-heading {
    padding: 10px 16px;
    background: linear-gradient(135deg, #e8f0f7, #f0f5fa);
    color: #0f578a;
    font-weight: 600;
    font-size: 0.95em;
    border-radius: 6px;
    margin: 8px 0 2px;
    border-left: 4px solid #0f578a;
}
.hadith-subchapter-arabic {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.1em;
    color: #3b1f7a;
    font-weight: 400;
    margin-top: 4px;
    line-height: 1.8;
}

/* --- Full hadith card (subchapter view) --- */
.hadith-full-card {
    background: #f8fafb;
    border: 1px solid #d4dce5;
    border-top: 5px solid #0f578a;
    border-radius: 12px;
    padding: 30px 28px;
    margin-bottom: 30px;
    box-shadow: 0 6px 18px rgba(15, 87, 138, 0.05);
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}
.hadith-full-num {
    display: inline-block;
    background: #0f578a;
    color: #fff;
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 700;
    margin-bottom: 18px;
    border: 2px solid #1a6faa;
}
.hadith-full-card .hadith-arabic {
    margin-bottom: 18px;
}
.hadith-full-card .hadith-english {
    border-bottom: none;
    margin-bottom: 12px;
    padding-bottom: 12px;
}
.hadith-full-link {
    text-align: right;
    padding-top: 8px;
    border-top: 1px solid #e8ecf0;
}
.hadith-full-link a {
    color: #0f578a;
    text-decoration: none;
    font-size: 0.88em;
    font-weight: 500;
}
.hadith-full-link a:hover {
    color: #0d4a73;
    text-decoration: underline;
}

/* --- Hadith metadata (grading, takhrij) --- */
.hadith-meta-section {
    margin-top: 16px;
    padding: 18px 20px;
    background: #f0f4f8;
    border: 1px solid #e8ecf0;
    border-left: 4px solid #0f578a;
    border-radius: 10px;
    font-size: 0.92em;
    line-height: 1.9;
}
.hadith-meta-row {
    margin-bottom: 8px;
}
.hadith-meta-row:last-child {
    margin-bottom: 0;
}
.hadith-meta-label {
    display: inline-block;
    background: #0f578a;
    color: #fff;
    padding: 2px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85em;
    margin-right: 8px;
    vertical-align: middle;
}
.hadith-ref-text {
    color: #4a2882;
    font-weight: 700;
    font-size: 1.05em;
}
.hadith-grade-scholar {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    color: #8b0000;
    font-weight: 700;
    font-size: 1.1em;
}
.hadith-grade-text {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    color: #3b1f7a;
    font-weight: 600;
}
.hadith-takhrij-text {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    color: #333;
    font-size: 1.05em;
    line-height: 1.8;
    direction: rtl;
    display: inline;
}
.hadith-takhrij-text a {
    color: #0f578a;
    text-decoration: none;
}
.hadith-takhrij-text a:hover {
    text-decoration: underline;
}

/* --- Hadith number grid --- */
.hadith-numgrid-section {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 2px solid #0f578a;
}
.hadith-numgrid-title {
    font-size: 1.15em;
    color: #0f578a;
    margin: 0 0 18px;
    text-align: center;
    font-weight: 600;
}
.hadith-numgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
}
.hadith-numgrid-item {
    display: block;
    background: #fff;
    border: 1px solid #d4dce5;
    color: #0f578a;
    padding: 8px 4px;
    text-align: center;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85em;
    text-decoration: none;
    transition: all 0.2s;
}
.hadith-numgrid-item:hover {
    background: #0f578a;
    color: #fff;
    border-color: #0f578a;
    transform: scale(1.05);
}

/* --- Single hadith page --- */
.hadith-single {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
/* Hierarchy breadcrumb blocks */
.hadith-single-hierarchy {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
}
.hadith-single-hierarchy a {
    display: block;
    text-decoration: none;
    text-align: center;
    padding: 12px 16px;
    border: 1px solid #d0dde8;
    border-bottom: none;
    transition: background 0.15s;
}
.hadith-single-hierarchy a:first-child {
    border-radius: 10px 10px 0 0;
}
.hadith-single-hierarchy a:last-child {
    border-bottom: 1px solid #d0dde8;
    border-radius: 0 0 10px 10px;
}
.hadith-single-hierarchy a:only-child {
    border-radius: 10px;
    border-bottom: 1px solid #d0dde8;
}
.hadith-single-hierarchy a:hover {
    background: #e8f0f7;
}
.hadith-hier-book {
    background: #e8f0f7;
}
.hadith-hier-book .hadith-hier-arabic {
    color: #3b1f7a;
}
.hadith-hier-book .hadith-hier-english {
    color: #0f578a;
    font-weight: 600;
}
.hadith-hier-chapter {
    background: #f0f5fa;
}
.hadith-hier-sub {
    background: #f8fafb;
}
.hadith-hier-arabic {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.2em;
    color: #3b1f7a;
    line-height: 1.8;
    display: block;
    font-weight: 700;
}
.hadith-hier-english {
    font-size: 0.95em;
    color: #0f578a;
    font-weight: 600;
    display: block;
    margin: 2px 0 0;
}
.hadith-hier-chapter .hadith-hier-english,
.hadith-hier-sub .hadith-hier-english {
    font-weight: 500;
    font-size: 0.9em;
}
.hadith-hier-current {
    display: block;
    text-align: center;
    padding: 12px 16px;
    border: 1px solid #d0dde8;
    border-top: none;
    border-radius: 0 0 10px 10px;
}
.hadith-hier-meta {
    display: block;
    font-size: 0.82em;
    color: #777;
    margin-top: 2px;
}
.hadith-single-header h1 {
    font-size: 1.4em;
    color: #0f578a;
    margin: 0 0 6px;
}
.hadith-shamila-note {
    color: #888;
    font-size: 0.85em;
    font-style: italic;
    margin: 0 0 20px;
}
.hadith-arabic {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.4em;
    line-height: 2;
    color: #1a1a1a;
    background: #f0f5fa;
    padding: 20px 24px;
    border-radius: 8px;
    border: 1px solid #d0dde8;
    border-left: 4px solid #1a6faa;
    margin-bottom: 20px;
}
.hadith-english {
    font-size: 1.05em;
    line-height: 1.8;
    color: #333;
    padding: 16px 0 16px 20px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e8ecf0;
    border-left: 3px solid #0f578a;
}
.hadith-nav {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    margin-top: 8px;
}
.hadith-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 22px;
    background: #0f578a;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    transition: background 0.2s;
}
.hadith-nav a:hover {
    background: #0a3d60;
    color: #fff;
}

/* --- Pagination --- */
.hadith-pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}
.hadith-pagination-top {
    margin-bottom: 20px;
}
.hadith-page-link {
    padding: 6px 12px;
    border: 1px solid #d4dce5;
    border-radius: 4px;
    text-decoration: none;
    color: #0f578a;
    font-size: 0.9em;
    transition: background 0.15s;
}
.hadith-page-link:hover {
    background: #e8f0f7;
}
.hadith-page-current {
    padding: 6px 12px;
    background: #0f578a;
    color: #fff;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
}
.hadith-page-dots {
    padding: 6px 8px;
    color: #999;
}

/* --- Search results --- */
.hadith-search-summary {
    color: #3a5a7c;
    margin-bottom: 20px;
    font-size: 0.95em;
    padding: 10px 16px;
    background: #e8f0f7;
    border-radius: 8px;
    border-left: 4px solid #0f578a;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}
.hadith-search-summary strong {
    color: #0f578a;
}
.hadith-search-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto 24px;
}
.hadith-search-card {
    display: block;
    background: #fff;
    border: 1px solid #dce3eb;
    border-radius: 10px;
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
    border-left: 4px solid transparent;
}
.hadith-search-card:hover {
    border-left-color: #0f578a;
    box-shadow: 0 2px 12px rgba(15, 87, 138, 0.12);
}
.hadith-search-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.hadith-search-book {
    display: inline-block;
    background: #0f578a;
    color: #fff;
    font-size: 0.78em;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}
.hadith-search-num {
    color: #0f578a;
    font-weight: 600;
    font-size: 0.88em;
}
.hadith-search-text {
    color: #333;
    font-size: 0.93em;
    line-height: 1.65;
}
.hadith-search-text mark {
    background: #fff3cd;
    color: #333;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 500;
}
.hadith-search-chapter {
    display: inline-block;
    margin-top: 8px;
    font-size: 0.82em;
    color: #6a7f96;
}
@media (max-width: 600px) {
    .hadith-search-card {
        padding: 12px 14px;
    }
    .hadith-search-card-head {
        flex-wrap: wrap;
    }
}

/* --- 404 --- */
.hadith-404-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
.hadith-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #0f578a;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s;
}
.hadith-btn:hover {
    background: #0d4a73;
    color: #fff;
}
.hadith-btn-outline {
    background: transparent;
    color: #0f578a;
    border: 1px solid #0f578a;
}
.hadith-btn-outline:hover {
    background: #0f578a;
    color: #fff;
}

/* --- Rawi (Narrator) detail page --- */
.rawi-detail {
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
}
.rawi-header {
    text-align: center;
    margin-bottom: 24px;
}
.rawi-arabic-name {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.8em;
    color: #3b1f7a;
    line-height: 2;
    font-weight: 700;
}
.rawi-section-title {
    font-size: 1.15em;
    color: #0f578a;
    font-weight: 600;
    margin: 28px 0 14px;
    padding-bottom: 8px;
    border-bottom: 3px solid #0f578a;
}
.rawi-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}
.rawi-info-table td {
    padding: 10px 14px;
    border: 1px solid #e8ecf0;
    vertical-align: top;
}
.rawi-row-even td {
    background: #f8fafb;
}
.rawi-info-label {
    font-weight: 600;
    color: #0f578a;
    white-space: nowrap;
    width: 130px;
}
.rawi-info-label-ar {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    color: #3b1f7a;
    font-weight: 600;
    font-size: 1.1em;
    white-space: nowrap;
    width: 90px;
    text-align: right;
}
.rawi-info-value {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.1em;
    color: #1a1a1a;
    line-height: 1.8;
}
.rawi-evals {
    background: #fafbfc;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    padding: 18px 20px;
    line-height: 2.2;
}
.rawi-eval-item {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e0e4e8;
}
.rawi-eval-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.rawi-eval-scholar {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    color: #8b0000;
    font-weight: 700;
    font-size: 1.1em;
    margin-left: 8px;
}
.rawi-eval-text {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    color: #3b1f7a;
    font-weight: 600;
    font-size: 1.05em;
}
.rawi-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.rawi-book-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fff;
    border: 1px solid #d4dce5;
    border-bottom: 3px solid #d4dce5;
    border-radius: 10px;
    padding: 20px 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
}
.rawi-book-card:hover {
    transform: translateY(-4px);
    border-color: #0f578a;
    border-bottom-color: #0f578a;
    box-shadow: 0 10px 25px rgba(15, 87, 138, 0.12);
}
.rawi-book-name {
    font-size: 0.95em;
    color: #0f578a;
    font-weight: 600;
    margin-bottom: 6px;
}
.rawi-book-count {
    font-size: 0.85em;
    color: #777;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .hadith-app {
        padding: 12px;
    }
    .hadith-card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .hadith-card {
        padding: 28px 16px 20px;
    }
    .hadith-card-title {
        font-size: 1em;
    }
    .hadith-card-arabic {
        font-size: 1.05em;
    }
    .hadith-list-item {
        flex-direction: column;
        gap: 4px;
    }
    .hadith-list-num {
        min-width: auto;
    }
    .hadith-nav {
        flex-direction: column;
        gap: 8px;
    }
    .hadith-nav a {
        text-align: center;
    }
    .hadith-arabic {
        font-size: 1.2em;
        padding: 14px 16px;
    }
    .rawi-info-table td {
        padding: 8px 10px;
        font-size: 0.92em;
    }
    .rawi-info-label {
        width: auto;
    }
    .rawi-info-label-ar {
        display: none;
    }
    .rawi-books-grid {
        grid-template-columns: 1fr;
    }
    .rawi-arabic-name {
        font-size: 1.5em;
    }
}
