/* =========================================================
   Saltos News - Full Front Layout
   تصميم كامل للواجهة الأمامية للموقع (الرئيسية + المقال)
   مبني خصيصاً على HTML الحالي في index.php / article.php
========================================================= */

/* ===== Reset / Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    direction: rtl;
    font-family: "Cairo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f4f6;
    color: #111827;
    line-height: 1.7;
    font-size: 15px;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ألوان عامة */
:root {
    --primary: #b91c1c;
    --primary-dark: #7f1d1d;
    --bg-card: #ffffff;
    --border: #e5e7eb;
    --text-main: #111827;
    --text-muted: #6b7280;
}

/* ===== Top Bar (تاريخ + وقت + سوشيال) ===== */
.top-bar {
    background: #0f172a;
    color: #e5e7eb;
    font-size: 12px;
}

.top-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 16px;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar-left span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.top-bar-left i {
    color: var(--primary);
}

.top-bar-right a {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: #f9fafb;
    font-size: 13px;
}

.top-bar-right a:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* ===== Header / Logo / روابط أعلى ===== */
.header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
}

.logo {
    flex-shrink: 0;
}

.logo h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
}

.logo-text {
    color: #b91c1c;
}

.logo-news {
    color: #111827;
}

.logo-tagline {
    font-size: 11px;
    color: var(--text-muted);
}

.header-top-links {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    margin-inline-start: auto; /* تدفع الروابط إلى الجهة اليسرى (الشمال) في الشاشات الكبيرة */
}

.header-top-links a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-weight: 600;
}

.header-top-links a:hover {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-toggle {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: none;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4b5563;
}

.search-toggle:hover {
    background: #e5e7eb;
    color: #111827;
}

.mobile-menu-toggle {
    display: none;
    border: none;
    background: transparent;
    cursor: pointer;
    flex-direction: column;
    gap: 3px;
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: #111827;
}

/* ===== Navigation (الأقسام الرئيسية) ===== */
.main-nav {
    background: var(--primary);
}

.main-nav .container {
    padding-block: 0;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-menu li {
    flex-shrink: 0;
}

.nav-menu a {
    display: block;
    padding: 9px 14px;
    color: #fee2e2;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--primary-dark);
    color: #ffffff;
}

/* عنصر زر الإغلاق داخل قائمة الـ UL */
.nav-close-item {
    display: none;
}

/* زر إغلاق القائمة (X) - يظهر فقط على الموبايل */
.nav-close {
    display: none;
    border: none;
    background: transparent;
    cursor: pointer;
}

.mobile-tabs {
    display: none;
}

/* ===== Search Bar ===== */
.search-bar {
    display: none;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    padding: 10px 0 14px;
}

.search-bar.active {
    display: block;
}

.search-form {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    background: #ffffff;
    border-radius: 999px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.search-input {
    flex: 1;
    border: none;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
}

.search-btn {
    border: none;
    background: var(--primary);
    color: #ffffff;
    padding: 0 18px;
    cursor: pointer;
}

/* ===== Breaking News ===== */
.breaking-news {
    margin-top: 10px;
}

.breaking-news .container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 8px 14px;
}

.breaking-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 700;
}

.breaking-content {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.breaking-content a {
    display: inline-block;
    font-size: 13px;
    color: var(--text-main);
    animation: breaking-scroll 25s linear infinite;
    padding-inline-end: 40px;
}

@keyframes breaking-scroll {
    0%   { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* ===== Slider (يعتمد على sliderWrapper في main.js) ===== */
.main-slider {
    padding: 16px 0 0;
}

.slider-container {
    position: relative;
    border-radius: 0;          /* حواف مربعة بدون تدوير */
    overflow: hidden;
    background: #000;
    height: 320px;
}

.slider-wrapper {
    height: 100%;
    position: relative;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.active {
    opacity: 1;
}

.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;       /* عرض الصورة كاملة داخل الإطار */
}

.slide-content {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 16px 16px 18px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.1));
    color: #f9fafb;
}

.slide-category {
    display: inline-block;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0,0,0,0.4);
    margin-bottom: 4px;
}

.slide-content h2 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}

.slide-content p {
    font-size: 13px;
    color: #e5e7eb;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(15,23,42,0.8);
    color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.slider-btn.prev { right: 10px; }
.slider-btn.next { left: 10px; }

.slider-dots {
    position: absolute;
    bottom: 10px;
    inset-inline: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(249,250,251,0.4);
}

.dot.active {
    width: 16px;
    background: #ffffff;
}

/* ===== Main Layout ===== */
.main-content {
    padding: 24px 0 32px;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 3fr 1.6fr;
    gap: 18px;
}

.main-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.featured-section,
.latest-news-section,
.category-section {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 14px 14px 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.section-title {
    font-size: 17px;
    font-weight: 800;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.article-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.article-image {
    height: 170px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    padding: 10px 12px 12px;
}

.article-content h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.article-content p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Sidebar Widgets ===== */
.sidebar-widget,
.latest-updates-widget {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 12px 12px 14px;
}

.widget-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 10px;
}

.latest-updates-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 420px;
    overflow-y: auto;
}

.latest-update-item {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #f9fafb;
}

.update-time {
    font-size: 11px;
    color: var(--text-muted);
}

.update-content h4 {
    font-size: 13px;
}

.popular-articles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popular-item {
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #f9fafb;
}

.popular-number {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    font-size: 12px;
}

/* ===== Footer ===== */
.footer {
    background: #111827;
    color: #e5e7eb;
    padding: 26px 0 18px;
    margin-top: 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.footer-logo {
    font-size: 20px;
    font-weight: 900;
}

.footer-logo-icon {
    color: var(--primary);
    font-size: 18px;
    margin-inline-start: 6px;
}

.footer-section h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-title-icon {
    color: var(--primary);
    font-size: 14px;
}

.footer-section p {
    font-size: 13px;
    color: #d1d5db;
}

.footer-section ul {
    list-style: none;
}

.footer-section li + li {
    margin-top: 6px;
}

.footer-section a {
    font-size: 13px;
    color: #e5e7eb;
}

.footer-section a .footer-link-icon {
    margin-inline-start: 4px;
    font-size: 12px;
    opacity: 0.85;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.social-links a {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-bottom {
    margin-top: 16px;
    border-top: 1px solid #1f2937;
    padding-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
}

/* نموذج النشرة الإخبارية في الفوتر */
.newsletter-form {
    display: flex;
    align-items: stretch;
    gap: 0; /* شبك الحقل مع زر الاشتراك بدون فراغ */
    margin-top: 8px;
    background: #020617;           /* صندوق واحد داكن */
    border: 1px solid #1f2937;
    border-radius: 0;              /* شكل مربع بدون حواف مستديرة */
    overflow: hidden;              /* لإخفاء أي زوايا داخلية */
}

.newsletter-input-wrapper {
    position: relative;
    flex: 1;
}

.newsletter-input-wrapper input[type="email"] {
    width: 100%;
    padding: 8px 12px;
    padding-inline-start: 32px; /* مساحة لأيقونة الظرف */
    border-radius: 0;
    border: none;
    font-family: inherit;
    font-size: 13px;
    background: transparent;
    color: #e5e7eb;
}

.newsletter-input-wrapper input[type="email"]:focus {
    outline: none;
    box-shadow: none;
}

.newsletter-input-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    inset-inline-start: 10px;
    color: #9ca3af;
    font-size: 13px;
}

.newsletter-form button {
    border: none;
    border-radius: 0; /* نفس شكل الصندوق المربع */
    background: var(--primary);
    color: #ffffff;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.newsletter-form button i {
    font-size: 13px;
}

.newsletter-form button:hover {
    background: var(--primary-dark);
}

/* ===== صفحة أرسل خبراً / النماذج ===== */
.send-news-form {
    max-width: 720px;
    margin: 0 auto;
    margin-top: 8px;
    background: #f9fafb;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 18px 18px 20px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.send-news-note {
    margin-bottom: 18px;
    font-size: 14px;
    color: var(--text-muted);
    background: #eff6ff;
    border: 1px dashed #bfdbfe;
    padding: 10px 12px;
    border-radius: 10px;
}

.send-news-note i {
    margin-inline-start: 4px;
    color: #2563eb;
}

.send-news-form .form-group {
    margin-bottom: 14px;
}

.send-news-form .form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.send-news-form .form-group input,
.send-news-form .form-group textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 14px;
    background: #ffffff;
}

.send-news-form .form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.send-news-form .form-group input:focus,
.send-news-form .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.25);
}

.btn-primary {
    border: none;
    border-radius: 999px;
    background: var(--primary);
    color: #ffffff;
    padding: 0.9rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.send-news-submit {
    width: 100%;
    margin-top: 6px;
    font-size: 1rem;
    padding: 1rem 1.4rem;
}

/* ===== صفحة اتصل بنا ===== */
.contact-info {
    max-width: 720px;
    margin: 8px auto 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f9fafb;
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 10px 12px;
}

.contact-icon {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111827;
    color: #f9fafb;
    flex-shrink: 0;
}

.contact-icon .fa-whatsapp {
    color: #22c55e;
}

.contact-details h3 {
    font-size: 15px;
    margin-bottom: 4px;
}

.contact-details p,
.contact-details a {
    font-size: 13px;
    color: var(--text-muted);
}

.contact-details a:hover {
    color: var(--primary);
}

.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.whatsapp-link i {
    color: #22c55e;
}

/* ===== Article Page (article.php) مختصرة ===== */
.article-page {
    padding: 24px 0 32px;
}

.article-wrapper {
    display: grid;
    grid-template-columns: 3fr 1.6fr;
    gap: 18px;
}

.article-single {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 16px 16px 18px;
}

.article-single h1 {
    font-size: 22px;
    margin-bottom: 8px;
}

.article-body {
    font-size: 15px;
    color: var(--text-main);
}

.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.related-articles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-article-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 10px;
    background: #f9fafb;
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
    .content-wrapper,
    .article-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .header-top-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
        position: absolute;
        left: -8px;               /* أقرب لحافة الشاشة اليسرى كما كان في التصميم الأصلي */
        top: 49%;
        transform: translateY(-50%);
    }

    .header-content {
        position: relative;      /* حتى يتموضع زر القائمة بالنسبة للهيدر */
        justify-content: flex-start; /* يبقى الشعار في جهة اليمين، وزر القائمة في أقصى الشمال */
    }

    .slider-container {
        height: 260px;
    }

    .articles-grid,
    .category-articles {
        grid-template-columns: 1fr;
    }

    .top-bar .container {
        flex-direction: column;
        align-items: flex-start;
    }

    /* إظهار تبويبات سريعة أسفل الشعار على الموبايل */
    .mobile-tabs {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
        gap: 4px;
        background: #ffffff;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    .mobile-tabs::-webkit-scrollbar {
        display: none;
    }

    .mobile-tab {
        flex-shrink: 0;
        padding: 8px 10px;
        font-size: 13px;
        color: var(--text-muted);
        white-space: nowrap;
    }

    .mobile-tab.active {
        color: #ffffff;
        background: var(--primary);
    }

    /* القائمة المنبثقة بلون كحلي مع Overlay */
    .main-nav {
        position: fixed;
        inset: 0;
        background: transparent;
        z-index: 40;
        pointer-events: none; /* يتم تفعيلها فقط عند الفتح */
    }

    .main-nav.menu-open {
        pointer-events: auto;
    }

    .main-nav::before {
        content: "";
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, 0.7); /* خلفية داكنة شفافة */
        opacity: 0;
        transition: opacity 0.25s ease;
    }

    .main-nav.menu-open::before {
        opacity: 1;
    }

    .nav-menu {
        position: absolute;
        top: 0;
        right: 0;
        width: 78%;
        max-width: 340px;
        height: 100%;
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 14px 20px;
        background: #0b1f3a; /* كحلي */
        box-shadow: -4px 0 18px rgba(15, 23, 42, 0.6);
        transform: translateX(100%);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
        overflow-y: auto;
        gap: 4px;
    }

    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-close-item {
        display: block;
    }

    .nav-menu a {
        width: 100%;
        padding: 10px 8px;
        border-radius: 10px;
        font-size: 15px;
        color: #e5e7eb;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }

    /* زر الإغلاق داخل القائمة */
    .nav-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 999px;
        margin-bottom: 8px;
        margin-inline-start: 4px;
        background: rgba(15, 23, 42, 0.3);
        color: #e5e7eb;
        font-size: 18px;
    }

    .nav-close:hover {
        background: rgba(15, 23, 42, 0.55);
    }
}

