/* ========================================
   index.css - نسخة نظيفة ومتوافقة مع index.php
   ======================================== */

/* ---------- الهيرو ---------- */
.hero {
    padding: 60px 0 30px;
    background: linear-gradient(145deg, var(--primary-soft), var(--card-bg));
    border-bottom-left-radius: 60px;
    border-bottom-right-radius: 60px;
}
.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}
.hero-content h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 16px;
    line-height: 1.2;
}
.hero-content h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
}
.hero-description {
    font-size: 1.15rem;
    color: var(--text-soft);
    margin-bottom: 32px;
    font-weight: 500;
    line-height: 1.9;
}
.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-btn-alt {
    background: #fff;
    color: var(--primary-dark);
    border: 2px solid var(--primary-light);
    box-shadow: var(--shadow-sm);
}
.hero-btn-alt:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

/* ---------- التاريخ الهجري ---------- */
.hijri-date-wrap {
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: center;
}
.hijri-date-badge {
    background: var(--primary-soft);
    padding: 10px 20px;
    border-radius: 60px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--primary-light);
    box-shadow: var(--shadow-sm);
    color: var(--primary-dark);
    font-weight: 700;
}

/* ---------- بطاقة الرسالة (المنهج) ---------- */
.message-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px 35px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(1,87,155,0.12);
    margin: 0 0 20px;
    border-right: 8px solid var(--primary-dark);
    border-left: 8px solid var(--primary-dark);
}
.message-card h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.message-card h2 i {
    font-size: 2rem;
    color: var(--primary);
}
.message-text {
    font-size: 1.15rem;
    color: var(--text-main);
    line-height: 1.9;
}
.message-text .ayah {
    font-weight: 700;
    color: var(--primary-dark);
    background: var(--primary-soft);
    display: inline-block;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 1.3rem;
}
.message-text .ayah-number {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-right: 5px;
}
.signature {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px dashed var(--border-light);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
.signature i {
    color: var(--primary);
    font-size: 1.8rem;
}
.read-more-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    padding: 5px 0;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}
.read-more-btn:hover {
    color: var(--primary-dark);
}
.extra-content {
    display: none;
}
.extra-content.show {
    display: block;
}

/* ---------- بطاقة الأكاديمية ---------- */
.academy-card {
    background: linear-gradient(145deg, var(--card-bg), #f6fbfe);
    border-radius: var(--radius-lg);
    padding: 45px 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--primary-soft);
    margin: 30px 0 50px;
    text-align: center;
}
.academy-card h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.academy-card h2 i {
    font-size: 2.8rem;
    color: var(--primary);
}
.academy-quote {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin: 15px 0 20px;
    line-height: 1.4;
}
.academy-quote small {
    font-size: 1rem;
    color: var(--text-muted);
    display: block;
    margin-top: 5px;
}
.academy-description {
    font-size: 1.2rem;
    color: var(--text-soft);
    max-width: 800px;
    margin: 0 auto 35px;
    line-height: 1.8;
}
.academy-btn {
    margin-top: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 34px;
    font-size: 1.08rem;
    background: var(--primary-dark);
    color: white;
    border-radius: 60px;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 10px 25px rgba(1,87,155,0.3);
    transition: var(--transition);
    border: 2px solid transparent;
}
.academy-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(1,111,174,0.4);
}

/* ---------- الشريط المتحرك (marquee) ---------- */
.marquee-container {
    width: 100%;
    background: white;
    padding: 20px 0;
    border-top: 20px solid var(--primary-dark);
    border-bottom: 20px solid var(--primary-dark);
    overflow: hidden;
    margin: 0;
}
.marquee-content {
    display: flex;
    width: max-content;
    animation: scroll-smooth 110s linear infinite;
}
.marquee-part {
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding-left: 100px;
}
.marquee-part span {
    font-family: 'Amiri', 'Inter', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.marquee-part img {
    width: 100px;
    height: auto;
    filter: drop-shadow(0 0 10px #ffaa00);
}
@keyframes scroll-smooth {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}
.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

/* ---------- تخطيط المستحدثات ---------- */
.home-updates-intro {
    margin-bottom: 18px;
}
.home-updates-head {
    background: linear-gradient(145deg,#fff,#f8fbfe);
    border: 1px solid rgba(1,87,155,.1);
    border-radius: 26px;
    box-shadow: var(--shadow-sm);
    padding: 24px 26px;
}
.home-updates-layout {
    display: block;
    margin-bottom: 56px;
}
.home-updates-main--full {
    width: 100%;
}
.home-update-section {
    background: linear-gradient(145deg,#fff,#fbfdff);
    border: 1px solid rgba(1,87,155,.08);
    border-radius: 28px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.home-update-section + .home-update-section {
    margin-top: 24px;
}

/* ---------- بطاقات مخصصة (فتاوى، صوتيات، بحوث) ---------- */
.custom-fatwa-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 28px 24px;
    min-height: 240px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    text-decoration: none;
}
.custom-fatwa-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    background: linear-gradient(145deg, var(--card-bg), var(--primary-soft));
}
.custom-fatwa-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 18px;
    line-height: 1.5;
    width: 100%;
}
.custom-fatwa-excerpt {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-soft);
    width: 100%;
}
.custom-fatwa-track {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.custom-fatwa-track .custom-fatwa-card {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

/* ---------- سلايدر البطاقات العادية (كتب، فيديوهات) ---------- */
.single-card-slider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
    min-height: 380px;
}
.single-card-container {
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    background: var(--card-bg);
}
.single-card-track {
    display: flex;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.card-single {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
    box-sizing: border-box;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-main);
    border: 1px solid var(--border-light);
    transition: 0.3s;
}
.card-single:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.card-single img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: contain;
    border-radius: 15px;
    margin-bottom: 15px;
    background: #fff;
}
.card-single h3 {
    font-size: 1.2rem;
    text-align: center;
    color: var(--primary-dark);
    font-weight: 700;
    line-height: 1.7;
}

/* ---------- الاقتباسات ---------- */
.home-quotes-end {
    margin-top: 60px;
    margin-bottom: 40px;
    width: 100vw;
    max-width: 100vw;
    margin-inline: calc(50% - 50vw);
    padding-inline: clamp(14px, 3vw, 32px);
}
.home-quotes-head {
    margin-bottom: 18px;
}
.home-quotes-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 6px 2px 14px;
}
.home-quotes-row {
    display: flex;
    gap: 18px;
    width: max-content;
    min-width: 100%;
}
.home-quote-card {
    width: min(96vw, 980px);
    min-width: min(96vw, 980px);
    min-height: clamp(260px, 48vh, 520px);
    padding: clamp(22px, 4vw, 42px);
    border-radius: 30px;
    background: linear-gradient(145deg,#fff,#fbfdff);
    border: 1px solid rgba(1,87,155,.1);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.home-quote-text {
    margin: 0 0 12px;
    line-height: 2.05;
    color: var(--text-main);
    font-size: clamp(1.1rem, 2.8vw, 1.65rem);
}
.home-quote-source {
    color: var(--text-muted);
    font-weight: 700;
    font-size: clamp(.95rem, 2vw, 1.1rem);
}

/* ---------- أزرار ورؤوس مشتركة ---------- */
.slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}
.slider-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-dark);
    position: relative;
    display: inline-block;
}
.slider-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 70px;
    height: 4px;
    background: var(--primary-light);
    border-radius: 4px;
}
.slider-hint {
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.pause-btn-link {
    background: none;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-size: 0.9rem;
    padding: 5px 15px;
    border-radius: 30px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
    text-decoration: none;
}
.pause-btn-link:hover {
    background: var(--primary);
    color: white;
}

/* ---------- إخفاء أزرار التنقل ---------- */
.single-card-slider .slider-nav {
    display: none !important;
}

/* ---------- رسائل الخطأ والفراغ ---------- */
.error-message {
    padding: 30px;
    text-align: center;
    color: var(--text-muted);
    width: 100%;
}

/* ---------- تحسينات الجوال ---------- */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 2rem; }
    .hero-content h2 { font-size: 1.6rem; }
    .message-card { padding: 30px 20px; }
    .message-card h2 { font-size: 1.8rem; }
    .academy-card { padding: 30px 20px; }
    .academy-card h2 { font-size: 2rem; }
    .academy-quote { font-size: 1.3rem; }
    .marquee-part span { font-size: 1.2rem; }
    .marquee-part img { width: 35px; margin: 0 10px; }
    .home-updates-head,
    .home-update-section { border-radius: 22px; padding: 18px; }
    .home-updates-layout { margin-bottom: 40px; }
    .custom-fatwa-card { padding: 20px 18px; min-height: 200px; }
    .custom-fatwa-title { font-size: 1.2rem; margin-bottom: 12px; }
    .custom-fatwa-excerpt { font-size: 0.95rem; }
    .home-quote-card { border-radius: 24px; }
}
/* جعل قائمة المقالات قابلة للتمرير عموديًا */
.home-article-marquee .ui-list-items {
    max-height: 360px;      /* ارتفاع مناسب يعرض حوالي 5-6 مقالات */
    overflow-y: auto;        /* تمكين التمرير العمودي */
    padding-left: 6px;       /* مسافة بسيطة للشريط */
}

/* تنسيق شريط التمرير (اختياري) */
.home-article-marquee .ui-list-items::-webkit-scrollbar {
    width: 6px;
}
.home-article-marquee .ui-list-items::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}