/* ذاكرة الرافدين: تصميم معرض هادئ. خلفية بيضاء، الصور هي البطل، ومساحات مريحة. الموبايل أولاً. */

/* ───────────── الخطوط (مستضافة داخل الموقع، رخصة OFL) ───────────── */
@font-face {
  font-family: 'Naskh';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/noto-naskh-arabic-arabic-400-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Naskh';
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/noto-naskh-arabic-arabic-700-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Naskh';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/noto-naskh-arabic-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Naskh';
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/noto-naskh-arabic-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plex Arabic';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Plex Arabic';
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Plex Arabic';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plex Arabic';
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ───────────── الألوان والمقاسات ───────────── */
/* هوية مستوحاة من مدرسة بغداد للتصوير وآجرّ بابل المزجّج: لوحات بالأزرق البابلي المتدرّج، عناوين زعفرانية،
   وزهرة الوردية البابلية. الوضع الداكن يتبع إعداد الجهاز */
@font-face {
  font-family: 'Lalezar';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/lalezar-arabic-400-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Lalezar';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/lalezar-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #f8f5ec;
  --bg-top: #e3ecf8;
  --surface: #ece8dc;
  --elev: #fdfbf6;
  --text: #13213d;
  --muted: #4b586e;
  --line: #d3d8e2;
  --rule: #1f4f9a;
  --accent: #1f4f9a;
  --accent-hover: #143a78;
  --on-accent: #ffffff;
  --note-bg: #eef2f9;
  --note-line: #1f4f9a;
  --earth: #8a5a10;
  --focus: #b45309;
  /* الأزرق البابلي المزجّج (آجرّ بوابة عشتار) بتدرّج من اللازوردي الغامق، مع زعفراني للعناوين */
  --royal: #1f4f9a;
  --royal-deep: #143a78;
  --royal-grad: linear-gradient(135deg, #102c63 0%, #1a4590 48%, #2a62b4 100%);
  --on-royal: #eef3fb;
  --saffron: #f6bd47;
  --lapis: #1f4f9a;
  --teal: #2f7f8a;
  --t1-bg: #f3e1ad; --t1-fg: #4a3510;
  --t2-bg: #d9e5f5; --t2-fg: #153363;
  --t3-bg: #d3e8e5; --t3-fg: #17403f;
  --t4-bg: #dfe0f3; --t4-fg: #262a5c;
  --t5-bg: #efe6cf; --t5-fg: #45391b;
  --t6-bg: #dfead8; --t6-fg: #26402a;
  --radius: 0;
  --gutter: 1.125rem;
  --page: 76rem;
  --read: 38rem;
  --font-display: 'Lalezar', 'Plex Arabic', 'IBM Plex Sans Arabic', sans-serif;
  --font-text: 'Naskh', 'Noto Naskh Arabic', 'Traditional Arabic', serif;
  --font-ui: 'Plex Arabic', 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1222;
    --bg-top: #13244a;
    --surface: #131d33;
    --elev: #16223b;
    --text: #edf1f8;
    --muted: #a7b2c7;
    --line: #26375a;
    --rule: #f6bd47;
    --accent: #f6bd47;
    --accent-hover: #ffd47c;
    --on-accent: #10244a;
    --note-bg: #131d33;
    --note-line: #f6bd47;
    --earth: #f6bd47;
    --focus: #8fb6f0;
    --royal: #1d4690;
    --royal-deep: #143a78;
    --royal-grad: linear-gradient(135deg, #0b2152 0%, #163c80 50%, #2457a6 100%);
    --on-royal: #eef3fb;
    --saffron: #f6bd47;
    --lapis: #8fb6f0;
    --teal: #6fb6bd;
    --t1-bg: #33290f; --t1-fg: #f6d88a;
    --t2-bg: #15284a; --t2-fg: #c9dbf5;
    --t3-bg: #11302f; --t3-fg: #bfe3df;
    --t4-bg: #1d2048; --t4-fg: #d0d3f3;
    --t5-bg: #2b2616; --t5-fg: #ebdfb9;
    --t6-bg: #172a1b; --t6-fg: #cfe3c8;
    color-scheme: dark;
  }
}
/* ───────────── الأساس ───────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: break-word;
  overflow-x: clip;
}
.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.read {
  width: 100%;
  max-width: calc(var(--read) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}
a:hover {
  color: var(--accent-hover);
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.45;
  margin: 1.6em 0 0.5em;
}
h1 {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  margin-top: 0.6em;
}
h2 {
  font-size: 1.25rem;
}
h3 {
  font-size: 1.05rem;
}
p {
  margin: 0 0 1em;
}
img {
  max-width: 100%;
  height: auto;
}
.muted {
  color: var(--muted);
}
.lead {
  font-size: 1.15rem;
  max-width: 40rem;
}
.empty {
  color: var(--muted);
  padding: 1.5rem 0;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: absolute;
  inset-inline-start: 0.5rem;
  top: -3rem;
  background: var(--surface);
  padding: 0.5rem 1rem;
  z-index: 5;
}
.skip:focus {
  top: 0.5rem;
}
.flash {
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: var(--note-bg);
  border-radius: var(--radius);
}

/* ───────────── الرأس والتذييل ───────────── */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.header-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem 1.25rem;
  padding-block: 0.75rem 0.3rem;
}
.brand {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  margin-inline-end: auto;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding-block: 0.25rem 0.6rem;
  font-size: 0.95rem;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding-block: 0.5rem;
}
.site-nav a:hover {
  color: var(--text);
}
.site-nav a[aria-current='page'] {
  color: var(--text);
  box-shadow: 0 2px 0 var(--accent);
}
/* بالواجهة العامة القائمة داخل صف الرأس: سطر ثاني بالموبايل، ونفس السطر بالشاشات الأعرض */
.header-row .site-nav {
  order: 3;
  flex: 1 0 100%;
  padding-block: 0;
}
@media (min-width: 48rem) {
  .header-row {
    padding-block: 0.6rem;
  }
  .header-row .site-nav {
    order: 0;
    flex: 0 1 auto;
    column-gap: 1.5rem;
  }
}
.site-footer {
  margin-top: 5rem;
  border-top: 1px solid var(--line);
  padding-block: 2rem 3rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ───────────── النماذج ───────────── */
input,
select,
button {
  font: inherit;
  font-family: var(--font-ui);
  font-size: 1rem;
}
input[type='search'],
input[type='number'],
select {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.5rem 0.9rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
button[type='submit'] {
  min-height: 2.9rem;
  padding: 0.5rem 1.4rem;
  color: var(--on-accent);
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}
button[type='submit']:hover {
  background: var(--accent-hover);
}
.search-box {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0;
  max-width: 34rem;
}
.search-box input {
  flex: 1;
}
.search-form {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
  max-width: 44rem;
}
.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.more-filters {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.more-filters summary {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  cursor: pointer;
  font-size: 0.95rem;
}
.more-filters[open] summary {
  margin-bottom: 0.5rem;
}
.more-filters > .filters {
  padding-bottom: 1rem;
}
.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  font-size: 0.95rem;
}
.check input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
}
.results-count {
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
}
.browse-types h2 {
  font-size: 1.05rem;
}
.browse-types ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem;
}
.browse-types a {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.browse-types a:hover span {
  text-decoration: underline;
}
.browse-types span {
  font-weight: 600;
}
.browse-types small {
  color: var(--muted);
}

/* اقتراحات البحث أثناء الكتابة */
.search-box,
.suggest-wrap {
  position: relative;
}
.suggest {
  position: absolute;
  top: 100%;
  inset-inline: 0;
  z-index: 10;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--text);
  border-radius: var(--radius);
}
.suggest a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.9rem;
  min-height: 2.75rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.suggest li:last-child a {
  border-bottom: 0;
}
.suggest a:hover,
.suggest a:focus {
  background: var(--surface);
  outline-offset: -2px;
}
.suggest small {
  flex-shrink: 0;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.95rem;
}

/* ───────────── البطاقة ───────────── */
.card {
  display: block;
  color: inherit;
  text-decoration: none;
}
.card:hover {
  color: inherit;
}
.card-media {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}
/* البطاقة النصية: بطاقة فهرسة. النوع والسنة فوق، والعنوان بخط النص تحت */
.card-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.card-index {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
.card-year {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.card-type {
  color: var(--earth);
  font-weight: 600;
}
.card-type::after {
  content: ' · ';
  color: var(--muted);
  font-weight: 400;
}
.card-text-title,
.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-text-title {
  -webkit-line-clamp: 3;
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.6;
}
@media (min-width: 40rem) {
  .card-text-title {
    font-size: 1.1rem;
  }
}
.card-title {
  -webkit-line-clamp: 2;
  margin-top: 0.6rem;
}
.card:hover .card-title,
.card:hover .card-text-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}
.card-meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.card-title + .card-meta {
  margin-top: 0.1rem;
}
.card-big {
  font-size: 1.5rem;
  line-height: 1.35;
}
.card-short {
  aspect-ratio: 16 / 9;
}

/* ───────────── الصفوف الأفقية ───────────── */
.row-section {
  margin-block: 2.75rem;
}
.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-height: 2.75rem;
}
.row-head h2 {
  margin: 0;
  font-size: 1.3rem;
}
.row-nav {
  display: flex;
  gap: 0.25rem;
}
/* مخفية لحد ما يفعّلها site.js على الأجهزة اللي بيها ماوس */
.row-nav[hidden] {
  display: none;
}
.row-nav button {
  font-size: 0.9rem;
  color: var(--accent);
  background: none;
  border: 0;
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
  min-height: 2.5rem;
  cursor: pointer;
}
.row-nav button:hover {
  background: var(--surface);
}
.row-nav button:disabled {
  color: var(--muted);
  opacity: 0.55;
  cursor: default;
  background: none;
}
.row,
.strip {
  --edge: max(var(--gutter), calc((100% - var(--page)) / 2 + var(--gutter)));
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0.25rem var(--edge);
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--edge);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.row::-webkit-scrollbar,
.strip::-webkit-scrollbar {
  display: none;
}
.row > li {
  flex: 0 0 auto;
  width: min(66vw, 15.5rem);
  scroll-snap-align: start;
}
.strip {
  gap: 0.5rem;
}
.strip > li {
  flex: 0 0 auto;
  scroll-snap-align: start;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.pill:hover {
  border-color: var(--text);
  color: var(--text);
}
.pill[aria-current] {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}
.pill small {
  color: var(--muted);
  font-size: 0.8rem;
  margin-inline-start: 0.4rem;
}
.pill[aria-current] small {
  color: inherit;
}

/* ───────────── الشبكة ───────────── */
.grid {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem 1rem;
}
@media (min-width: 40rem) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 1.25rem;
  }
}
@media (min-width: 64rem) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0;
}
.pager a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
}
.pager a:hover {
  border-color: var(--accent);
}
.crumbs {
  margin: 1.5rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem;
  padding: 0;
  font-size: 0.9rem;
}
.chips a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
}
.chips a:hover {
  border-color: var(--text);
}

/* ───────────── الرئيسية ───────────── */
/* المادة المميزة: صورة ونص جنب بعض مثل صفحة مجلة، بلا تظليل فوق الصورة */
.hero {
  display: grid;
  gap: 1rem;
  padding-block: 1.25rem 0.5rem;
}
.hero-image {
  aspect-ratio: 4 / 3;
  background: var(--surface);
  overflow: hidden;
  border: 1px solid var(--line);
}
.hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
.hero-body {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
@media (min-width: 52rem) {
  .hero {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 2.5rem;
    align-items: end;
    padding-block: 2rem 1rem;
  }
}
.hero-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--earth);
  font-weight: 600;
}
.hero-title {
  margin: 0 0 0.6rem;
  font-size: clamp(1.6rem, 4.2vw, 2.5rem);
  line-height: 1.4;
}
.hero-summary {
  margin: 0 0 1.25rem;
  font-family: var(--font-text);
  font-size: 1.1rem;
  line-height: 1.9;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1.5rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}
.hero-cta:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}
.hero-text {
  padding-block: 3.5rem 0.5rem;
}
.hero-text h1 {
  font-size: clamp(2.2rem, 8vw, 4rem);
  margin: 0 0 0.75rem;
  line-height: 1.3;
}

/* ───────────── الخط الزمني ───────────── */
.page-head {
  padding-block: 0.5rem 0.25rem;
}
.page-head h1 {
  margin-bottom: 0.25rem;
}
.era-block {
  margin-block: 3rem;
}
.banner-wrap {
  margin-top: 1rem;
}
.banner {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  text-decoration: none;
}
.banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.banner-text {
  display: flex;
  align-items: flex-end;
  aspect-ratio: 16 / 7;
  padding: 1.25rem;
  font-size: clamp(2rem, 9vw, 4.5rem);
  font-weight: 600;
  line-height: 1.1;
}
@media (min-width: 48rem) {
  .banner {
    aspect-ratio: 21 / 8;
  }
  .banner-text {
    aspect-ratio: 21 / 5;
    padding: 2rem;
  }
}
.era-block h2 {
  font-size: 1.5rem;
  margin: 1rem 0 0.15rem;
}
.era-block h2 a {
  color: inherit;
  text-decoration: none;
}
.era-block h2 a:hover {
  text-decoration: underline;
}
.era-desc {
  max-width: 40rem;
  margin-top: 0.5rem;
}
.more-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

/* ───────────── صفحة المادة ───────────── */
figure {
  margin: 0;
}
figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--muted);
}
figcaption a {
  color: inherit;
}
.entry-head {
  max-width: 62rem;
  padding-block: 1rem 0.5rem;
}
.entry-head .crumbs {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.entry-head .crumbs a {
  color: inherit;
}
.kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0;
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.kicker > span + span::before {
  content: '·';
  margin-inline: 0.5rem;
}
.kicker > span:first-child {
  color: var(--earth);
  font-weight: 600;
}
.entry h1 {
  margin: 0.35rem 0 0.5rem;
  font-size: clamp(1.75rem, 5.5vw, 2.6rem);
  line-height: 1.4;
}
.entry-summary {
  max-width: var(--read);
  margin: 0 0 0.5rem;
  font-family: var(--font-text);
  font-size: 1.25rem;
  line-height: 1.9;
  color: var(--text);
}
.entry-lead {
  max-width: 62rem;
  margin-top: 1rem;
}
.entry-lead img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--line);
}
.zoom {
  display: block;
  cursor: zoom-in;
}
.entry-layout {
  max-width: 62rem;
  display: grid;
  gap: 2.5rem;
  margin-top: 1.75rem;
}
@media (min-width: 60rem) {
  .entry-layout {
    grid-template-columns: minmax(0, 1fr) 16.5rem;
    gap: 3.5rem;
    align-items: start;
  }
  .record {
    position: sticky;
    top: 1rem;
  }
}
.entry-main {
  max-width: var(--read);
}
.prose {
  font-family: var(--font-text);
  font-size: 1.1875rem;
  line-height: 2;
}
.prose h2 {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  margin-top: 2em;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.prose ul {
  padding-inline-start: 1.25rem;
}

/* سجلّ المادة: بطاقة فهرسة */
.record {
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.record h2 {
  margin: 0;
  padding: 0.6rem 0;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--line);
}
.record dl {
  margin: 0;
}
.record dl > div {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.record dt {
  font-size: 0.78rem;
  color: var(--muted);
}
.record dd {
  margin: 0.1rem 0 0;
  line-height: 1.65;
}
.record dd a {
  color: var(--text);
  text-decoration-color: var(--line);
  text-underline-offset: 0.25em;
}
.record dd a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}
.record-hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
}
.doc-status {
  font-weight: 600;
}
.doc-encyclopedic,
.doc-single {
  color: var(--earth);
}
.doc-multi {
  color: var(--accent);
}

/* ما هو مختلف عليه: صندوق بخلفية ورقية خفيفة */
.notes {
  margin: 2.5rem 0;
  padding: 0.75rem 1.1rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--note-bg);
}
.notes h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--earth);
}
.notes-lead {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.notes .prose {
  font-size: 1.05rem;
}
.entry-audio {
  margin: 1.5rem 0;
}
.entry-audio audio {
  width: 100%;
}
.gallery {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1rem;
}
.gallery a {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}
.gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}
.entry-section {
  margin-top: 2.5rem;
}
.entry-section h2,
.sources h2 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
}
.sources {
  margin-top: 3rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.sources ol {
  margin: 0;
  padding-inline-start: 1.6rem;
  font-size: 0.95rem;
}
.sources li {
  margin-bottom: 0.8rem;
  padding-inline-start: 0.25rem;
}
.sources li::marker {
  font-weight: 600;
  color: var(--muted);
}
.source-kind {
  display: inline-block;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 0.4rem;
}
.source-link {
  font-size: 0.9rem;
  direction: ltr;
  unicode-bidi: isolate;
}
.sources-note {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}
cite {
  font-style: normal;
  font-weight: 600;
}

/* نافذة تكبير الصورة */
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 3.5rem 1rem 1rem;
  border: 0;
  background: #0d0c0b;
  color: #ece7de;
}
.lightbox::backdrop {
  background: #0d0c0b;
}
.lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  object-fit: contain;
}
.lightbox-caption {
  max-width: 48rem;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #c9c2b6;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: 0.75rem;
  inset-inline-end: 0.75rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  font: inherit;
  color: #ece7de;
  background: transparent;
  border: 1px solid #5a554d;
  border-radius: var(--radius);
  cursor: pointer;
}
.lightbox-close:hover {
  border-color: #ece7de;
}

/* ───────────── من نحن ───────────── */
.team {
  list-style: none;
  margin: 1.5rem 0 3rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 1.75rem 1rem;
  text-align: center;
}
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 6.5rem;
  height: 6.5rem;
  margin: 0 auto 0.6rem;
  border-radius: 50%;
  object-fit: cover;
  font-size: 2.4rem;
  font-weight: 600;
}
.team-name {
  margin: 0;
  font-weight: 600;
  line-height: 1.5;
}
.team-role {
  margin: 0.1rem 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}
.message {
  padding-block: 3rem;
}

/* ───────────── ألوان الحقب (بالآخر حتى تغلب خلفية البطاقة) ───────────── */
.tint-1 { background: var(--t1-bg); color: var(--t1-fg); }
.tint-2 { background: var(--t2-bg); color: var(--t2-fg); }
.tint-3 { background: var(--t3-bg); color: var(--t3-fg); }
.tint-4 { background: var(--t4-bg); color: var(--t4-fg); }
.tint-5 { background: var(--t5-bg); color: var(--t5-fg); }
.tint-6 { background: var(--t6-bg); color: var(--t6-fg); }
.tint-0 { background: var(--surface); color: var(--text); }

/* ───────────── الشاشات الأعرض ───────────── */
@media (min-width: 40rem) {
  :root {
    --gutter: 1.75rem;
  }
  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
  }
  .row > li {
    width: 16.5rem;
  }
}


@media print {
  .site-header,
  .site-footer,
  .search-box,
  .pager,
  .row-section,
  .row-nav {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
}

/* روابط الأشخاص والموضوعات داخل سجلّ المادة: قائمة مضغوطة بدل الأزرار */
.record .chips {
  margin: 0;
  gap: 0 0.9rem;
  font-size: inherit;
}
.record .chips a {
  min-height: 2rem;
  padding: 0;
  border: 0;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 0.25em;
}
.record .chips a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* ───────────── مخطط السنوات ───────────── */
.timeline-chart {
  margin-block: 1rem 2rem;
}
.timeline-chart h2 {
  margin: 0;
  font-size: 1.05rem;
}
.timeline-chart > .muted {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.9rem;
}
.yearchart {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}
.yearchart-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.yearchart svg {
  display: block;
  width: max(100%, 60rem);
  height: auto;
}
.yearchart svg.yearchart-wide {
  width: max(100%, 34rem);
}
.yc-axis {
  stroke: var(--line);
  stroke-width: 1;
}
.yc-bar rect {
  fill: var(--text);
}
.yc-bar .yc-hit {
  fill: transparent;
}
.yc-bar:hover rect:not(.yc-hit),
.yc-bar:focus rect:not(.yc-hit) {
  fill: var(--accent);
}
.yc-bar:focus .yc-hit {
  fill: var(--surface);
}
.yc-bar:focus,
.yc-era:focus {
  outline: none;
}
.yc-era-1 rect {
  fill: var(--earth);
}
.yc-era-2 rect {
  fill: var(--muted);
}
.yc-era:hover rect,
.yc-era:focus rect {
  fill: var(--accent);
}
.yc-label {
  fill: var(--muted);
  font-family: var(--font-ui);
  font-size: 10px;
}
.yearchart-wide .yc-label {
  font-size: 11px;
}

/* ───────────── طلب تصحيح ───────────── */
.report-form {
  display: grid;
  gap: 1rem;
  margin-bottom: 3rem;
}
.report-form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}
.report-form legend {
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.report-form .check {
  min-height: 2.5rem;
}
.report-form textarea,
.report-form input[type='text'] {
  width: 100%;
  padding: 0.6rem 0.9rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.report-form textarea {
  font-family: var(--font-text);
  line-height: 1.8;
}
.report-form small {
  font-size: 0.8rem;
}
.hp {
  position: absolute;
  inset-inline-start: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.flash-error {
  border: 1px solid var(--line);
}

/* ───────────── المحافظات ───────────── */
.gov-layout {
  display: grid;
  gap: 2rem;
  margin-bottom: 3rem;
}
@media (min-width: 56rem) {
  .gov-layout {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: start;
  }
}
.govmap {
  margin: 0;
}
.govmap svg {
  display: block;
  width: 100%;
  max-width: 36rem;
  height: auto;
}
.gov path {
  fill: var(--surface);
  stroke: var(--bg);
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.gov.lvl-1 path { fill: #dfe5ee; }
.gov.lvl-2 path { fill: #b7c5da; }
.gov.lvl-3 path { fill: #7f97bb; }
.gov.lvl-4 path { fill: var(--accent); }
.gov-labels text {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  fill: var(--text);
  stroke: var(--bg);
  stroke-width: 3.5px;
  stroke-linejoin: round;
  paint-order: stroke;
  pointer-events: none;
}
.gov:hover path,
.gov:focus path {
  fill: var(--earth);
}
.gov:focus,
.gov-point:focus {
  outline: none;
}
.gov-current path {
  fill: var(--earth);
}
.gov-point circle {
  fill: var(--accent);
  stroke: var(--bg);
  stroke-width: 2;
}
.gov-point:hover circle,
.gov-point:focus circle,
.gov-point.gov-current circle {
  fill: var(--earth);
}
@media (prefers-color-scheme: dark) {
  .gov.lvl-1 path { fill: #1f2633; }
  .gov.lvl-2 path { fill: #2a3a58; }
  .gov.lvl-3 path { fill: #42608f; }
  .gov.lvl-4 path { fill: #a9c0e4; }
}
.govmap figcaption {
  max-width: 34rem;
}
.gov-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.gov-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}
.gov-list a {
  color: var(--text);
}
.gov-list .muted {
  font-size: 0.9rem;
}
.gov-other {
  margin-block: 3rem;
}
.gov-other h2 {
  font-size: 1.05rem;
}
.team-call {
  margin: -1.5rem 0 3rem;
  color: var(--muted);
}
.about-report {
  margin: 2rem 0 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* ───────────── الصحافة العراقية ───────────── */
/* كل إصدار مثل ترويسة جريدة: الاسم كبير بخط القراءة، فوقه سنوات الصدور، وتحته نوعه ومكانه */
.chips a[aria-current='page'] {
  border-color: var(--text);
  background: var(--text);
  color: var(--bg);
}
.press-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.press-jump a {
  color: var(--muted);
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}
.press-jump a:hover {
  color: var(--text);
}
.press-era {
  margin-block: 1.5rem 2.5rem;
  scroll-margin-top: 1rem;
}
.press-era h2 {
  font-size: 1.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 0;
}
.press-era h2 .muted {
  font-size: 0.85rem;
  font-weight: 400;
}
.press-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.press-item {
  border-bottom: 1px solid var(--line);
}
.press-item a {
  display: grid;
  gap: 0.15rem;
  padding: 1rem 0;
  color: var(--text);
  text-decoration: none;
}
.press-item a:hover .press-name {
  color: var(--accent);
}
.press-years {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--earth);
  font-variant-numeric: tabular-nums;
}
.press-name {
  font-family: var(--font-text);
  font-size: 1.6rem;
  line-height: 1.3;
  font-weight: 700;
  transition: color 0.15s ease;
}
.press-meta {
  font-size: 0.85rem;
  color: var(--muted);
}
.press-summary {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: var(--read);
  margin-top: 0.25rem;
}
@media (min-width: 48rem) {
  .press-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2.5rem;
  }
}
@media (min-width: 72rem) {
  .press-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .press-name {
    transition: none;
  }
}

/* ───────────── طراز المخطوطة البغدادية (يغلب ما فوقه) ───────────── */
:root {
  /* الأزرق البابلي المزجّج وزهرة الوردية البابلية، مثل آجرّ بوابة عشتار وشارع الموكب ببابل */
  --babylon: #12336f;
}

/* الرأس: لوح لازوردي متدرّج، والاسم بالزعفراني، وتحته شريط زهور بابلية */
.site-header {
  position: relative;
  background: var(--royal-grad);
  border-bottom: 0;
  margin-bottom: 30px;
}
.site-header::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 100%;
  height: 30px;
  background: var(--babylon) url(/img/rosette.svg) center / 34px 26px;
  background-repeat: round no-repeat;
  border-block: 2px solid var(--saffron);
}
.site-header :focus-visible {
  outline-color: var(--saffron);
}
.brand {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  line-height: 1.4;
  color: var(--saffron);
}
.brand:hover {
  color: var(--saffron);
}
.site-nav a {
  color: var(--on-royal);
  opacity: 0.85;
}
.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--saffron);
  opacity: 1;
}
.site-nav a[aria-current='page'] {
  box-shadow: 0 2px 0 var(--saffron);
}

/* العناوين: خط عريض مثل عناوين الكتب المصوّرة */
h1,
.hero-title,
.hero-text h1 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.45;
  color: var(--royal);
}
@media (prefers-color-scheme: dark) {
  h1,
  .hero-title,
  .hero-text h1 {
    color: var(--saffron);
  }
}
h1 {
  font-size: clamp(2.2rem, 7vw, 3.4rem);
}
/* عنوان كل قسم: لوحة لازوردية متدرّجة بكتابة زعفرانية */
.row-head h2,
.era-block h2,
.press-era h2,
.timeline-chart h2,
.gov-other h2,
.entry-section h2,
.sources h2,
.browse-types h2 {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.5;
  padding: 0.15rem 1rem 0;
  background: var(--royal-grad);
  color: var(--saffron);
}
.row-head h2 {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
}
.era-block h2 a {
  color: inherit;
}
.press-era h2 {
  border-bottom: 0;
  padding-bottom: 0;
}
.press-era h2 .muted {
  color: var(--on-royal);
}

/* المادة المميزة: الصورة بإطار مزدوج، ولوحة العنوان اللازوردية تتراكب عليها مثل غلاف كتاب مصوّر */
.hero {
  gap: 0;
}
.hero-image {
  border: 6px solid var(--royal);
  outline: 2px solid var(--saffron);
  outline-offset: -10px;
  background: var(--surface);
}
.hero-body {
  position: relative;
  z-index: 1;
  margin: -2.5rem 0.75rem 0;
  padding: 1.25rem 1.25rem 1.4rem;
  background: var(--royal-grad);
  color: var(--on-royal);
  border: 0;
  outline: 1.5px solid var(--saffron);
  outline-offset: -7px;
}
.hero-title {
  color: var(--saffron);
  font-size: clamp(2rem, 6vw, 3.2rem);
  margin-bottom: 0.4rem;
}
@media (prefers-color-scheme: dark) {
  .hero-title {
    color: var(--saffron);
  }
}
.hero-kicker {
  color: var(--on-royal);
  opacity: 0.85;
}
.hero-summary {
  color: var(--on-royal);
}
.hero-cta {
  background: var(--saffron);
  color: #10244a;
  font-weight: 700;
}
.hero-cta:hover {
  background: #ffd47c;
  color: #10244a;
}
.hero :focus-visible {
  outline-color: var(--saffron);
}
@media (min-width: 52rem) {
  .hero {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    align-items: center;
  }
  .hero-body {
    margin: 0;
    margin-inline-start: -4rem;
  }
}

/* البطاقات والصور: إطار لازوردي وخيط زعفراني داخلي، مثل المنمنمات */
.card-media,
.banner,
.gallery a,
.entry-lead .zoom {
  border: 3px solid var(--royal);
  outline: 1px solid var(--saffron);
  outline-offset: -7px;
}
.entry-lead img {
  border: 0;
}
.card-text {
  border: 3px solid var(--royal);
}
.card-type {
  color: var(--royal);
}
@media (prefers-color-scheme: dark) {
  .card-type {
    color: var(--saffron);
  }
}
.card:hover .card-title,
.card:hover .card-text-title {
  text-decoration-color: var(--royal);
  text-decoration-thickness: 2px;
}
.card-big {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
}
.banner-text {
  font-family: var(--font-display);
  font-weight: 400;
}

/* الأزرار والحقول */
input[type='search'],
input[type='number'],
select,
.report-form textarea,
.report-form input[type='text'] {
  background: var(--elev);
  border: 2px solid var(--royal);
}
@media (prefers-color-scheme: dark) {
  input[type='search'],
  input[type='number'],
  select,
  .report-form textarea,
  .report-form input[type='text'] {
    border-color: var(--line);
  }
}
button[type='submit'] {
  background: var(--royal);
  color: var(--saffron);
  font-weight: 700;
  border: 2px solid var(--royal);
}
button[type='submit']:hover {
  background: var(--royal-deep);
}
.pill,
.chips a,
.pager a {
  border: 2px solid var(--royal);
  color: var(--text);
}
.pill:hover,
.chips a:hover,
.pager a:hover,
.pill[aria-current],
.chips a[aria-current='page'] {
  background: var(--royal);
  border-color: var(--royal);
  color: var(--saffron);
}
.pill:hover small,
.pill[aria-current] small {
  color: var(--on-royal);
}
@media (prefers-color-scheme: dark) {
  .pill,
  .chips a,
  .pager a {
    border-color: var(--line);
  }
}
.row-nav button {
  color: var(--royal);
  font-weight: 700;
}
@media (prefers-color-scheme: dark) {
  .row-nav button {
    color: var(--saffron);
  }
}

/* صفحة المادة */
.kicker > span:first-child {
  color: var(--royal);
}
.record {
  padding: 0 1rem 0.5rem;
  background: var(--elev);
  border: 3px solid var(--royal);
  outline: 1px solid var(--saffron);
  outline-offset: -7px;
}
.record h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--royal);
}
/* «ما هو مختلف عليه»: حاشية مخطوطة بإطار مزدوج، وعنوانها بخانة لازوردية على حافة الإطار */
.notes {
  position: relative;
  margin: 3.25rem 0 2.5rem;
  padding: 1.75rem 1.25rem 0.75rem;
  background: var(--elev);
  border: 2px solid var(--royal);
  outline: 1px solid var(--saffron);
  outline-offset: -6px;
}
.notes h2 {
  position: absolute;
  top: 0;
  inset-inline-start: 1rem;
  transform: translateY(-55%);
  margin: 0;
  padding: 0.1rem 0.85rem 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.1rem;
  line-height: 1.6;
  background: var(--royal-grad);
  color: var(--saffron);
}
.notes-lead {
  margin-top: 0;
  padding-bottom: 0.6rem;
  border-bottom: 1px dashed var(--line);
}
.prose h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  color: var(--royal);
  border-top-color: var(--line);
}
@media (prefers-color-scheme: dark) {
  .kicker > span:first-child,
  .record h2,
  .prose h2 {
    color: var(--saffron);
  }
}

/* الصحافة */
.press-name {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--royal);
}
.press-years {
  color: var(--lapis);
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .press-name {
    color: var(--text);
  }
}

/* الخريطة ومخطط السنوات بألوان المخطوطة */
.gov.lvl-1 path { fill: #dfe8f5; }
.gov.lvl-2 path { fill: #a9c1e6; }
.gov.lvl-3 path { fill: #5a85c8; }
.gov.lvl-4 path { fill: #1f4f9a; }
.gov:hover path,
.gov:focus path,
.gov-current path {
  fill: var(--saffron);
}
.gov-point circle {
  fill: var(--royal);
}
@media (prefers-color-scheme: dark) {
  .gov.lvl-1 path { fill: #16223b; }
  .gov.lvl-2 path { fill: #20407a; }
  .gov.lvl-3 path { fill: #3f6fc0; }
  .gov.lvl-4 path { fill: #8fb6f0; }
}
.yc-bar rect {
  fill: var(--royal);
}
.yc-era-1 rect {
  fill: var(--teal);
}
.yc-era-2 rect {
  fill: var(--saffron);
}
@media (prefers-color-scheme: dark) {
  .yc-bar rect {
    fill: var(--saffron);
  }
}
.yc-bar:hover rect:not(.yc-hit),
.yc-bar:focus rect:not(.yc-hit),
.yc-era:hover rect,
.yc-era:focus rect {
  fill: var(--lapis);
}

/* التذييل: لوح لازوردي متدرّج، فوقه شريط الزهور البابلية */
.site-footer {
  position: relative;
  margin-top: 6rem;
  border-top: 0;
  background: var(--royal-grad);
  color: var(--on-royal);
}
.site-footer::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 100%;
  height: 30px;
  background: var(--babylon) url(/img/rosette.svg) center / 34px 26px;
  background-repeat: round no-repeat;
  border-block: 2px solid var(--saffron);
}
.site-footer a {
  color: var(--saffron);
}
.site-footer :focus-visible {
  outline-color: var(--saffron);
}

/* خلفية الصفحة: عاجي، وبأعلاها تدرّج خفيف للأزرق */
body {
  background: linear-gradient(180deg, var(--bg-top) 0, var(--bg) 34rem) no-repeat, var(--bg);
}


/* ───────────── بدل العناصر الجاهزة: كل شي بلغة المخطوطة ───────────── */
/* نوع المصدر: بدل الشارة المؤطرة، كتابة صغيرة بين معقوفين مثل حواشي الكتب */
.source-kind {
  border: 0;
  padding: 0;
  font-size: 0.8rem;
  color: var(--accent);
}
.source-kind::before {
  content: '[';
}
.source-kind::after {
  content: ']';
}

/* صورة الفريق: بدل الدائرة، مربع بإطار مزدوج مثل المنمنمات، والحرف الأول بالزعفراني */
.avatar {
  border-radius: 0;
  border: 2px solid var(--royal);
  outline: 1px solid var(--saffron);
  outline-offset: -6px;
}
span.avatar {
  background: var(--royal-grad);
  color: var(--saffron);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.6rem;
}

/* تصفح حسب النوع: فهرس بخطوط فاصلة بدل البطاقات الملونة */
.browse-types ul {
  gap: 0 1.5rem;
  border-top: 2px solid var(--royal);
}
.browse-types a {
  flex-direction: row;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  min-height: 2.75rem;
  padding: 0.6rem 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.browse-types span {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--accent);
}
.browse-types a:hover span {
  text-decoration: none;
  color: var(--accent-hover);
}
@media (prefers-color-scheme: dark) {
  .browse-types a:hover span {
    color: var(--accent-hover);
  }
}

/* رسائل التنبيه: إطار المخطوطة بدل الصندوق الملوّن */
.flash {
  background: var(--elev);
  border: 2px solid var(--royal);
  outline: 1px solid var(--saffron);
  outline-offset: -6px;
  border-radius: 0;
  padding: 0.9rem 1.1rem;
}


/* ───────────── تبسيط: أقل زخرفة (يغلب ما فوقه) ───────────── */
/* ألوان سادة بلا تدرّج، عناوين بلا لوحات، وخط رفيع واحد حول الصور والبطاقات.
   يبقى شريط الوردة البابلية والأزرق والزعفراني، وخط Lalezar للعناوين الكبيرة فقط */
:root {
  --royal-grad: var(--royal);
}
body {
  background: var(--bg);
}

/* عناوين الأقسام: كتابة زرقاء بخط الواجهة، بلا لوحة ورائها */
.row-head h2,
.era-block h2,
.press-era h2,
.timeline-chart h2,
.gov-other h2,
.entry-section h2,
.sources h2,
.browse-types h2,
.record h2,
.prose h2 {
  display: block;
  padding: 0;
  background: none;
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--royal);
}
.press-era h2 {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}
.press-era h2 .muted {
  color: var(--muted);
}
@media (prefers-color-scheme: dark) {
  .row-head h2,
  .era-block h2,
  .press-era h2,
  .timeline-chart h2,
  .gov-other h2,
  .entry-section h2,
  .sources h2,
  .browse-types h2,
  .record h2,
  .prose h2 {
    color: var(--saffron);
  }
}

/* المادة المميزة: الصورة وجنبها النص، بلا لوحة فوقها */
.hero {
  gap: 1rem 2.5rem;
}
.hero-image {
  border: 1px solid var(--line);
  outline: none;
}
.hero-body {
  margin: 0;
  padding: 0;
  background: none;
  color: var(--text);
  outline: none;
}
.hero-kicker {
  color: var(--muted);
  opacity: 1;
}
.hero-summary {
  color: var(--text);
}
.hero-title {
  color: var(--royal);
}
.hero-cta {
  background: var(--royal);
  color: #fff;
  font-weight: 600;
}
.hero-cta:hover {
  background: var(--royal-deep);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  .hero-title {
    color: var(--saffron);
  }
  .hero-cta {
    background: var(--saffron);
    color: #10244a;
  }
  .hero-cta:hover {
    background: #ffd47c;
    color: #10244a;
  }
}
@media (min-width: 52rem) {
  .hero-body {
    margin-inline-start: 0;
  }
}

/* الصور والبطاقات والصناديق: خط رفيع واحد */
.card-media,
.banner,
.gallery a,
.entry-lead .zoom,
.card-text,
.record,
.notes,
.flash,
.avatar {
  border: 1px solid var(--line);
  outline: none;
}
.card-big {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.4rem;
}
.notes {
  margin-top: 2.5rem;
  padding: 1rem 1.15rem 0.5rem;
}
.notes h2 {
  position: static;
  transform: none;
  margin: 0 0 0.25rem;
  padding: 0;
  background: none;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--royal);
}
@media (prefers-color-scheme: dark) {
  .notes h2 {
    color: var(--saffron);
  }
}
.notes-lead {
  border-bottom: 0;
  padding-bottom: 0;
}
span.avatar {
  background: var(--royal);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 2.2rem;
}

/* الحقول والأزرار */
input[type='search'],
input[type='number'],
select,
.report-form textarea,
.report-form input[type='text'] {
  border: 1px solid var(--muted);
}
button[type='submit'] {
  border: 0;
  background: var(--royal);
  color: #fff;
  font-weight: 600;
}
.pill,
.chips a,
.pager a {
  border: 1px solid var(--line);
}
@media (prefers-color-scheme: dark) {
  button[type='submit'] {
    background: var(--saffron);
    color: #10244a;
  }
}

/* استمع / شاهد: فيديوات يوتيوب بصفحة المادة */
.video-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
}
.video {
  margin: 0;
}
.video-play,
.video-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: #000;
}
.video-play {
  position: relative;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}
.video-play img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.video-icon {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 3.5rem;
  height: 3.5rem;
  margin: -1.75rem 0 0 -1.75rem;
  background: var(--royal);
}
.video-icon::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 50%;
  margin: -0.7rem 0 0 -0.4rem;
  border-style: solid;
  border-width: 0.7rem 0 0.7rem 1.1rem;
  border-color: transparent transparent transparent #fff;
}
.video-play:hover .video-icon,
.video-play:focus-visible .video-icon {
  background: var(--saffron);
}
.video figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-top: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.video-title {
  font-weight: 600;
}
.video-meta,
.video-note {
  color: var(--muted);
  font-size: 0.85rem;
}
.video-note {
  margin-top: 1rem;
  font-family: var(--font-ui);
}
@media (prefers-color-scheme: dark) {
  .video-icon {
    background: var(--saffron);
  }
  .video-icon::after {
    border-left-color: #10244a;
  }
  .video-play:hover .video-icon,
  .video-play:focus-visible .video-icon {
    background: var(--royal);
  }
}

/* رابط الموقع الشقيق «دليل رافدين»: سطر نصي عادي */
.sister-link {
  margin-top: 2rem;
  color: var(--muted);
}
