/*
Theme Name: Yemen Alghad Pro 2026
Description: Enterprise Magazine Theme V20 (Optimized for SEO & Core Web Vitals 2026)
Version: 20.0
Author: Yemen Alghad Team
*/

:root {
    --yag-primary: #0f172a;
    --yag-secondary: #0284c7;
    --yag-accent: #d97706;
    --yag-dark: #0f172a;  
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -4px rgba(0,0,0,0.05);
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-size-multiplier: 1;
}

body.dark-mode {
    --yag-primary: #38bdf8;
    --yag-secondary: #0ea5e9;
    --yag-accent: #fbbf24;
    --yag-dark: #030712;
    --bg-body: #0b0f19;
    --bg-card: #111827;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border: #1f2937;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.2), 0 2px 4px -2px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -4px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; scroll-behavior: smooth; }
body { font-family: 'Tajawal', sans-serif; background-color: var(--bg-body); color: var(--text-main); direction: rtl; line-height: 1.8; transition: var(--transition-smooth); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { text-decoration: none; color: inherit; transition: var(--transition-smooth); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--yag-secondary); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; border-radius: 12px; content-visibility: auto; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Top Bar */
.top-bar { background: var(--yag-primary); color: #ffffff; padding: 10px 0; font-size: 0.85rem; box-shadow: var(--shadow-sm); }
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.top-bar-date { font-weight: 500; opacity: 0.9; display: flex; align-items: center; gap: 6px; }
.ticker-wrap { flex: 1; overflow: hidden; display: flex; align-items: center; background: rgba(255, 255, 255, 0.08); border-radius: 99px; padding: 3px 6px; border: 1px solid rgba(255, 255, 255, 0.1); }
.ticker-label { background: var(--yag-accent); color: #000000; padding: 4px 16px; border-radius: 99px; font-weight: 800; z-index: 2; font-size: 0.8rem; box-shadow: var(--shadow-sm); white-space: nowrap; }
.ticker-move { display: inline-block; white-space: nowrap; will-change: transform; animation: ticker 35s linear infinite; margin-right: 15px; }
.ticker-move a { color: #ffffff; margin-left: 25px; font-weight: 500; font-size: 0.85rem; }
.ticker-move a:hover { color: var(--yag-accent); }
@keyframes ticker { 0% { transform: translate3d(100%, 0, 0); } 100% { transform: translate3d(-100%, 0, 0); } }

/* Header */
.site-header { background: var(--bg-card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; box-shadow: var(--shadow-md); backdrop-filter: blur(12px); transition: var(--transition-smooth); }
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 90px; }
.logo { display: flex; align-items: center; font-weight: 900; font-size: 1.5rem; color: var(--yag-primary); gap: 10px; }
body.dark-mode .logo { color: var(--yag-primary); }
.logo-accent { color: var(--yag-accent); }
.main-nav ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.main-nav a { font-weight: 700; font-size: 1.05rem; color: var(--text-main); position: relative; padding: 8px 0; }
.main-nav a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 3px; background: var(--yag-accent); border-radius: 99px; transition: var(--transition-smooth); }
.main-nav a:hover { color: var(--yag-accent); }
.main-nav a:hover::after { width: 100%; }
.header-tools { display: flex; gap: 12px; align-items: center; }
.tool-btn { background: var(--bg-body); border: 1px solid var(--border); width: 44px; height: 44px; border-radius: 12px; color: var(--text-main); display: flex; justify-content: center; align-items: center; cursor: pointer; transition: var(--transition-smooth); }
.tool-btn:hover { background: var(--yag-primary); color: #ffffff; border-color: var(--yag-primary); transform: translateY(-2px); }
.tool-btn svg { width: 20px; height: 20px; }

/* Layout */
.page-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; margin: 40px auto; }
.main-column { min-width: 0; }
.sidebar-column { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 32px; }

/* Article */
.article-box { background: var(--bg-card); padding: 40px; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.breadcrumbs { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap:wrap; }
.breadcrumbs a:hover { color: var(--yag-accent); }
.a-category { background: var(--yag-accent); color: #000000; padding: 6px 14px; border-radius: 6px; font-size: 0.8rem; font-weight: 800; display: inline-block; margin-bottom: 20px; letter-spacing: 0.5px; }
.a-title { font-size: calc(2.2rem * var(--font-size-multiplier)); font-weight: 900; line-height: 1.35; color: var(--text-main); margin: 0 0 24px; letter-spacing: -0.5px; transition: font-size 0.2s ease; }
.a-meta { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; padding: 20px 0; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); margin-bottom: 30px; font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }
.a-author { display: flex; align-items: center; gap: 12px; color: var(--text-main); }
.a-author img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--yag-accent); object-fit: cover; }
.meta-item { display: flex; align-items: center; gap: 6px; }
.meta-item svg { width: 16px; height: 16px; }

/* Tools */
.a-tools { display: flex; justify-content: space-between; align-items: center; background: var(--bg-body); padding: 14px 20px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 30px; flex-wrap: wrap; gap: 15px;}
.a-tools-title { font-size: 0.9rem; font-weight: 700; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.a-tools-title svg { width: 18px; height: 18px; }
.a-tools-btns { display: flex; gap: 10px; }
.a-tools-btns button { background: var(--bg-card); border: 1px solid var(--border); padding: 8px 16px; font-weight: 700; border-radius: 8px; cursor: pointer; color: var(--text-main); font-size: 0.85rem; display: flex; align-items: center; gap: 6px; transition: var(--transition-smooth); }
.a-tools-btns button svg { width: 16px; height: 16px; }
.a-tools-btns button:hover { border-color: var(--yag-accent); color: var(--yag-accent); transform: translateY(-1px); }

/* Content */
.a-thumb { margin-bottom: 35px; position: relative; overflow: hidden; border-radius: 14px; }
.a-thumb img { width: 100%; object-fit: cover; aspect-ratio: 16/9; transition: transform 0.5s ease; }
.a-thumb:hover img { transform: scale(1.02); }
.a-content { font-size: calc(1.25rem * var(--font-size-multiplier)); line-height: 2.1; color: var(--text-main); transition: font-size 0.2s ease; overflow-wrap: break-word; }
.a-content p { margin-bottom: 28px; text-align: justify; }
.a-content h2, .a-content h3 { color: var(--yag-primary); font-weight: 800; font-size: calc(1.75rem * var(--font-size-multiplier)); margin: 45px 0 20px; line-height: 1.4; border-right: 5px solid var(--yag-accent); padding-right: 14px; }
body.dark-mode .a-content h2, body.dark-mode .a-content h3 { color: var(--yag-primary); }
.a-content img, .a-content iframe { border-radius:12px; margin:25px auto; display:block; max-width:100% !important; height:auto !important;}

/* AI Box */
.ai-inline-box { display: flex; background: var(--bg-body); border: 1px solid var(--border); border-right: 5px solid var(--yag-secondary); padding: 20px; margin: 40px 0; border-radius: 12px; align-items: center; gap: 20px; transition: var(--transition-smooth); }
.ai-inline-box:hover { background: var(--bg-card); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.ai-img { width: 140px; height: 95px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.ai-img img { width: 100%; height: 100%; object-fit: cover; }
.ai-content-side { display: flex; flex-direction: column; gap: 6px; }
.ai-label { font-size: 0.75rem; font-weight: 800; color: #ffffff; background: var(--yag-secondary); padding: 4px 12px; border-radius: 99px; display: inline-block; align-self: flex-start; }
.ai-title { font-size: 1.05rem; font-weight: 800; color: var(--text-main); margin: 0; line-height: 1.5; }

/* GNews & Share */
.gnews-box { display: flex; justify-content: space-between; align-items: center; border: 1px solid rgba(66, 133, 244, 0.2); background: rgba(66, 133, 244, 0.05); padding: 24px; border-radius: 12px; margin: 40px 0; gap: 20px; flex-wrap:wrap;}
.gnews-info { display: flex; align-items: center; gap: 12px; }
.gnews-info svg { color: #4285f4; width: 32px; height: 32px; }
.gnews-text h4 { font-size: 1.1rem; font-weight: 800; margin-bottom: 4px; }
.gnews-text p { font-size: 0.85rem; color: var(--text-muted); margin:0;}
.gnews-box a { background: #4285f4; color: #ffffff; padding: 10px 24px; border-radius: 8px; font-weight: 700; transition: var(--transition-smooth); font-size: 0.9rem; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 4px 12px rgba(66, 133, 244, 0.2); }
.gnews-box a:hover { background: #357ae8; transform: translateY(-2px); }

.share-box { background: var(--yag-primary); color: #ffffff; padding: 24px; border-radius: 14px 14px 0 0; display: flex; justify-content: space-between; align-items: center; margin-top: 50px; gap: 15px; flex-wrap:wrap;}
.share-box-title { font-weight: 800; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.share-box-title svg { width: 20px; height: 20px; }
.share-links { display: flex; gap: 10px; flex-wrap: wrap; }
.share-links a { background: rgba(255, 255, 255, 0.12); color: #ffffff; padding: 8px 18px; border-radius: 8px; font-size: 0.85rem; font-weight: 700; display: flex; align-items: center; gap: 6px; transition: var(--transition-smooth); }
.share-links a svg { width: 16px; height: 16px; }
.share-links a:hover { background: var(--yag-accent); color: #000000; transform: translateY(-2px); }

/* Author */
.author-box { background: var(--bg-card); border: 1px solid var(--border); border-top: none; padding: 30px; border-radius: 0 0 14px 14px; display: flex; align-items: flex-start; gap: 20px; margin-bottom: 50px; box-shadow: var(--shadow-sm); }
.author-box img { width: 80px; height: 80px; border-radius: 50%; border: 3px solid var(--border); object-fit: cover; }
.author-info-side { display: flex; flex-direction: column; gap: 6px; }
.author-name { font-size: 1.15rem; font-weight: 800; color: var(--text-main); }
.author-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; margin:0;}

/* Sidebar */
.widget { background: var(--bg-card); padding: 28px; border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: var(--transition-smooth); }
.widget:hover { box-shadow: var(--shadow-md); }
.widget-title { font-size: 1.15rem; font-weight: 900; color: var(--text-main); border-bottom: 3px solid var(--yag-accent); padding-bottom: 10px; margin-top: 0; margin-bottom: 24px; display: inline-block; }
.popular-list { list-style: none; display: flex; flex-direction: column; gap: 16px; padding:0; margin:0;}
.popular-item { display: flex; gap: 12px; align-items: center; }
.popular-num { font-size: 1.8rem; font-weight: 900; color: var(--border); width: 40px; text-align: center; transition: var(--transition-smooth); }
.popular-item:hover .popular-num { color: var(--yag-accent); transform: scale(1.1); }
.popular-title { font-size: 0.95rem; font-weight: 700; line-height: 1.5; color: var(--text-main); }
.popular-title:hover { color: var(--yag-secondary); }

/* Toast */
.custom-alert { position: fixed; bottom: 24px; left: 24px; background: #10b981; color: #ffffff; padding: 16px 24px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; font-weight: 700; z-index: 2000; transform: translateY(150%); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.custom-alert.show { transform: translateY(0); }
.custom-alert svg { width: 24px; height: 24px; }

/* Footer */
footer { background: var(--yag-primary); color: #ffffff; padding: 40px 0; text-align: center; font-size: 0.95rem; margin-top: 60px; border-top: 4px solid var(--yag-accent); }
footer p { opacity: 0.8; margin-top: 8px; }

/* Responsive */
@media (max-width: 1024px) {
    .page-layout { grid-template-columns: 1fr; gap: 24px; }
    .sidebar-column { width: 100%; position: static; }
    .a-title { font-size: 1.95rem; }
}
@media (max-width: 768px) {
    .top-bar-date, .main-nav, .gnews-box { display: none; }
    .header-inner { height: 75px; }
    .logo { font-size: 1.25rem; }
    .article-box { padding: 24px; border-radius: 12px; }
    .a-title { font-size: 1.65rem; }
    .a-content { font-size: 1.1rem; }
    .ai-inline-box { flex-direction: column; align-items: flex-start; gap: 12px; }
    .ai-img { width: 100%; height: 150px; }
    .share-box { flex-direction: column; align-items: flex-start; gap: 16px; }
}