/* ==========================================================================
   اتحاد حزب المصحصحين — نظام التصميم
   لوحة الألوان مشتقّة من صورة الموقع: أسود فحمي + أصفر ذهبي + ورقي فاتح
   ========================================================================== */

/* ---------- 1. الرموز (Tokens) ---------- */
:root {
  --ink: #080808;
  --ink-2: #111111;
  --forest: #1b1600;
  --forest-2: #272000;
  --emerald: #5a4700;
  --emerald-soft: #866500;
  --emerald-glow: #c18e00;
  --gold: #ffc400;
  --gold-light: #ffe45e;
  --gold-deep: #9a6a00;
  --parchment: #fff6d2;
  --paper: #fffdf4;
  --muted: #bcaf89;
  --muted-2: #8a7b54;
  --line: rgba(255, 196, 0, 0.22);
  --line-soft: rgba(255, 196, 0, 0.12);
  --danger: #d9534f;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --glow-gold: 0 0 0 1px rgba(255, 196, 0, 0.28), 0 12px 40px rgba(255, 196, 0, 0.12);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --font-head: "Noto Kufi Arabic", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Noto Naskh Arabic", "Segoe UI", system-ui, sans-serif;

  --maxw: 1240px;
  --header-h: 92px;

  --pattern: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'><g fill='none' stroke='%23ffc400' stroke-opacity='0.075' stroke-width='1'><path d='M36 2 L70 36 L36 70 L2 36 Z'/><path d='M12.5 12.5 H59.5 V59.5 H12.5 Z'/><circle cx='36' cy='36' r='16'/></g></svg>");
}

/* ---------- 2. إعادة الضبط ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background-color: var(--ink);
  background-image: var(--pattern);
  background-attachment: fixed;
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.85;
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--gold-light);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--gold);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(255, 196, 0, 0.35);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 3. العناوين ---------- */
h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 0.5em;
  color: var(--parchment);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.75rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1em;
}

/* ---------- 4. الحاويات ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

.wrap-narrow {
  max-width: 820px;
}

.section {
  padding-block: 46px;
}

.section-tight {
  padding-block: 28px;
}

/* ---------- 5. الرأس (المارشح) ---------- */
.topbar {
  background: linear-gradient(90deg, var(--ink) 0%, var(--forest) 50%, var(--ink) 100%);
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.82rem;
  color: var(--muted);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 40px;
  flex-wrap: wrap;
}

.topbar-date {
  color: var(--muted);
}

.topbar-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.topbar-links a {
  color: var(--muted);
}

.topbar-links a:hover {
  color: var(--gold-light);
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(7, 19, 15, 0.92);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: var(--header-h);
  padding-block: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  color: inherit;
}

.brand:hover {
  color: inherit;
}

.brand-logo {
  width: 62px;
  height: 62px;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 18px rgba(255, 196, 0, 0.28));
  animation: brandIn 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  color: var(--parchment);
  letter-spacing: -0.2px;
}

.brand-sub {
  font-size: 0.74rem;
  color: var(--gold);
  letter-spacing: 2px;
  font-family: var(--font-head);
}

.masthead-spacer {
  flex: 1;
}

.masthead-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ---------- 6. التنقل ---------- */
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
}

.nav a {
  font-family: var(--font-head);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--parchment);
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.nav a:hover {
  background: rgba(255, 196, 0, 0.1);
  border-color: var(--line);
  color: var(--gold-light);
}

.nav a.is-active {
  background: linear-gradient(180deg, rgba(255, 196, 0, 0.22), rgba(255, 196, 0, 0.08));
  border-color: var(--line);
  color: var(--gold-light);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--gold-light);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gold-light);
  margin: 4px 0;
  border-radius: 2px;
  transition: transform 0.2s ease;
}

/* ---------- 7. الأزرار ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--parchment);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}

.btn:hover {
  background: rgba(255, 196, 0, 0.14);
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border-color: var(--gold-deep);
  color: #201703;
}

.btn-gold:hover {
  color: #201703;
  filter: brightness(1.07);
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--gold-light);
  cursor: pointer;
  transition: all 0.18s ease;
}

.icon-btn:hover {
  background: rgba(255, 196, 0, 0.16);
  border-color: var(--gold);
}

/* ---------- 8. شريط القيادة ---------- */
.leadership {
  background: linear-gradient(135deg, var(--forest-2) 0%, var(--ink-2) 55%, var(--forest) 100%);
  border-block: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.leadership::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--pattern);
  opacity: 0.7;
  pointer-events: none;
}

.leadership .wrap {
  position: relative;
  padding-block: 30px;
}

.leader-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.05fr) 1.6fr;
  gap: 26px;
  align-items: center;
}

.leader-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(255, 196, 0, 0.1), rgba(7, 19, 15, 0.5));
  box-shadow: var(--glow-gold);
  text-align: center;
}

.leader-label {
  font-size: 0.74rem;
  letter-spacing: 2px;
  color: var(--gold);
  font-family: var(--font-head);
  margin-bottom: 4px;
}

.leader-name {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--parchment);
  line-height: 1.3;
}

.leader-role {
  font-size: 0.88rem;
  color: var(--gold-light);
  margin-top: 2px;
}

.leader-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.leader-group-title {
  font-family: var(--font-head);
  font-size: 0.86rem;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.leader-group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--font-head);
  font-size: 0.9rem;
  color: var(--parchment);
  transition: all 0.18s ease;
}

.chip:hover {
  border-color: var(--gold);
  background: rgba(255, 196, 0, 0.13);
  color: var(--gold-light);
}

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.chip-sub {
  font-size: 0.74rem;
  color: var(--muted);
  font-family: var(--font-body);
}

/* ---------- 9. لافتة الترحيب ---------- */
.welcome {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-right: 4px solid var(--gold);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255, 196, 0, 0.08), rgba(255, 255, 255, 0.02));
  padding: 20px 24px;
  font-family: var(--font-head);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.9;
  color: var(--parchment);
}

/* ---------- 10. رؤوس الأقسام ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
}

.section-head::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: 0;
  width: 96px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
}

.section-head h2 {
  margin: 0;
}

.section-head .more {
  margin-inline-start: auto;
  font-size: 0.85rem;
  color: var(--gold);
  font-family: var(--font-head);
  white-space: nowrap;
}

.eyebrow {
  font-family: var(--font-head);
  font-size: 0.75rem;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
}

/* ---------- 11. شبكة المحتوى ---------- */
.grid {
  display: grid;
  gap: 22px;
}

.grid-lead {
  grid-template-columns: 1.35fr 1fr;
  align-items: start;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- 12. البطاقات ---------- */
.card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--line);
  box-shadow: var(--shadow-md);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--forest);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-media img {
  transform: scale(1.045);
}

.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.55;
  margin: 0;
}

.card-title a {
  color: var(--parchment);
}

.card-title a:hover {
  color: var(--gold-light);
}

.card-summary {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.8;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted-2);
  margin-top: auto;
  padding-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--gold-light);
  background: rgba(255, 196, 0, 0.1);
  white-space: nowrap;
}

.badge-kind {
  background: rgba(28, 115, 85, 0.25);
  border-color: rgba(43, 154, 116, 0.4);
  color: #a9e6cd;
}

/* الخبر الرئيسي */
.lead-card .card-media {
  aspect-ratio: 16 / 9;
}

.lead-card .card-title {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
}

.lead-card .card-summary {
  -webkit-line-clamp: 4;
  font-size: 1rem;
}

/* قائمة الأخبار الثانوية */
.mini-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mini {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
}

.mini:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.mini-thumb {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--forest);
}

.mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-title {
  font-family: var(--font-head);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.6;
  margin: 0 0 4px;
}

.mini-title a {
  color: var(--parchment);
}

.mini-title a:hover {
  color: var(--gold-light);
}

.mini-meta {
  font-size: 0.75rem;
  color: var(--muted-2);
}

/* ---------- 13. المقالات ---------- */
.article-card .card-media {
  aspect-ratio: 4 / 3;
}

.article-card .card-summary {
  -webkit-line-clamp: 4;
}

/* ---------- 14. صفحة الخبر/المقال ---------- */
.page-head {
  padding-block: 34px 10px;
}

.page-head h1 {
  margin-bottom: 10px;
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
  align-items: start;
}

.article-hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  margin-bottom: 24px;
  background: var(--forest);
}

.article-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.news-video-section {
  margin: 0 0 26px;
}

.news-video-section h2 {
  color: var(--gold-light);
  font-size: 1.2rem;
}

.news-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000;
  overflow: hidden;
}

iframe.news-video,
.news-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

video.news-video {
  object-fit: contain;
}

.article-body {
  font-size: 1.08rem;
  line-height: 2.05;
  color: #e8e2d4;
}

.article-body p {
  margin: 0 0 1.25em;
}

.article-body h2,
.article-body h3 {
  margin-top: 1.6em;
  color: var(--gold-light);
}

.article-body ul,
.article-body ol {
  padding-inline-start: 22px;
  margin-bottom: 1.25em;
}

.article-body li {
  margin-bottom: 0.5em;
}

.article-body blockquote {
  margin: 1.4em 0;
  padding: 14px 20px;
  border-right: 3px solid var(--gold);
  background: rgba(255, 196, 0, 0.07);
  border-radius: 10px;
  color: var(--parchment);
}

.article-body a {
  border-bottom: 1px dotted var(--gold);
}

.source-box {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  background: rgba(255, 196, 0, 0.06);
  font-size: 0.92rem;
}

.source-box strong {
  color: var(--gold-light);
  font-family: var(--font-head);
}

.side-box {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 255, 255, 0.025);
  margin-bottom: 22px;
}

.side-box h3 {
  font-size: 1rem;
  color: var(--gold-light);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

/* ---------- 15. الترقيم ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.pager a,
.pager span {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  font-family: var(--font-head);
  font-size: 0.88rem;
  color: var(--parchment);
  padding-inline: 10px;
}

.pager a:hover {
  border-color: var(--gold);
  background: rgba(255, 196, 0, 0.12);
}

.pager .is-current {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border-color: var(--gold-deep);
  color: #201703;
  font-weight: 700;
}

.pager .is-disabled {
  opacity: 0.35;
}

/* ---------- 16. البحث ---------- */
.searchbar {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 6px 8px 6px 16px;
  min-width: 210px;
  max-width: 300px;
}

.searchbar input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  font-size: 0.92rem;
  color: var(--parchment);
  min-width: 0;
}

.searchbar input::placeholder {
  color: var(--muted-2);
}

.search-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(560px, 92vw);
  max-height: 66vh;
  overflow-y: auto;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  z-index: 90;
  display: none;
}

.search-panel.is-open {
  display: block;
}

.search-hit {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.search-hit:last-child {
  border-bottom: 0;
}

.search-hit:hover {
  background: rgba(255, 196, 0, 0.1);
}

.search-hit b {
  display: block;
  font-family: var(--font-head);
  font-size: 0.95rem;
  color: var(--parchment);
  font-weight: 600;
  line-height: 1.6;
}

.search-hit small {
  color: var(--muted-2);
  font-size: 0.75rem;
}

.search-empty {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 22px;
}

.filter-row .searchbar {
  flex: 1;
  min-width: 260px;
}

/* ---------- 17. الفوتر ---------- */
.footer {
  margin-top: 60px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  padding-block: 40px 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 30px;
}

.footer h4 {
  font-family: var(--font-head);
  font-size: 0.95rem;
  color: var(--gold-light);
  margin-bottom: 14px;
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.9rem;
}

.footer ul a {
  color: var(--muted);
}

.footer ul a:hover {
  color: var(--gold-light);
}

.footer-bottom {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--muted-2);
}

/* ---------- 18. غلام (الدردشة) ---------- */
.chat-fab {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--gold-deep);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #201703;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.chat-fab:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.chat-fab .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #261b05;
  box-shadow: 0 0 0 3px rgba(11, 47, 36, 0.25);
}

.chat-panel {
  position: fixed;
  bottom: 22px;
  left: 22px;
  width: min(420px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 44px));
  z-index: 130;
  display: none;
  flex-direction: column;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.chat-panel.is-open {
  display: flex;
  animation: panelIn 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--forest-2), var(--ink-2));
  border-bottom: 1px solid var(--line);
}

.chat-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-weight: 800;
  color: #201703;
  font-size: 1.05rem;
}

.chat-head-text {
  flex: 1;
  line-height: 1.35;
}

.chat-head-text b {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--parchment);
  display: block;
}

.chat-head-text small {
  color: var(--emerald-glow);
  font-size: 0.76rem;
}

.chat-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
}

.chat-close:hover {
  color: var(--gold-light);
  background: rgba(255, 255, 255, 0.06);
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}

.msg {
  max-width: 88%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 0.93rem;
  line-height: 1.85;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg-bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-soft);
  border-bottom-right-radius: 5px;
  color: #e8e2d4;
}

.msg-user {
  align-self: flex-end;
  background: linear-gradient(180deg, rgba(28, 115, 85, 0.55), rgba(19, 86, 63, 0.55));
  border: 1px solid rgba(43, 154, 116, 0.35);
  border-bottom-left-radius: 5px;
  color: #f0fbf6;
}

.msg a {
  color: var(--gold-light);
  border-bottom: 1px dotted var(--gold);
  word-break: break-word;
}

.msg-sources {
  align-self: flex-start;
  max-width: 92%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  border-inline-start: 2px solid var(--gold);
  padding-inline-start: 10px;
}

.msg-sources span {
  color: var(--muted-2);
  font-family: var(--font-head);
  font-size: 0.74rem;
}

.msg-sources a {
  color: var(--gold-light);
}

.chat-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 5px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  border: 1px solid var(--line-soft);
}

.chat-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: bounce 1.3s infinite ease-in-out;
}

.chat-typing i:nth-child(2) {
  animation-delay: 0.16s;
}

.chat-typing i:nth-child(3) {
  animation-delay: 0.32s;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
}

.chat-form textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  padding: 11px 14px;
  outline: none;
  font-size: 0.92rem;
  line-height: 1.7;
}

.chat-form textarea:focus {
  border-color: var(--gold);
}

.chat-send {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--gold-deep);
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: #201703;
  cursor: pointer;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.chat-send[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 12px 10px;
}

.chat-quick button {
  font-size: 0.76rem;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.chat-quick button:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

/* ---------- 19. الأدمن ---------- */
.admin-shell {
  max-width: 980px;
  margin-inline: auto;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-family: var(--font-head);
  font-size: 0.86rem;
  color: var(--gold-light);
}

.field input,
.field textarea,
.field select {
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  padding: 11px 14px;
  outline: none;
  font-size: 0.95rem;
}

.field textarea {
  min-height: 220px;
  line-height: 1.9;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--gold);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.notice {
  border-radius: var(--radius);
  padding: 14px 18px;
  border: 1px solid var(--line);
  background: rgba(255, 196, 0, 0.08);
  font-size: 0.92rem;
}

.notice-error {
  border-color: rgba(217, 83, 79, 0.5);
  background: rgba(217, 83, 79, 0.12);
  color: #ffd9d7;
}

.notice-ok {
  border-color: rgba(43, 154, 116, 0.5);
  background: rgba(43, 154, 116, 0.12);
  color: #c9f4e4;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
}

.admin-table th {
  font-family: var(--font-head);
  color: var(--gold-light);
  font-size: 0.82rem;
}

/* ---------- 20. أدوات مساعدة ---------- */
.muted {
  color: var(--muted);
}

.small {
  font-size: 0.84rem;
}

.center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.mt-2 {
  margin-top: 14px;
}

.mt-3 {
  margin-top: 24px;
}

.mt-4 {
  margin-top: 36px;
}

.hr-gold {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin-block: 34px;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
}

.stat b {
  display: block;
  font-family: var(--font-head);
  font-size: 1.7rem;
  color: var(--gold-light);
  line-height: 1.2;
}

.stat span {
  font-size: 0.8rem;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state b {
  display: block;
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--parchment);
  margin-bottom: 8px;
}

.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;
}

/* ---------- 21. الحركة ---------- */
@keyframes brandIn {
  from {
    opacity: 0;
    transform: scale(0.82) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 22. الاستجابة ---------- */
@media (max-width: 1080px) {
  .grid-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .article-shell {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--ink-2);
    border-bottom: 1px solid var(--line);
    padding: 12px;
    gap: 4px;
    box-shadow: var(--shadow-md);
  }
  .nav.is-open {
    display: flex;
  }
  .nav a {
    border-radius: 10px;
  }
  .nav-toggle {
    display: block;
  }
  .masthead-inner {
    position: relative;
    flex-wrap: wrap;
  }
  .grid-lead,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .leader-grid {
    grid-template-columns: 1fr;
  }
  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15.8px;
  }
  .brand-logo {
    width: 50px;
    height: 50px;
  }
  .mini {
    grid-template-columns: 88px 1fr;
  }
  .row-2 {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .grid-4 {
    grid-template-columns: 1fr;
  }
  .chat-fab {
    bottom: 16px;
    left: 16px;
    padding: 11px 15px;
  }
  .chat-panel {
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    max-height: none;
  }
  .searchbar {
    min-width: 0;
    width: 100%;
  }
}


/* ---------- 23. نافذة الأدب والكتب والاستماع ---------- */
.literature-note {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  align-items: center;
  gap: clamp(18px, 4vw, 42px);
  padding: clamp(18px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(255, 196, 0, 0.1), rgba(25, 19, 7, 0.88));
  box-shadow: var(--shadow-md);
}
.literature-note img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--glow-gold);
}
.original-verse {
  margin: 10px 0;
  color: var(--parchment);
  font-family: var(--font-head);
  font-size: clamp(1rem, 2vw, 1.3rem);
  line-height: 2.1;
}
.literature-note small { color: var(--muted); }
.literature-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 196, 0, 0.08), rgba(16, 13, 8, 0.88));
}
.literature-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold-light);
  font-family: var(--font-head);
  font-size: 1.3rem;
}
.literature-card p, .literature-essay p { color: var(--muted); }
.literature-card .btn { margin-top: 8px; }
.literature-essay {
  max-width: 920px;
  padding: clamp(20px, 4vw, 38px);
  border-right: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(255, 196, 0, 0.045);
  line-height: 2.05;
}
.audio-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(230px, 0.8fr);
  gap: 24px;
  align-items: center;
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 196, 0, 0.045);
}
.audio-frame { overflow: hidden; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #000; }
.audio-frame iframe { width: 100%; height: 100%; border: 0; }
.audio-feature-copy h3 { margin-top: 8px; }
.audio-list { list-style: none; padding: 0; margin: 20px 0 0; border-top: 1px solid var(--line-soft); }
.audio-list li { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 15px 4px; border-bottom: 1px solid var(--line-soft); }
.audio-index { color: var(--gold); font-family: var(--font-head); font-weight: 700; }
.audio-list li div { display: grid; gap: 4px; }
.audio-list li small { color: var(--muted); }
.audio-open { white-space: nowrap; font-size: 0.88rem; }
@media (max-width: 700px) {
  .literature-note, .audio-feature { grid-template-columns: 1fr; }
  .literature-note img { width: min(180px, 55vw); justify-self: center; }
}

.audio-frame { position: relative; display: grid; place-items: center; }
.audio-poster-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.audio-play-button { position: relative; z-index: 1; padding: 14px 22px; border: 1px solid var(--gold-light); border-radius: 999px; background: rgba(16, 13, 8, 0.88); color: var(--gold-light); font: inherit; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-md); }
.audio-play-button:hover { background: var(--gold); color: var(--ink); }


/* ---------- 24. أصوات X والتضمينات الرسمية ---------- */
.voices-head { border-bottom-color: var(--line); }
.voices-section { overflow: hidden; }
.voices-note {
  margin-bottom: 20px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-right: 3px solid var(--gold);
  border-radius: var(--radius);
  background: rgba(255, 196, 0, 0.05);
  color: var(--muted);
}
.voices-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.voice-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 196, 0, 0.07), rgba(17, 17, 17, 0.96));
  box-shadow: var(--shadow-sm);
}
.voice-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.voice-card-head h2 { margin: 0; font-size: 1.05rem; }
.voice-handle { color: var(--gold-light); font-size: 0.9rem; }
.voice-live {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--font-head);
  font-weight: 900;
}
.voice-timeline {
  max-height: 620px;
  overflow-y: auto;
  background: #080808;
}
.voice-timeline .twitter-timeline {
  display: block;
  min-height: 240px;
  padding: 18px;
  color: var(--gold-light);
  text-align: center;
}
.voice-fallback { padding: 18px; color: var(--muted); }
@media (max-width: 1080px) {
  .voices-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .voices-grid { grid-template-columns: 1fr; }
  .voice-timeline { max-height: 560px; }
}


/* صور مرتبطة بالمادة: صورة القصة أولاً، ثم شعار الناشر فقط عند الحاجة */
.card-media--publisher,
.mini-thumb--publisher,
.article-hero--publisher {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(255, 196, 0, 0.14), transparent 64%), #111;
  border: 1px solid rgba(255, 196, 0, 0.22);
}

.card-media--publisher img {
  width: min(34%, 152px);
  height: auto;
  max-height: 72%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.card:hover .card-media--publisher img {
  transform: none;
}

.mini--no-image {
  grid-template-columns: 1fr;
}

.mini-thumb--publisher img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
  background: #fff;
}

.article-hero--publisher {
  position: relative;
  min-height: 260px;
  padding: 28px;
  border-radius: var(--radius);
}

.article-hero--publisher img {
  width: min(180px, 42%);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 18px;
  border-radius: 22px;
  background: #fff;
}

.image-origin {
  position: absolute;
  inset-inline-start: 14px;
  inset-block-end: 12px;
  color: var(--gold-light);
  font-size: 0.78rem;
  background: rgba(8, 8, 8, 0.82);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px 10px;
}

@media (max-width: 640px) {
  .article-hero--publisher {
    min-height: 190px;
  }
}


/* نتائج Google News داخل صفحة البحث */
.google-news-section {
  border-block: 1px solid var(--line-soft);
  background: rgba(255, 196, 0, 0.025);
}

.google-news-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.google-news-result {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
}

.google-news-result h3 {
  margin: 8px 0 5px;
  font-family: var(--font-head);
  font-size: 1.02rem;
  line-height: 1.7;
}

.google-news-result h3 a:hover,
.google-news-source:hover {
  color: var(--gold);
}

.google-news-result p {
  margin: 0 0 9px;
  color: var(--muted-2);
  font-size: 0.9rem;
  line-height: 1.8;
}

.google-news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted-2);
  font-size: 0.75rem;
}

.google-news-meta span:first-child {
  color: var(--gold);
}

.google-news-source {
  color: var(--gold-light);
  font-size: 0.82rem;
}

.search-section-label {
  padding: 7px 12px 4px;
  color: var(--gold);
  font-family: var(--font-head);
  font-size: 0.82rem;
}

.search-hit--all {
  color: var(--parchment);
  font-weight: 600;
}

.search-hit--google {
  color: var(--gold-light);
  border-top: 1px solid var(--line);
}

.search-hit--google small {
  display: block;
  margin-top: 3px;
}

@media (max-width: 640px) {
  .google-news-result {
    padding: 13px 14px;
  }

  .google-news-result h3 {
    font-size: 0.95rem;
  }
}
