/* دليل السعودية — هوية بصرية عصرية وحيوية: خلفية فاتحة نظيفة، أزرق نيلي
   داكن للعلامة، ولون مميز لكل قسم (مطاعم/تسوق/خدمات...) يُستخدم وظيفيًا
   للتفريق بين الأقسام لا كزخرفة عشوائية. */

:root {
  --ink: #16172c;
  --muted: #5c5e78;
  --bg: #f6f6fb;
  --surface: #ffffff;
  --brand: #2a2b79;
  --brand-ink: #ffffff;
  --link: #4338e0;
  --line: #e6e6f2;
  --accent: #4338e0; /* يُستبدل لكل صفحة بلون القسم عبر متغيّر مضمّن */
  --radius: 14px;
  --max: 74rem;
  --shadow: 0 1px 2px rgba(22, 23, 44, 0.04), 0 8px 24px -12px rgba(22, 23, 44, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eceeff;
    --muted: #a6a8c9;
    --bg: #0f1022;
    --surface: #171935;
    --brand: #7b7fff;
    --brand-ink: #0f1022;
    --link: #9b9eff;
    --line: #2a2c4f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -14px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html { font-size: 17px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  line-height: 1.8;
  direction: rtl;
}

h1, h2, h3, .brand, .main-nav a, .site-footer p.tagline {
  font-family: "Cairo", "IBM Plex Sans Arabic", sans-serif;
}

h1 {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  font-weight: 800;
  margin: 0 0 0.5em;
  color: var(--ink);
  line-height: 1.25;
  position: relative;
  padding-inline-start: 1rem;
  border-inline-start: 6px solid var(--accent);
}

h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 0.8em;
  color: var(--ink);
}

p { max-width: 62ch; color: var(--muted); }

a { color: var(--link); text-decoration-thickness: 1.5px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

.skip-link {
  position: absolute; right: -999px; top: 0;
  background: var(--brand); color: var(--brand-ink); padding: 0.6em 1em; z-index: 10;
}
.skip-link:focus { right: 1rem; top: 1rem; border-radius: 8px; }

.site-header { background: var(--brand); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 1.1rem; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 0.5em;
  color: var(--brand-ink); font-weight: 800; font-size: 1.25rem; text-decoration: none;
}
.brand-mark {
  display: inline-flex; width: 1.6em; height: 1.6em; border-radius: 8px;
  background: linear-gradient(135deg, #ff5a36, #4338e0 60%, #0fbf82);
  align-items: center; justify-content: center; font-size: 0.75em; color: #fff;
}
.main-nav { display: flex; gap: 1.5em; flex-wrap: wrap; }
.main-nav a {
  color: rgba(255, 255, 255, 0.82); text-decoration: none; font-weight: 600;
  border-bottom: 2px solid transparent; padding-bottom: 2px;
}
.main-nav a:hover { color: #fff; border-color: #ff5a36; }

.breadcrumbs { background: var(--surface); border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.breadcrumbs .wrap { display: flex; gap: 0.5em; padding-block: 0.7em; flex-wrap: wrap; }
.breadcrumbs .sep { color: var(--line); }
.breadcrumbs a { text-decoration: none; color: var(--muted); }
.breadcrumbs [aria-current] { color: var(--ink); font-weight: 700; }

main { display: block; max-width: var(--max); margin: 0 auto; padding: 2.4rem 1.25rem 3rem; }

.hero {
  padding: 1.6rem 1.8rem; margin-bottom: 2rem; border-radius: 20px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 90, 54, 0.14), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(67, 56, 224, 0.16), transparent 50%),
    radial-gradient(circle at 70% 90%, rgba(15, 191, 130, 0.12), transparent 45%),
    var(--surface);
  box-shadow: var(--shadow);
}
.hero h1 { border-inline-start: none; padding-inline-start: 0; }
.hero p { max-width: 65ch; }

.section { margin-block: 2.4rem; }

.grid-list, .place-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem;
}

.grid-list li, .place-card {
  border: 1px solid var(--line);
  border-top: 4px solid var(--card-accent, var(--accent));
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1em 1.2em;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.grid-list li.muted { border-top-color: var(--line); opacity: 0.55; box-shadow: none; }
.grid-list a:hover, .grid-list a:focus-visible { outline: none; }
.grid-list li:has(a:hover) { transform: translateY(-2px); }

.grid-list a {
  display: flex; flex-direction: column; gap: 0.25em;
  text-decoration: none; color: inherit;
}
.grid-list a strong { color: var(--ink); font-size: 1.05rem; font-weight: 700; }
.grid-list a span, .grid-list li.muted span { font-size: 0.86rem; color: var(--muted); }

.pill-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.6em; }
.pill-list a {
  display: inline-flex; align-items: center; gap: 0.4em;
  padding: 0.5em 1em; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; color: var(--ink); background: var(--surface);
  font-weight: 600; font-size: 0.92rem;
}
.pill-list a::before {
  content: ""; width: 0.55em; height: 0.55em; border-radius: 50%;
  background: var(--pill-color, var(--accent));
}
.pill-list a:hover { border-color: var(--pill-color, var(--accent)); color: var(--pill-color, var(--accent)); }

.place-card { border-top-color: var(--accent); }
.place-card h3 { margin: 0 0 0.3em; font-size: 1.08rem; font-family: inherit; font-weight: 700; color: var(--ink); }
.place-card .meta { margin: 0 0 0.5em; font-size: 0.88rem; color: var(--muted); }
.place-card .place-links { display: flex; gap: 1.1em; flex-wrap: wrap; font-size: 0.88rem; margin: 0; }
.place-card .place-links a { font-weight: 600; }

.data-table { width: 100%; border-collapse: collapse; margin-top: 1em; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th, .data-table td { text-align: right; padding: 0.6em 0.9em; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.data-table th { font-family: "Cairo", sans-serif; color: var(--brand); background: var(--bg); }

.source-note {
  margin-top: 2rem; padding: 1em 1.2em;
  background: var(--surface); border-inline-start: 4px solid var(--accent);
  border-radius: 10px; font-size: 0.88rem; color: var(--muted); max-width: none;
  box-shadow: var(--shadow);
}

.place-filter input {
  font-size: 0.95rem;
}
.place-filter input:focus-visible { border-color: var(--accent) !important; }

.site-footer { background: var(--ink); color: rgba(255, 255, 255, 0.75); margin-top: 3.5rem; }
.site-footer .wrap { padding-block: 2rem; display: flex; flex-direction: column; gap: 0.7em; }
.site-footer a { color: #ffb199; }
.site-footer p { margin: 0; font-size: 0.86rem; max-width: 70ch; color: inherit; }
.site-footer .copyright { color: rgba(255, 255, 255, 0.4); font-size: 0.78rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* صفحات تفاصيل الأماكن — بقاء الزائر داخل دليل السعودية */
.place-name-link { color: var(--ink); text-decoration: none; }
.place-name-link:hover { color: var(--link); text-decoration: underline; }

.place-detail {
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.place-detail .eyebrow {
  margin: 0 0 .4rem;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
}
.place-detail h1 { margin-bottom: .35em; }
.place-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: .7rem;
  margin: 1.2rem 0;
}
.place-fact {
  min-width: 0;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.place-fact dt { color: var(--muted); font-size: .82rem; font-weight: 700; }
.place-fact dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
.place-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1rem;
  border-radius: 9px;
  color: #fff;
  background: var(--brand);
  text-decoration: none;
  font-weight: 700;
}
.action-link.secondary {
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
}
.place-map iframe {
  display: block;
  width: 100%;
  min-height: 22rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.map-credit { font-size: .8rem; margin-top: .4rem; }
@media (max-width: 40rem) {
  .place-detail { padding: 1rem; }
  .place-map iframe { min-height: 17rem; }
}


/* التقويم والمناسبات والعدادات */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.event-card, .calendar-feature {
  min-width: 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.event-card h3, .calendar-feature h3 { margin: 0 0 .5rem; font-size: 1.08rem; }
.event-card h3 a { color: var(--ink); text-decoration: none; }
.event-card h3 a:hover { color: var(--link); text-decoration: underline; }
.event-date { margin: .5rem 0; }
.event-source, .status-note { font-size: .88rem; color: var(--muted); }
.countdown {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  margin: .8rem 0;
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.countdown-label { color: var(--muted); font-size: .82rem; }
.countdown-value { color: var(--brand); font-size: 1.08rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.eyebrow { color: var(--muted); font-size: .9rem; font-weight: 700; }
.table-scroll { width: 100%; overflow-x: auto; }
.table-scroll .data-table { min-width: 46rem; }
@media (max-width: 40rem) {
  .event-card, .calendar-feature { padding: .9rem; }
  .countdown-value { font-size: .95rem; }
}


/* أدلة المنافع الحكومية */
.benefit-grid li { min-height: 11rem; }
.benefit-grid a { height: 100%; }
.benefit-grid a strong { font-size: 1.08rem; }
.benefit-grid a span { line-height: 1.65; }
.benefit-more { margin-top: auto; padding-top: .6rem; color: var(--link) !important; font-weight: 700; }
.verified-date { font-size: .84rem; margin-top: .5rem; }
.benefit-facts, .benefit-steps, .benefit-cautions, .benefit-sources {
  padding-inline-start: 1.5rem;
  margin: .7rem 0;
}
.benefit-facts li, .benefit-steps li, .benefit-cautions li, .benefit-sources li {
  margin-block: .65rem;
  padding-inline-start: .2rem;
}
.benefit-timing, .official-action {
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.benefit-cautions li::marker { color: #b45309; }
.benefit-sources a { font-weight: 700; }


/* صفحات المؤشرات الإحصائية */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.stat-card {
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem;
}
.stat-card a {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  color: inherit;
  text-decoration: none;
}
.stat-category, .stat-period, .stat-scope {
  color: var(--muted);
  font-size: .82rem;
}
.stat-value {
  display: block;
  color: var(--brand);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  font-weight: 900;
  line-height: 1.25;
}
.stat-value small { font-size: .9rem; font-weight: 600; }
.stat-title { font-weight: 700; }
.stat-card a:hover .stat-title { color: var(--link); text-decoration: underline; }
.stat-highlight {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.stat-highlight strong { color: var(--brand); font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; }
.stat-highlight span { color: var(--muted); font-weight: 700; }

/* أخبار المناطق والملخصات التحريرية */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.news-card {
  min-width: 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.news-card h3 { margin: .35rem 0 .6rem; font-size: 1.05rem; }
.news-card h3 a { color: var(--ink); text-decoration: none; }
.news-card h3 a:hover { color: var(--link); text-decoration: underline; }
.news-card p { margin: .4rem 0 .8rem; }
.news-meta { margin: 0; color: var(--muted); font-size: .82rem; }
.news-read-more { display: inline-block; margin-top: .35rem; font-weight: 700; }
.news-article { max-width: 62rem; margin-inline: auto; }
.news-sources { padding-inline-start: 1.5rem; }
.news-sources li { margin-block: .65rem; }


/* أدوات وحاسبات */
.tool-intro { margin-bottom: 1.5rem; }
.tool-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1rem, 3vw, 2rem); box-shadow: var(--shadow); max-width: 48rem; }
.tool-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.tool-field { display: flex; flex-direction: column; gap: .35rem; color: var(--ink); font-weight: 600; }
.tool-field input, .tool-field select { width: 100%; min-height: 3rem; border: 1px solid var(--line); border-radius: 10px; padding: .55rem .75rem; background: var(--bg); color: var(--ink); font: inherit; }
.tool-field input:focus, .tool-field select:focus { outline: 2px solid var(--link); outline-offset: 2px; }
.tool-submit, .tool-reset { border: 0; border-radius: 10px; padding: .65rem 1.2rem; margin: 1rem .4rem 0 0; font: inherit; font-weight: 700; cursor: pointer; }
.tool-submit { background: var(--brand); color: var(--brand-ink); }
.tool-reset { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.tool-result { margin-top: 1.4rem; padding: 1rem; border-radius: 12px; background: var(--bg); }
.tool-result h2 { margin-bottom: .5rem; }
.tool-result-row { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.tool-result-row:last-child { border-bottom: 0; }
.tool-result-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.tool-error { color: #b42318; font-weight: 700; }
.tool-explainer { max-width: 48rem; }
.tools-grid li { border-top-color: #4338e0; }


/* صفحات المدن: مؤشرات التغطية والروابط المحلية المبنية على البيانات */
.city-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: .8rem;
  margin: 1rem 0;
}
.city-metric {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.city-metric dt { color: var(--muted); font-size: .88rem; font-weight: 700; }
.city-metric dd {
  margin: .15rem 0 0;
  color: var(--brand);
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.city-coverage-note {
  max-width: none;
  padding: .8rem 1rem;
  border-inline-start: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  font-size: .88rem;
}
.city-region-line { margin-bottom: 0; }


/* صفحات الأحياء المبنية على وسوم العنوان الموثقة */
.neighbourhood-list li { min-height: 7rem; }
.neighbourhood-list a { height: 100%; }
.neighbourhood-hero .eyebrow { margin-top: 0; }
.neighbourhood-hero .city-metrics { margin-bottom: .8rem; }
