@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-muted: #f1f5f9;
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.1);
    --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.07);
    --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.12);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --article-font-size: 18px;
}

[data-theme="dark"] {
    --bg-body: #0b0f19;
    --bg-surface: #111827;
    --bg-muted: #1e293b;
    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #1f2937;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-soft: rgba(59, 130, 246, 0.15);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    padding: 0;
    background: var(--bg-body);
    color: var(--text-main);
    font-family: 'Cairo', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    transition: background-color 0.2s ease, color 0.2s ease;
}
body[dir="ltr"] {
    font-family: 'Plus Jakarta Sans', 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
}

a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
img { max-width: 100%; height: auto; display: block; }

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Reading Progress Bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #06b6d4);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Top Breaking Ticker */
.top-ticker {
    background: #0f172a;
    color: #f8fafc;
    font-size: 13px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.top-ticker-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}
.ticker-badge {
    background: #dc2626;
    color: #fff;
    font-weight: 800;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.ticker-links {
    display: flex;
    align-items: center;
    gap: 16px;
    overflow-x: auto;
    white-space: nowrap;
    flex: 1;
    scrollbar-width: none;
}
.ticker-links a { color: #cbd5e1; font-weight: 600; }
.ticker-links a:hover { color: #fff; }

/* Main Sticky Header */
.site-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    gap: 20px;
    flex-wrap: wrap;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 20px;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}
.logo-text h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.2;
    color: var(--text-main);
}
.logo-text span {
    display: block;
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 600;
}
.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.main-nav a {
    padding: 8px 14px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}
.main-nav a:hover, .main-nav a.active {
    background: var(--primary-soft);
    color: var(--primary);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.search-mini {
    display: flex;
    align-items: center;
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    padding: 4px 12px;
}
.search-mini input {
    border: 0;
    background: transparent;
    color: var(--text-main);
    font-family: inherit;
    font-size: 13px;
    padding: 4px 6px;
    width: 150px;
    outline: none;
}
.search-mini button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
}
.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-muted);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.theme-toggle-btn:hover { border-color: var(--primary); }

/* Hero Featured Grid */
.hero-section {
    margin: 28px 0 34px;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 20px;
}
.hero-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #0f172a;
    min-height: 430px;
    display: flex;
    align-items: flex-end;
    box-shadow: var(--shadow-md);
}
.hero-card.sub {
    min-height: 205px;
}
.hero-sub-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.hero-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.78;
    transition: transform 0.45s ease, opacity 0.3s ease;
}
.hero-card:hover img {
    transform: scale(1.04);
    opacity: 0.68;
}
.hero-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 28px;
    background: linear-gradient(to top, rgba(11,15,25,0.96) 0%, rgba(11,15,25,0.55) 65%, transparent 100%);
    color: #fff;
}
.hero-card.sub .hero-overlay { padding: 20px; }
.cat-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 800;
    color: #fff;
    background: var(--primary);
    margin-bottom: 10px;
}
.hero-card h2 {
    margin: 0 0 10px;
    font-size: 26px;
    line-height: 1.35;
    font-weight: 800;
    color: #fff;
}
.hero-card.sub h2 {
    font-size: 17.5px;
    margin-bottom: 6px;
}
.hero-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12.5px;
    color: #cbd5e1;
    flex-wrap: wrap;
}

/* Main Content Layout */
.main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 30px;
    align-items: start;
    margin-bottom: 50px;
}
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}
.section-head h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Article Grid Cards */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}
.post-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.post-card-thumb {
    position: relative;
    height: 210px;
    overflow: hidden;
    background: var(--bg-muted);
}
.post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.post-card:hover .post-card-thumb img {
    transform: scale(1.05);
}
.post-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.post-card-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.45;
    color: var(--text-main);
}
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
    flex: 1;
}
.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

/* Sidebar Widgets */
.widget {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.widget-title {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 800;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}
.trending-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.trending-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.trending-item:last-child { border-bottom: 0; padding-bottom: 0; }
.trending-num {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 900;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.trending-info h4 {
    margin: 0 0 4px;
    font-size: 14.5px;
    line-height: 1.45;
    font-weight: 700;
}
.trending-info h4 a:hover { color: var(--primary); }
.trending-info span { font-size: 11.5px; color: var(--text-muted); }

.cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.cat-list li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    background: var(--bg-muted);
}
.cat-list li a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

/* Single Article Page */
.article-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-sm);
}
.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.breadcrumb a:hover { color: var(--primary); }
.article-title {
    margin: 10px 0 18px;
    font-size: 32px;
    line-height: 1.35;
    font-weight: 900;
    color: var(--text-main);
}
.article-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    font-size: 13.5px;
    color: var(--text-muted);
}
.font-controls button {
    border: 1px solid var(--border-color);
    background: var(--bg-muted);
    color: var(--text-main);
    border-radius: 7px;
    padding: 4px 10px;
    font-weight: 700;
    cursor: pointer;
    font-size: 12px;
}
.article-featured-img {
    margin: 0 0 26px;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 480px;
}
.article-featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Table of Contents (TOC) */
.toc-box {
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin: 0 0 28px;
}
.toc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 800;
    font-size: 15.5px;
    cursor: pointer;
}
.toc-list {
    margin: 12px 0 0;
    padding-inline-start: 20px;
    font-size: 14.5px;
}
.toc-list li { margin-bottom: 7px; }
.toc-list li.toc-h3 { margin-inline-start: 18px; font-size: 13.5px; }
.toc-list a { color: var(--primary); font-weight: 600; }
.toc-list a:hover { text-decoration: underline; }

/* Article Body Typography */
.article-body {
    font-size: var(--article-font-size);
    line-height: 1.9;
    color: var(--text-main);
}
.article-body h2 {
    font-size: 1.45em;
    font-weight: 800;
    margin: 34px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}
.article-body h3 {
    font-size: 1.22em;
    font-weight: 800;
    margin: 26px 0 12px;
    color: var(--text-main);
}
.article-body p { margin: 0 0 20px; }
.article-body ul, .article-body ol { margin: 0 0 22px; padding-inline-start: 24px; }
.article-body li { margin-bottom: 10px; }
.article-body blockquote {
    margin: 24px 0;
    padding: 18px 22px;
    border-inline-start: 4px solid var(--primary);
    background: var(--bg-muted);
    border-radius: var(--radius-sm);
    font-style: italic;
}

/* Interactive Reaction / Like Bar */
.reactions-box {
    margin: 34px 0 26px;
    padding: 24px;
    border-radius: var(--radius-md);
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
    text-align: center;
}
.reactions-box h3 {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 800;
}
.reaction-buttons {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}
.react-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 99px;
    border: 2px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.react-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.react-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.react-count {
    background: rgba(0,0,0,0.08);
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 13px;
}
.react-btn.active .react-count {
    background: rgba(255,255,255,0.22);
}

/* Social Share Buttons */
.share-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 28px;
}
.share-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.share-btn {
    padding: 8px 15px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    border: 0;
}
.share-wa { background: #16a34a; }
.share-tw { background: #0f172a; }
.share-fb { background: #1877f2; }
.share-tg { background: #0284c7; }
.share-cp { background: #475569; }

/* Comments Section */
.comments-section {
    margin-top: 36px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}
.comment-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.comment-form input, .comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
}
.comment-form input:focus, .comment-form textarea:focus {
    border-color: var(--primary);
    outline: none;
}
.btn-submit-comment {
    background: var(--primary);
    color: #fff;
    border: 0;
    padding: 12px 26px;
    border-radius: 99px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 800;
    cursor: pointer;
}
.btn-submit-comment:hover { background: var(--primary-hover); }

.comments-list {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.comment-item {
    display: flex;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--bg-muted);
    border: 1px solid var(--border-color);
}
.comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-weight: 800;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.comment-content-wrap { flex: 1; }
.comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 8px;
}
.comment-author { font-weight: 800; font-size: 14.5px; }
.admin-badge {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    margin-inline-start: 6px;
}
.comment-date { font-size: 12px; color: var(--text-muted); }
.comment-text { margin: 0 0 10px; font-size: 14.5px; line-height: 1.65; color: var(--text-secondary); }
.comment-like-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border-radius: 99px;
    padding: 3px 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.comment-like-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Site Footer */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 50px 0 28px;
    margin-top: 60px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 30px;
    padding-bottom: 34px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-col h3 { color: #fff; margin: 0 0 14px; font-size: 17px; }
.footer-col p { color: #94a3b8; font-size: 14px; line-height: 1.7; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #cbd5e1; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
    padding-top: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: #94a3b8;
}

@media (max-width: 1024px) {
    .hero-grid, .main-layout { grid-template-columns: 1fr; }
    .hero-sub-col { flex-direction: row; }
    .hero-card.sub { flex: 1; }
}
@media (max-width: 720px) {
    .hero-sub-col { flex-direction: column; }
    .articles-grid, .comment-form-grid, .footer-grid { grid-template-columns: 1fr; }
    .article-container, .comments-section { padding: 20px; }
    .article-title { font-size: 24px; }
}
