:root {
  --brand: #c8102e;
  --brand-dark: #9c0c23;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --max: 1180px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 1px 2px rgba(0, 0, 0, .04);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--bg-soft);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ---------------- Header ---------------- */
.site-header { background: var(--bg); border-bottom: 3px solid var(--brand); }
.topbar { background: var(--ink); color: #fff; font-size: 12px; }
.topbar-inner { display: flex; justify-content: space-between; padding: 6px 16px; letter-spacing: .02em; }
.topbar-tag { opacity: .8; }

.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  background: var(--brand); color: #fff; font-family: Arial, sans-serif;
  font-weight: 800; font-size: 22px; padding: 8px 12px; border-radius: 6px;
  letter-spacing: -1px;
}
.brand-name {
  font-family: Georgia, serif; font-weight: 700; font-size: 34px; color: var(--ink);
  letter-spacing: -.5px;
}

.search { display: flex; }
.search input {
  border: 1px solid var(--line); border-right: 0; padding: 9px 12px;
  border-radius: 6px 0 0 6px; font-size: 14px; min-width: 220px; font-family: Arial, sans-serif;
}
.search button {
  border: 0; background: var(--brand); color: #fff; padding: 0 16px;
  border-radius: 0 6px 6px 0; cursor: pointer; font-family: Arial, sans-serif; font-weight: 700;
}
.search button:hover { background: var(--brand-dark); }

.mainnav { background: var(--bg); border-top: 1px solid var(--line); }
.mainnav-inner { display: flex; flex-wrap: wrap; gap: 2px; }
.mainnav a {
  font-family: Arial, sans-serif; font-weight: 700; font-size: 14px; text-transform: uppercase;
  letter-spacing: .03em; padding: 12px 14px; color: var(--ink);
}
.mainnav a:hover { color: var(--brand); text-decoration: none; }
.mainnav a.active { color: var(--brand); border-bottom: 3px solid var(--brand); }

/* ---------------- Layout ---------------- */
/* main also carries .container, whose `padding: 0 16px` (higher specificity)
   was cancelling the top/bottom padding — so target main.container to win. */
main.container { padding: 48px 16px 40px; }
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; }
.layout-main { min-width: 0; }
.layout-side { min-width: 0; }

.page-head { border-bottom: 2px solid var(--brand); margin-bottom: 18px; padding-bottom: 8px; }
.page-head h1 { margin: 0; font-size: 30px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-family: Arial, sans-serif; font-size: 14px; }

.section { margin: 30px 0; }
.section-title {
  font-family: Arial, sans-serif; font-size: 16px; text-transform: uppercase; letter-spacing: .05em;
  border-left: 5px solid var(--brand); padding-left: 10px; margin: 0 0 16px;
}
.section-title a:hover { color: var(--brand); text-decoration: none; }

/* ---------------- Grid + cards ---------------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-span { grid-column: 1 / -1; }

.card { background: var(--bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card-link:hover { text-decoration: none; }
.card-media { position: relative; aspect-ratio: 16 / 9; background: #e9ebef; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-media img { transform: scale(1.04); }
/* Branded fallback shown only when there is no image */
.card-fallback { display: none; }
.card-media.noimg .card-fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef0f3 0%, #dfe3e8 100%);
}
.card-fallback-icon {
  width: 42px; height: 42px; color: #b7bcc6;
}
.card-cat {
  position: absolute; left: 8px; bottom: 8px; background: var(--brand); color: #fff;
  font-family: Arial, sans-serif; font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 3px 8px; border-radius: 3px; letter-spacing: .04em;
}
.card-body { padding: 12px 14px 14px; }
.card-title { margin: 0 0 6px; font-size: 18px; line-height: 1.3; }
.card:hover .card-title { color: var(--brand); }
.card-excerpt { margin: 0 0 10px; color: #3f434b; font-size: 14px; }
.card-meta { display: flex; gap: 10px; font-family: Arial, sans-serif; font-size: 12px; color: var(--muted); }
.card-source { font-weight: 700; color: var(--brand-dark); }

/* Lead / hero */
.hero { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 10px; }
.hero-side { display: grid; gap: 14px; }
.card-lead .card-media { aspect-ratio: 16 / 10; }
.card-lead .card-title { font-size: 30px; }
.card-sm { display: flex; flex-direction: column; }
.card-sm .card-media { aspect-ratio: 16 / 9; }
.card-sm .card-title { font-size: 15px; }

/* ---------------- Sidebar widgets ---------------- */
.widget { background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.widget-title {
  margin: 0; padding: 12px 14px; font-family: Arial, sans-serif; font-size: 14px; text-transform: uppercase;
  letter-spacing: .04em; background: var(--ink); color: #fff;
}
.widget-list { list-style: none; margin: 0; padding: 6px 0; }
.widget-list li { border-bottom: 1px solid var(--line); }
.widget-list li:last-child { border-bottom: 0; }
.widget-list a { display: block; padding: 10px 14px; font-family: Arial, sans-serif; font-size: 14px; }
.widget-list a:hover { background: var(--bg-soft); color: var(--brand); text-decoration: none; }

/* ---------------- Nav highlight ---------------- */
.mainnav a.nav-highlight { color: var(--brand); }
.mainnav a.nav-highlight::before { content: "● "; font-size: 9px; vertical-align: middle; }

/* ---------------- UAE Today widget ---------------- */
.local-widget .local-block { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.local-widget .local-block:last-of-type { border-bottom: 0; }
.local-head { font-family: Arial, sans-serif; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.local-rows { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-family: Arial, sans-serif; font-size: 13px; }
.local-rows span { color: #3f434b; }
.local-rows b { color: var(--ink); font-variant-numeric: tabular-nums; }
.local-more { display: block; padding: 10px 14px; font-family: Arial, sans-serif; font-size: 13px; font-weight: 700; color: var(--brand); }
.local-more:hover { background: var(--bg-soft); text-decoration: none; }

/* ---------------- UAE Today page ---------------- */
.local-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.local-card { background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.local-card h2 { margin: 0 0 12px; font-size: 18px; border-bottom: 2px solid var(--brand); padding-bottom: 8px; }
.local-table { width: 100%; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 15px; }
.local-table th { text-align: left; font-weight: 600; color: #3f434b; padding: 8px 0; border-bottom: 1px solid var(--line); }
.local-table td { text-align: right; font-weight: 700; color: var(--ink); padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.local-table tr:last-child th, .local-table tr:last-child td { border-bottom: 0; }
.local-note { font-family: Arial, sans-serif; font-size: 12px; color: var(--muted); margin: 10px 0 0; }
@media (max-width: 700px) { .local-grid { grid-template-columns: 1fr; } }

/* ---------------- Ads ---------------- */
.ad-wrap:empty, .grid-span:empty { display: none; }
.ad-wrap { margin: 20px 0; text-align: center; }
.ad-label { display: block; font-family: Arial, sans-serif; font-size: 10px; text-transform: uppercase; color: var(--muted); letter-spacing: .1em; margin-bottom: 4px; }
.ad-placeholder {
  border: 1px dashed #c3c7cf; border-radius: var(--radius); background: repeating-linear-gradient(45deg, #fafbfc, #fafbfc 10px, #f1f3f5 10px, #f1f3f5 20px);
  padding: 26px 12px; color: #9aa0a8; font-family: Arial, sans-serif;
}
.ad-placeholder span { display: block; font-weight: 700; font-size: 13px; }
.ad-placeholder small { font-size: 11px; }
.ad-sidebar.ad-placeholder { min-height: 250px; display: grid; place-content: center; }

/* ---------------- Article page ---------------- */
.article { background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 28px; }
.breadcrumb { font-family: Arial, sans-serif; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a:hover { color: var(--brand); }
.article-title { font-size: 34px; line-height: 1.2; margin: 0 0 12px; }
.article-meta { display: flex; gap: 16px; font-family: Arial, sans-serif; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; }
.article-hero { margin: 0 0 18px; border-radius: var(--radius); overflow: hidden; }
.article-excerpt { font-size: 19px; line-height: 1.7; color: #2a2d33; }
.article-body { font-size: 18px; line-height: 1.75; color: #23262b; }
.article-body p { margin: 0 0 18px; }
.article-body .article-lead { font-size: 20px; color: #1a1a1a; }
.article-body .article-lead::first-letter { font-size: 1.05em; }
.article-source-line { margin: 12px 0 0; font-family: Arial, sans-serif; font-size: 12px; color: var(--muted); word-break: break-all; }
.article-source-line a { color: var(--brand-dark); }
.article-cta { background: var(--bg-soft); border-left: 4px solid var(--brand); padding: 16px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 20px 0; }
.article-cta p { margin: 0 0 12px; font-family: Arial, sans-serif; font-size: 14px; color: var(--muted); }

/* ---------------- Share buttons ---------------- */
.share { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.share-label { font-family: Arial, sans-serif; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 2px; }
.share-btn { font-family: Arial, sans-serif; font-size: 13px; font-weight: 700; color: #fff; padding: 7px 12px; border-radius: 6px; border: 0; cursor: pointer; line-height: 1; }
.share-btn:hover { opacity: .9; text-decoration: none; }
.share-btn.wa { background: #25d366; }
.share-btn.tg { background: #229ed9; }
.share-btn.x  { background: #000; }
.share-btn.fb { background: #1877f2; }
.share-btn.copy { background: #e5e7eb; color: #33373f; }
.share-btn.copy.copied { background: #16a34a; color: #fff; }

/* ---------------- Buttons ---------------- */
.btn { display: inline-block; font-family: Arial, sans-serif; font-weight: 700; padding: 12px 20px; border-radius: 6px; cursor: pointer; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }

/* ---------------- Prose / misc ---------------- */
.prose { background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 30px; }
.prose h1 { margin-top: 0; }
.prose h2 { font-size: 20px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.empty-state { background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px; text-align: center; color: var(--muted); }
.empty-state code { background: var(--bg-soft); padding: 2px 6px; border-radius: 4px; font-family: monospace; }
.updated-note { text-align: center; font-family: Arial, sans-serif; font-size: 12px; color: var(--muted); margin-top: 30px; }
.error-page { text-align: center; padding: 80px 20px; }
.error-page h1 { font-size: 72px; color: var(--brand); margin: 0; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--ink); color: #cfd3da; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; padding: 36px 16px; }
.footer-col h3 { color: #fff; margin: 0 0 10px; }
.footer-col h4 { color: #fff; font-family: Arial, sans-serif; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 10px; }
.footer-col p { font-size: 14px; margin: 0; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { font-family: Arial, sans-serif; font-size: 14px; }
.footer-col a:hover { color: #fff; }
.footer-legal { border-top: 1px solid #33373f; }
.footer-legal p { font-family: Arial, sans-serif; font-size: 12px; color: #8b909a; padding: 16px 0; margin: 0; }

/* ---------------- Docs ---------------- */
.doc-updated { color: var(--muted); font-family: Arial, sans-serif; font-size: 13px; margin-top: -6px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }

/* ---------------- Cookie consent ---------------- */
.cookie-consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  background: rgba(20, 20, 20, .97); color: #f2f3f5;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, .3);
}
.cookie-inner {
  max-width: var(--max); margin: 0 auto; padding: 16px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.cookie-text { flex: 1 1 380px; }
.cookie-text strong { font-family: Arial, sans-serif; display: block; margin-bottom: 4px; }
.cookie-text p { margin: 0; font-family: Arial, sans-serif; font-size: 13px; color: #c9ccd2; }
.cookie-text a { color: #ff9aa8; text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.cookie-actions .btn { padding: 10px 16px; font-size: 13px; }
.cookie-reject { background: transparent; color: #f2f3f5; border: 1px solid #565b64; }
.cookie-reject:hover { background: #2a2d33; text-decoration: none; }
@media (max-width: 560px) {
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; text-align: center; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 560px) {
  .grid-3 { grid-template-columns: 1fr; }
  .brand-name { font-size: 26px; }
  .search input { min-width: 0; width: 100%; }
  .masthead-inner { flex-wrap: wrap; }
  .article-title { font-size: 26px; }
}
