/* ══════════════════════════════════════════════════════════════════════
   Dabaywa Sudan – Guardian-style CSS
   ══════════════════════════════════════════════════════════════════════ */

:root {
    /* Brand colors */
    --brand-primary: #c70000;
    --brand-dark: #121212;
    --brand-blue: #052962;
    --brand-highlight: #ffe500;

    /* Neutrals */
    --gray-100: #f6f6f6;
    --gray-200: #ededed;
    --gray-300: #dcdcdc;
    --gray-400: #999;
    --gray-500: #707070;
    --gray-600: #555;
    --gray-700: #333;
    --gray-800: #1a1a1a;

    /* Typography */
    --font-headline: 'Noto Sans', 'Noto Kufi Arabic', Georgia, serif;
    --font-body: 'Noto Sans', 'Noto Kufi Arabic', Arial, sans-serif;

    /* Spacing */
    --container-max: 1300px;
    --gap: 20px;
    --section-gap: 40px;
}

/* ── Reset & Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--brand-dark);
    background: #fff;
    line-height: 1.5;
}
body.rtl { direction: rtl; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--gap);
}

/* ── Breaking Bar ───────────────────────────────────────────────────── */
.breaking-bar {
    background: var(--brand-primary);
    color: #fff;
    padding: 8px 0;
    font-size: 0.875rem;
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
}
.breaking-bar .breaking-label {
    background: var(--brand-highlight);
    color: var(--brand-dark);
    padding: 2px 12px;
    margin: 0 12px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}
.breaking-bar a {
    color: #fff;
    animation: ticker 15s linear infinite;
}
@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Header ─────────────────────────────────────────────────────────── */
.header-top {
    background: var(--brand-blue);
    color: #fff;
    padding: 6px 0;
    font-size: 0.8rem;
}
.header-top-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.lang-btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
    padding: 4px 14px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s;
}
.lang-btn:hover { background: rgba(255,255,255,0.25); }

.header-main {
    background: var(--brand-blue);
    padding: 16px 0 12px;
    border-bottom: 4px solid var(--brand-highlight);
}
.header-main-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}
.site-logo {
    display: flex;
    align-items: center;
    color: #fff;
    line-height: 1.2;
}
.logo-img {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    padding-top: 4px;
}
.rtl .header-right {
    align-items: flex-start;
}

.header-search form {
    display: flex;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    overflow: hidden;
}
.header-search input {
    background: none;
    border: none;
    color: #fff;
    padding: 8px 16px;
    font-size: 0.9rem;
    width: 200px;
    outline: none;
}
.header-search input::placeholder { color: rgba(255,255,255,0.6); }
.header-search button {
    background: none;
    border: none;
    color: #fff;
    padding: 8px 12px;
    cursor: pointer;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    margin: 5px 0;
    transition: 0.3s;
}

/* ── Navigation ─────────────────────────────────────────────────────── */
.main-nav {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-list {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-list::-webkit-scrollbar { display: none; }
.nav-list li a {
    display: block;
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
}
.nav-list li a:hover,
.nav-list li a.active {
    color: var(--brand-primary);
}

/* ── Alerts ─────────────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    margin: 12px 0;
    border-radius: 4px;
    font-size: 0.9rem;
}
.alert-success { background: #e6f9e6; color: #1a7a1a; border-left: 4px solid #2a7a2a; }
.alert-danger { background: #fde8e8; color: #c70000; border-left: 4px solid #c70000; }
.alert-warning { background: #fff8e1; color: #7a6a00; border-left: 4px solid #ffc107; }
.alert-info { background: #e3f2fd; color: #0277bd; border-left: 4px solid #0288d1; }
.rtl .alert { border-left: none; border-right: 4px solid; }

/* ══════════════════════════════════════════════════════════════════════
   HOMEPAGE
   ══════════════════════════════════════════════════════════════════════ */

.hero-section {
    padding: var(--section-gap) 0 0;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: var(--gray-200);
}
.hero-main {
    background: #fff;
    padding: 0;
    position: relative;
}
.hero-main .hero-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
}
.hero-main .hero-content {
    padding: 20px;
}
.hero-main .hero-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.hero-main h2 {
    font-family: var(--font-headline);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
}
.hero-main h2 a:hover { text-decoration: underline; }
.hero-main .hero-subtitle {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.4;
}

.hero-side {
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    gap: 2px;
    background: var(--gray-200);
}
.hero-card {
    background: #fff;
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 0;
}
.rtl .hero-card { grid-template-columns: 1fr 140px; direction: rtl; }
.hero-card-content {
    padding: 16px;
}
.hero-card .card-category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.hero-card h3 {
    font-family: var(--font-headline);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}
.hero-card h3 a:hover { text-decoration: underline; }
.hero-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Section ────────────────────────────────────────────────────────── */
.section {
    padding: var(--section-gap) 0 0;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-top: 3px solid;
    padding-top: 8px;
}
.section-title {
    font-family: var(--font-headline);
    font-size: 1.25rem;
    font-weight: 700;
}
.section-more {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--brand-primary);
}
.section-more:hover { text-decoration: underline; }

/* ── Article Grid ───────────────────────────────────────────────────── */
.article-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    background: var(--gray-200);
}
.article-card {
    background: #fff;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.article-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.article-card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.article-card .card-category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}
.article-card h3 {
    font-family: var(--font-headline);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
}
.article-card h3 a:hover { text-decoration: underline; }
.article-card .card-meta {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: auto;
}
.article-card .media-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-top: 8px;
}

/* ── Most Read sidebar ──────────────────────────────────────────────── */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--gap);
}
.rtl .content-with-sidebar { grid-template-columns: 1fr 300px; }

.sidebar-widget {
    border-top: 3px solid var(--brand-primary);
    padding-top: 8px;
}
.sidebar-widget h3 {
    font-family: var(--font-headline);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
}
.most-read-list { counter-reset: most-read; }
.most-read-item {
    counter-increment: most-read;
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-200);
}
.most-read-item::before {
    content: counter(most-read);
    font-family: var(--font-headline);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand-primary);
    min-width: 24px;
}
.most-read-item h4 {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
}
.most-read-item h4 a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════════════
   ARTICLE DETAIL
   ══════════════════════════════════════════════════════════════════════ */
.article-header {
    padding: 30px 0 20px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 24px;
}
.article-header .article-cat {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}
.article-header h1 {
    font-family: var(--font-headline);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 12px;
}
.article-header .article-subtitle {
    font-size: 1.2rem;
    color: var(--gray-600);
    line-height: 1.4;
    margin-bottom: 16px;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--gray-500);
    flex-wrap: wrap;
}
.rtl .article-header { text-align: right; }
.rtl .article-meta { justify-content: flex-start; }
.article-meta .author-name { font-weight: 600; color: var(--brand-dark); }

.article-featured-img {
    margin-bottom: 24px;
}
.article-featured-img img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
}
.article-featured-img figcaption {
    font-size: 0.8rem;
    color: var(--gray-500);
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
}

/* Media section */
.article-media {
    margin-bottom: 24px;
}
.article-media .video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
    margin-bottom: 16px;
}
.article-media .video-wrapper iframe,
.article-media .video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.article-media audio {
    width: 100%;
    margin-bottom: 16px;
}

/* Rich text content */
.article-body {
    max-width: 740px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--gray-800);
}
.rtl .article-body {
    max-width: 100%;
    text-align: right;
    direction: rtl;
}
.article-body p { margin-bottom: 1.2em; }
.article-body h2 {
    font-family: var(--font-headline);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1.5em 0 0.7em;
}
.article-body h3 {
    font-family: var(--font-headline);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 1.3em 0 0.5em;
}
.article-body blockquote {
    border-left: 4px solid var(--brand-primary);
    padding-left: 20px;
    margin: 1.5em 0;
    font-style: italic;
    color: var(--gray-600);
}
.rtl .article-body blockquote { border-left: none; border-right: 4px solid var(--brand-primary); padding-left: 0; padding-right: 20px; }
.article-body img { margin: 1.5em 0; border-radius: 4px; }
.article-body a { color: var(--brand-primary); text-decoration: underline; }
.article-body ul, .article-body ol { padding-left: 1.5em; margin-bottom: 1.2em; }
.rtl .article-body ul, .rtl .article-body ol { padding-left: 0; padding-right: 1.5em; }
.article-body li { margin-bottom: 0.4em; }

/* Tags */
.article-tags { margin: 30px 0; }
.article-tags .tag {
    display: inline-block;
    background: var(--gray-100);
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 0.8rem;
    margin: 4px 4px 4px 0;
    color: var(--gray-600);
    transition: background 0.2s;
}
.article-tags .tag:hover { background: var(--gray-200); }

/* Related articles */
.related-section {
    padding: var(--section-gap) 0;
    border-top: 1px solid var(--gray-200);
    margin-top: var(--section-gap);
}

/* ══════════════════════════════════════════════════════════════════════
   CATEGORY / SEARCH / TAG PAGES
   ══════════════════════════════════════════════════════════════════════ */
.page-header {
    padding: 30px 0 20px;
    border-bottom: 3px solid var(--brand-primary);
    margin-bottom: var(--gap);
}
.page-header h1 {
    font-family: var(--font-headline);
    font-size: 2rem;
    font-weight: 700;
}
.page-header p {
    color: var(--gray-600);
    margin-top: 8px;
}
.rtl .page-header { text-align: right; }

.search-form-large {
    display: flex;
    max-width: 600px;
    margin: 20px 0;
}
.search-form-large input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
    outline: none;
}
.rtl .search-form-large input { border-radius: 0 4px 4px 0; }
.search-form-large input:focus { border-color: var(--brand-blue); }
.search-form-large button {
    background: var(--brand-blue);
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
}
.rtl .search-form-large button { border-radius: 4px 0 0 4px; }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: var(--section-gap) 0;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 0.9rem;
}
.pagination a:hover { background: var(--gray-100); }
.pagination .current {
    background: var(--brand-blue);
    color: #fff;
    border-color: var(--brand-blue);
}

/* ══════════════════════════════════════════════════════════════════════
   ABOUT & CONTACT PAGES
   ══════════════════════════════════════════════════════════════════════ */
.about-content, .contact-content {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--section-gap) var(--gap);
}
.about-content h1, .contact-content h1 {
    font-family: var(--font-headline);
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--brand-blue);
}
.about-content h2 {
    font-family: var(--font-headline);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 30px 0 12px;
    color: var(--brand-dark);
}
.about-content p, .contact-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1em;
    color: var(--gray-700);
}
.about-content ul {
    padding-left: 20px;
    margin-bottom: 1em;
}
.rtl .about-content ul { padding-left: 0; padding-right: 20px; }
.about-content li {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 0.5em;
    color: var(--gray-700);
    list-style: disc;
}

/* ══════════════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════════════ */
.site-footer {
    background: var(--brand-blue);
    color: #fff;
    padding: 48px 0 0;
    margin-top: var(--section-gap);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}
.footer-logo {
    margin-bottom: 8px;
}
.footer-logo-img {
    height: 300px;
    width: auto;
    object-fit: contain;
}
.footer-tagline {
    margin-top: 12px;
    opacity: 0.7;
    font-size: 0.9rem;
    line-height: 1.5;
}
.footer-links h4, .footer-contact h4 {
    font-weight: 700;
    margin-bottom: 16px;
    font-size: 0.95rem;
}
.footer-links ul li { margin-bottom: 8px; }
.footer-links a {
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.footer-links a:hover { opacity: 1; }
.footer-contact p {
    font-size: 0.9rem;
    opacity: 0.8;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.15);
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.6;
}

/* ══════════════════════════════════════════════════════════════════════
   ERROR PAGES
   ══════════════════════════════════════════════════════════════════════ */
.error-page {
    text-align: center;
    padding: 80px var(--gap);
}
.error-page h1 {
    font-family: var(--font-headline);
    font-size: 6rem;
    font-weight: 700;
    color: var(--brand-primary);
}
.error-page p {
    font-size: 1.2rem;
    color: var(--gray-600);
    margin: 16px 0 30px;
}
.error-page a {
    display: inline-block;
    background: var(--brand-blue);
    color: #fff;
    padding: 12px 28px;
    border-radius: 4px;
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; }
    .article-grid { grid-template-columns: repeat(2, 1fr); }
    .content-with-sidebar { grid-template-columns: 1fr; }
    .rtl .content-with-sidebar { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .rtl .article-body { max-width: 100%; }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .main-nav { display: none; }
    .main-nav.open { display: block; }
    .nav-list { flex-direction: column; }
    .nav-list li a { padding: 12px 20px; border-bottom: 1px solid var(--gray-200); }
    .hero-main h2 { font-size: 1.3rem; }
    .hero-main .hero-image { height: 250px; }
    .hero-card { grid-template-columns: 1fr 100px; }
    .rtl .hero-card { grid-template-columns: 1fr 100px; }
    .article-grid { grid-template-columns: 1fr; }
    .article-header h1 { font-size: 1.6rem; }
    .header-search { display: block; }
    .header-search input { width: 140px; }
    .header-right { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
    .rtl .header-right { flex-direction: row-reverse; }
    .logo-img { height: 50px !important; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .article-body { max-width: 100%; }
    .rtl .article-body { max-width: 100%; width: 100%; }
}

@media (max-width: 480px) {
    :root { --gap: 12px; }
    .hero-card { grid-template-columns: 1fr; }
    .rtl .hero-card { grid-template-columns: 1fr; }
    .hero-card-img { height: 160px; }
    .header-search input { width: 100px; }
}
