/* =====================================================
   Egypt Tourism Today — style.css
   تصميم جريدة كلاسيكي: أزرق غامق + ذهبي + عناوين serif
   يدعم RTL و LTR بنفس الملف (خصائص منطقية) — Mobile first
   ===================================================== */

/* ---------- 1) المتغيرات ---------- */
:root {
  --navy: #0b1f3a;
  --navy-2: #13315c;
  --gold: #b8913a;
  --gold-2: #d4af37;
  --red: #b3261e;
  --ink: #1b1b1f;
  --muted: #5d6470;
  --line: #e2dfd6;
  --paper: #ffffff;
  --soft: #faf8f3;
  --radius: 4px;
  --shadow: 0 2px 10px rgba(11, 31, 58, .08);
  --font-body: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, Arial, sans-serif;
  --font-head: 'Playfair Display', 'Amiri', Georgia, 'Times New Roman', serif;
}

/* ---------- 2) إعادة ضبط ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { color: var(--gold); }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy); line-height: 1.35; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; }
.icon { flex-shrink: 0; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.skip-link {
  position: absolute; inset-inline-start: 8px; top: -60px; z-index: 200;
  background: var(--gold-2); color: var(--navy); padding: 8px 14px; font-weight: 700;
}
.skip-link:focus { top: 8px; }

/* ---------- 3) الشريط العلوي ---------- */
.topbar { background: var(--navy); color: #d7dde8; font-size: 13px; }
.topbar a { color: #d7dde8; }
.topbar a:hover { color: var(--gold-2); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; }
.topbar-start, .topbar-end { display: flex; align-items: center; gap: 14px; }
.topbar-links { display: none; gap: 14px; }
.topbar-date { white-space: nowrap; }
.social-link { display: inline-flex; padding: 4px; border-radius: 50%; }
.social-link .icon { width: 18px; height: 18px; }
.lang-switch {
  border: 1px solid rgba(212, 175, 55, .6); color: var(--gold-2) !important;
  padding: 1px 12px; border-radius: 20px; font-weight: 600; white-space: nowrap;
}
.lang-switch:hover { background: var(--gold-2); color: var(--navy) !important; }

/* ---------- 4) رأس الجريدة ---------- */
.masthead { text-align: center; padding: 22px 0 14px; background: var(--paper); }
.masthead .container { border-bottom: 4px double var(--navy); padding-bottom: 14px; }
.masthead-brand { display: inline-block; }
.masthead-title {
  display: block; font-family: var(--font-head); font-weight: 900; color: var(--navy);
  font-size: clamp(30px, 7vw, 64px); letter-spacing: .5px; line-height: 1.1;
}
.masthead-logo { max-height: 80px; width: auto; margin-inline: auto; }
.masthead-tagline {
  margin: 8px 0 0; color: var(--gold); font-weight: 600; font-size: clamp(13px, 2.4vw, 16px);
  letter-spacing: .5px;
}

/* ---------- 5) قائمة التنقل (ثابتة) ---------- */
.site-nav { position: sticky; top: 0; z-index: 100; background: var(--navy); border-bottom: 3px solid var(--gold-2); }
.site-nav.is-stuck { box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.nav-toggle, .search-toggle {
  background: transparent; border: 0; color: #fff; cursor: pointer; padding: 10px; border-radius: var(--radius);
  display: inline-flex; align-items: center;
}
.nav-toggle:hover, .search-toggle:hover { color: var(--gold-2); }
.nav-list {
  display: none; position: absolute; inset-inline: 0; top: 100%; background: var(--navy);
  flex-direction: column; border-top: 1px solid rgba(255, 255, 255, .12); padding: 6px 16px 12px;
}
.site-nav.open .nav-list { display: flex; }
.nav-list a {
  display: block; padding: 11px 4px; color: #fff; font-weight: 600; font-size: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nav-list a:hover, .nav-list a.active { color: var(--gold-2); }
.search-panel { background: var(--navy-2); padding: 12px 0; }
.search-form { display: flex; gap: 8px; }
.search-form input {
  flex: 1; min-width: 0; padding: 10px 14px; border: 0; border-radius: var(--radius); background: #fff; color: var(--ink);
}
.search-form button {
  padding: 10px 20px; border: 0; border-radius: var(--radius); cursor: pointer;
  background: var(--gold-2); color: var(--navy); font-weight: 700;
}
.search-form button:hover { background: #fff; }

/* ---------- 6) شريط العاجل ---------- */
.ticker { background: var(--soft); border-bottom: 1px solid var(--line); }
.ticker-inner { display: flex; align-items: center; gap: 12px; min-height: 42px; overflow: hidden; }
.ticker-label {
  flex-shrink: 0; background: var(--red); color: #fff; font-weight: 700; font-size: 13px;
  padding: 2px 12px; border-radius: var(--radius); text-transform: uppercase;
}
.ticker-items { position: relative; flex: 1; height: 26px; min-width: 0; }
.ticker-item {
  position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .5s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 600; font-size: 15px;
}
.ticker-item.is-active { opacity: 1; visibility: visible; }
.ticker-item:hover { color: var(--red); }

/* ---------- 7) الإعلانات ---------- */
.ad-slot { margin: 16px auto; text-align: center; position: relative; max-width: 100%; }
.ad-slot img { margin-inline: auto; border-radius: var(--radius); }
.ad-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; letter-spacing: 1px; }
.ad-empty {
  border: 2px dashed var(--line); color: var(--muted); padding: 22px; font-size: 13px; background: var(--soft);
}
.ad-top, .ad-footer { max-width: 970px; }
.ad-sidebar { max-width: 300px; }

/* ---------- 8) عناوين الأقسام ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-top: 3px solid var(--navy); margin: 28px 0 16px; padding-top: 8px;
}
.section-head h2 {
  margin: 0; font-size: 22px; position: relative; padding-bottom: 6px;
}
.section-head h2::after {
  content: ''; position: absolute; inset-inline-start: 0; bottom: -2px; width: 56px; height: 3px; background: var(--gold-2);
}
.section-head a { font-size: 14px; font-weight: 600; color: var(--gold); }

/* ---------- 9) البطاقات ---------- */
.card { display: flex; flex-direction: column; background: var(--paper); }
.card-media { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--soft); aspect-ratio: 16 / 10; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding-top: 10px; }
.card-cat {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: .5px; margin-bottom: 4px;
}
.card-title { font-size: 19px; margin: 0 0 6px; }
.card-title a { color: var(--navy); }
.card-title a:hover { color: var(--gold); }
.card-excerpt { color: var(--muted); font-size: 15px; margin: 0 0 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; align-items: center; }
.meta .icon { width: 14px; height: 14px; margin-inline-end: 4px; display: inline-block; vertical-align: -2px; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 3px; line-height: 1.6;
}
.badge-sponsored { background: var(--gold-2); color: var(--navy); }
.badge-breaking { background: var(--red); color: #fff; }
.badge-featured { background: var(--navy); color: #fff; }
.card-media .badge { position: absolute; top: 8px; inset-inline-start: 8px; }

.card-row { flex-direction: row; gap: 12px; }
.card-row .card-media { width: 110px; flex-shrink: 0; aspect-ratio: 1 / 1; }
.card-row .card-body { padding-top: 0; }
.card-row .card-title { font-size: 16px; }

/* ---------- 10) الشبكات والتخطيط ---------- */
.layout { display: grid; grid-template-columns: 1fr; gap: 28px; margin-block: 20px 40px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
.sidebar { display: flex; flex-direction: column; gap: 26px; }
.widget { background: var(--soft); border: 1px solid var(--line); border-top: 3px solid var(--navy); padding: 16px; }
.widget h3 { font-size: 18px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--gold-2); }

/* الأكثر قراءة */
.most-read { counter-reset: mr; }
.most-read li { counter-increment: mr; display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.most-read li:last-child { border-bottom: 0; }
.most-read li::before {
  content: counter(mr); font-family: var(--font-head); font-size: 30px; font-weight: 900; color: var(--gold-2); line-height: 1; min-width: 28px;
}
.most-read a { font-weight: 700; color: var(--navy); line-height: 1.5; display: block; }
.most-read a:hover { color: var(--gold); }

/* ---------- 11) الخبر الرئيسي (Hero) ---------- */
.hero { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 18px; }
.hero-main { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: var(--navy); min-height: 280px; }
.hero-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-main::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11, 31, 58, .92) 5%, rgba(11, 31, 58, .1) 65%); }
.hero-text { position: absolute; inset-inline: 0; bottom: 0; z-index: 2; padding: 18px; color: #fff; }
.hero-text h2 { color: #fff; font-size: clamp(22px, 4.6vw, 38px); margin: 6px 0; }
.hero-text p { color: #e8ecf3; margin: 0 0 6px; font-size: 15px; display: none; }
.hero-text .meta { color: #cdd5e3; }
.hero-text .card-cat { color: var(--gold-2); }
.hero-side { display: grid; gap: 16px; align-content: start; }

/* ---------- 12) صفحة المقال ---------- */
.breadcrumbs { font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--gold); }
.breadcrumbs span.sep { margin-inline: 6px; }
.article-header { margin-block: 12px 18px; }
.article-header h1 { font-size: clamp(26px, 5.4vw, 42px); margin-bottom: 10px; }
.article-excerpt { font-size: 18px; color: var(--muted); font-weight: 600; }
.article-cover { margin: 0 0 22px; }
.article-cover img { width: 100%; border-radius: var(--radius); max-height: 560px; object-fit: cover; }
.article-cover figcaption { font-size: 13px; color: var(--muted); padding-top: 6px; }
.article-body { font-size: 18px; line-height: 2; }
.article-body h2, .article-body h3 { margin-top: 1.4em; }
.article-body img { border-radius: var(--radius); margin-block: 14px; }
.article-body blockquote {
  margin: 1.4em 0; padding: 10px 18px; background: var(--soft); font-family: var(--font-head); font-size: 20px;
  border-inline-start: 4px solid var(--gold-2);
}
.article-body a { color: var(--navy-2); text-decoration: underline; text-decoration-color: var(--gold-2); text-underline-offset: 3px; }
.article-body table { width: 100%; border-collapse: collapse; margin-block: 14px; display: block; overflow-x: auto; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 8px 12px; }
.article-body ul, .article-body ol { padding-inline-start: 24px; margin-bottom: 1em; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-block: 18px; }
.gallery a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.06); }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 20px; padding-block: 14px; border-block: 1px solid var(--line); }
.share-title { font-weight: 700; color: var(--navy); margin-inline-end: 6px; }
.share a, .share button {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 0; cursor: pointer; border-radius: 20px;
  color: #fff; font-size: 14px; font-weight: 600;
}
.share .icon { width: 16px; height: 16px; }
.share-wa { background: #1fa855; } .share-fb { background: #1877f2; } .share-x { background: #111; } .share-copy { background: var(--navy-2); }
.share a:hover, .share button:hover { opacity: .88; color: #fff; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 14px; }
.tags a { background: var(--soft); border: 1px solid var(--line); padding: 2px 12px; border-radius: 20px; font-size: 13px; color: var(--navy); }
.tags a:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- 13) الترقيم والبحث ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-block: 30px; }
.pagination a, .pagination span {
  min-width: 40px; padding: 6px 12px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; background: #fff;
}
.pagination a:hover { border-color: var(--gold); color: var(--gold); }
.pagination .current { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination .disabled { opacity: .45; }

.filters { display: grid; grid-template-columns: 1fr; gap: 10px; background: var(--soft); border: 1px solid var(--line); padding: 14px; margin-block: 16px; }
.filters label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.filters input, .filters select { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.filters button { padding: 10px 22px; border: 0; border-radius: var(--radius); background: var(--navy); color: #fff; font-weight: 700; cursor: pointer; align-self: end; }
.filters button:hover { background: var(--gold); }
.empty-state { text-align: center; color: var(--muted); padding: 50px 10px; background: var(--soft); border: 1px dashed var(--line); }

/* ---------- 14) الصفحات الثابتة و 404 ---------- */
.page-head { background: var(--soft); border-bottom: 1px solid var(--line); padding: 28px 0; margin-bottom: 26px; text-align: center; }
.page-head h1 { margin: 0; font-size: clamp(26px, 5vw, 38px); }
.page-head h1::after { content: ''; display: block; width: 70px; height: 3px; background: var(--gold-2); margin: 10px auto 0; }
.static-page { max-width: 820px; margin: 0 auto 50px; font-size: 18px; line-height: 2; }
.contact-cards { display: grid; grid-template-columns: 1fr; gap: 14px; margin-block: 24px; }
.contact-card { background: var(--soft); border: 1px solid var(--line); border-top: 3px solid var(--gold-2); padding: 18px; text-align: center; }
.contact-card .icon { width: 28px; height: 28px; margin: 0 auto 8px; color: var(--navy); }
.contact-card h3 { font-size: 17px; margin-bottom: 4px; }
.contact-card p { margin: 0; }
.error-page { text-align: center; padding: 60px 0 80px; }
.error-code { font-family: var(--font-head); font-size: clamp(80px, 22vw, 160px); font-weight: 900; color: var(--navy); line-height: 1; }
.error-code span { color: var(--gold-2); }
.btn {
  display: inline-block; padding: 10px 26px; background: var(--navy); color: #fff; border-radius: var(--radius); font-weight: 700; border: 0; cursor: pointer;
}
.btn:hover { background: var(--gold); color: #fff; }

/* ---------- 15) الفوتر ---------- */
.site-footer { background: var(--navy); color: #c9d1de; margin-top: 40px; border-top: 4px solid var(--gold-2); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; padding-block: 38px; }
.site-footer h2, .site-footer h3 { color: #fff; }
.footer-brand { font-size: 26px; font-weight: 900; margin-bottom: 10px; }
.site-footer h3 { font-size: 17px; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 2px solid var(--gold-2); display: inline-block; }
.site-footer a { color: #c9d1de; }
.site-footer a:hover { color: var(--gold-2); }
.footer-col li { padding-block: 4px; }
.footer-contact li { display: flex; align-items: center; gap: 10px; }
.footer-contact .icon { color: var(--gold-2); width: 18px; height: 18px; }
.footer-social { display: flex; gap: 8px; margin-top: 12px; }
.footer-social .social-link { border: 1px solid rgba(255, 255, 255, .25); padding: 8px; }
.footer-social .social-link:hover { background: var(--gold-2); color: var(--navy); }
.footer-adline { margin-top: 14px; font-size: 14px; color: var(--gold-2); }
.footer-bottom { background: #07142a; padding: 14px 0; text-align: center; font-size: 14px; }
.footer-bottom p { margin: 0; }

/* =====================================================
   الشاشات الأكبر (Mobile first → أكبر)
   ===================================================== */
@media (min-width: 640px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .contact-cards { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-text p { display: block; }
  .topbar-links { display: flex; }
}

@media (min-width: 960px) {
  /* القائمة الأفقية */
  .nav-toggle { display: none; }
  .nav-list {
    display: flex; position: static; flex-direction: row; background: transparent; border: 0; padding: 0;
    overflow-x: auto; scrollbar-width: none;
  }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-list a { border: 0; padding: 15px 14px; white-space: nowrap; position: relative; }
  .nav-list a::after {
    content: ''; position: absolute; inset-inline: 14px; bottom: 6px; height: 2px; background: var(--gold-2); transform: scaleX(0); transition: transform .25s;
  }
  .nav-list a:hover::after, .nav-list a.active::after { transform: scaleX(1); }

  .layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; }
  .layout.no-sidebar { grid-template-columns: 1fr; }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .hero { grid-template-columns: 2fr 1fr; }
  .hero-main { min-height: 440px; }
  .filters { grid-template-columns: 2fr 1.2fr 1fr 1fr auto; }
  .contact-cards { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.3fr; }
  .article-body { font-size: 19px; }
}

/* اتجاه الأسهم في RTL */
html[dir="rtl"] .flip { transform: scaleX(-1); }

/* تقليل الحركة لمن يفضلها */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* الطباعة */
@media print {
  .topbar, .site-nav, .ticker, .ad-slot, .share, .site-footer, .sidebar { display: none !important; }
  body { font-size: 12pt; }
}

/* =====================================================
   إضافات المرحلة 4
   ===================================================== */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.cat-list li { border-bottom: 1px solid var(--line); }
.cat-list li:last-child { border-bottom: 0; }
.cat-list a { display: block; padding: 8px 0; font-weight: 600; color: var(--navy); }
.cat-list a:hover { color: var(--gold); }
a.card-cat:hover { color: var(--navy); }
.social-dark { color: var(--navy); border: 1px solid var(--line); padding: 10px; }
.social-dark:hover { background: var(--navy); color: var(--gold-2); }
.article-header .badge { margin-inline-end: 6px; margin-bottom: 8px; }
.error-page h1 { font-size: 28px; }
.layout > div, .layout > article { min-width: 0; }
