/* ============================================================
   موسوعة تاريخ الخيل في الحضارات الإنسانية — تنسيقات النموذج
   ============================================================ */

:root {
  --bg: #faf5ec;
  --bg-soft: #f1e8d6;
  --paper: #fffaf1;
  --ink: #221610;
  --ink-soft: #5a463a;
  --ink-mute: #836b58;
  --line: #d9c8aa;
  --line-soft: #e9dcc4;

  --primary: #6b3410;
  --primary-deep: #3e1d08;
  --gold: #b9874a;
  --gold-soft: #d9b378;
  --olive: #6e6a3a;
  --bronze: #8a5a2b;

  --shadow-sm: 0 1px 2px rgba(46, 24, 8, .08);
  --shadow-md: 0 8px 22px -10px rgba(46, 24, 8, .25);
  --shadow-lg: 0 22px 50px -20px rgba(46, 24, 8, .35);

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

  --container: 1180px;
  --header-h: 76px;

  --font-display: "Amiri", "Tajawal", serif;
  --font-body: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(circle at 10% 0%, rgba(185, 135, 74, .08), transparent 40%),
    radial-gradient(circle at 90% 100%, rgba(107, 52, 16, .07), transparent 40%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.btn-primary {
  background: var(--primary);
  color: #fff8e8;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover { background: var(--primary-deep); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: #fff8e8;
  border-color: rgba(255, 248, 232, .55);
}
.btn-ghost:hover { background: rgba(255, 248, 232, .12); }

/* ===================== Header ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 250, 241, .92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
  transition: box-shadow .2s ease, background .2s ease;
}
.site-header.is-scrolled { box-shadow: var(--shadow-md); }

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary-deep);
}
.logo-mark {
  width: 44px; height: 44px;
  display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--gold) 0%, var(--primary) 100%);
  color: #fff8e8;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .2px;
}
.logo-sub {
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 2px;
}

.main-nav ul {
  display: flex; gap: 6px; list-style: none; padding: 0; margin: 0;
}
.main-nav a {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-soft);
  transition: background .18s ease, color .18s ease;
}
.main-nav a:hover { background: var(--bg-soft); color: var(--ink); }

.search-toggle, .menu-toggle {
  background: var(--bg-soft);
  border: 1px solid var(--line-soft);
  color: var(--ink);
  width: 42px; height: 42px;
  border-radius: 50%;
  display: inline-grid; place-items: center;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.search-toggle:hover { background: var(--gold-soft); }
.menu-toggle { display: none; flex-direction: column; gap: 4px; }
.menu-toggle span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ===================== Hero ===================== */
.hero {
  position: relative;
  isolation: isolate;
  padding: 90px 0 110px;
  overflow: hidden;
  color: #fff8e8;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse at 20% 30%, #6b3410 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, #2b1a0c 0%, transparent 50%),
    linear-gradient(180deg, #3e1d08 0%, #1f0d04 100%);
}
.hero-bg::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 235, 200, .05) 0 2px, transparent 2px 14px),
    radial-gradient(circle at 50% 50%, transparent 0, rgba(0,0,0,.35) 80%);
  mix-blend-mode: overlay;
}
.hero-overlay {
  position: absolute; inset: 0; z-index: -1;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 400'><g fill='none' stroke='%23fff' stroke-opacity='.06' stroke-width='1'><path d='M0 320 Q150 280 300 320 T 600 320'/><path d='M0 340 Q150 300 300 340 T 600 340'/><path d='M0 360 Q150 320 300 360 T 600 360'/></g><g fill='%23fff' fill-opacity='.04'><circle cx='80' cy='80' r='1.5'/><circle cx='180' cy='40' r='1.2'/><circle cx='280' cy='100' r='1'/><circle cx='420' cy='60' r='1.3'/><circle cx='520' cy='110' r='1.5'/></g></svg>") center/cover no-repeat;
  opacity: .9;
}

.hero-inner { position: relative; text-align: center; max-width: 900px; }
.hero-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(255, 248, 232, .35);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--gold-soft);
  margin-bottom: 26px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 24px;
}
.hero-title span { color: var(--gold-soft); }

.hero-desc {
  font-size: clamp(15px, 1.5vw, 18px);
  color: rgba(255, 248, 232, .85);
  max-width: 680px;
  margin: 0 auto 36px;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 250, 241, .96);
  border-radius: 999px;
  padding: 6px 6px 6px 8px;
  max-width: 640px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}
.search-icon {
  width: 44px; height: 44px;
  display: inline-grid; place-items: center;
  color: var(--ink-mute);
}
.hero-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  padding: 12px 4px;
  outline: none;
}
.hero-search input::placeholder { color: var(--ink-mute); }
.hero-search button {
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: #fff8e8;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 26px;
  border-radius: 999px;
  transition: background .18s ease;
}
.hero-search button:hover { background: var(--primary-deep); }

.hero-tags {
  margin-top: 22px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.tag {
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 248, 232, .08);
  border: 1px solid rgba(255, 248, 232, .2);
  color: #fff8e8;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.tag:hover {
  background: rgba(255, 248, 232, .18);
  border-color: rgba(255, 248, 232, .4);
  transform: translateY(-1px);
}

/* ===================== Section heads ===================== */
.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 40px);
  margin: 0 0 12px;
  color: var(--primary-deep);
  position: relative;
  display: inline-block;
}
.section-head h2::after {
  content: "";
  display: block;
  width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--primary));
  margin: 14px auto 0;
  border-radius: 999px;
}
.section-head p {
  color: var(--ink-soft);
  margin: 0;
  font-size: 16px;
}
.section-head-light h2 { color: #fff8e8; }
.section-head-light p { color: rgba(255, 248, 232, .8); }

/* ===================== Daily fact ===================== */
.daily-fact {
  margin-top: -50px;
  position: relative;
  z-index: 2;
  padding-bottom: 40px;
}
.fact-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  gap: 24px;
  position: relative;
  overflow: hidden;
}
.fact-card::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 6px;
  background: linear-gradient(180deg, var(--gold), var(--primary));
}
.fact-icon {
  flex-shrink: 0;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: var(--primary-deep);
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.fact-body { flex: 1; }
.fact-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
  background: var(--bg-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.fact-text {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.85;
  margin: 0 0 14px;
  color: var(--ink);
}
.fact-link {
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
}
.fact-link:hover { color: var(--primary-deep); }

/* ===================== Portals ===================== */
.portals { padding: 80px 0; }
.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.portal-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 28px 26px 24px;
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.portal-card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  width: 110px; height: 110px;
  background: radial-gradient(circle at center, rgba(185, 135, 74, .18), transparent 70%);
  transform: translate(40%, -40%);
  transition: transform .35s ease;
}
.portal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold-soft);
}
.portal-card:hover::before { transform: translate(20%, -20%); }
.portal-num {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--gold);
  font-weight: 700;
  display: block;
  margin-bottom: 12px;
}
.portal-card h3 {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0 0 8px;
  color: var(--primary-deep);
}
.portal-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}
.portal-arrow {
  position: absolute;
  inset-block-end: 18px;
  inset-inline-end: 24px;
  font-size: 22px;
  color: var(--primary);
  transition: transform .25s ease;
}
.portal-card:hover .portal-arrow { transform: translateX(6px); }

/* ===================== Featured ===================== */
.featured {
  padding: 80px 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  border-block: 1px solid var(--line-soft);
}
.featured-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}
.featured-text { max-width: 640px; }
.featured-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
  background: var(--paper);
  border: 1px solid var(--gold-soft);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.featured-text h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.6vw, 44px);
  color: var(--primary-deep);
  margin: 0 0 20px;
  line-height: 1.3;
}
.featured-lead {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 26px;
}
.featured-meta {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}
.featured-meta li {
  display: flex;
  flex-direction: column;
  border-inline-start: 3px solid var(--gold);
  padding-inline-start: 12px;
}
.featured-meta span {
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: .5px;
}
.featured-meta strong {
  font-size: 15px;
  color: var(--ink);
}

.featured-visual { position: relative; }
.featured-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 420px;
  margin: 0 auto;
}
.featured-art {
  position: relative;
  z-index: 2;
  background: radial-gradient(circle at 35% 30%, #fff5e2, #c08d52 70%, #3e1d08 100%);
  border-radius: 50%;
  width: 100%; height: 100%;
  box-shadow: var(--shadow-lg);
  border: 8px solid var(--paper);
  overflow: hidden;
}
.featured-frame-decor {
  position: absolute;
  inset: -18px;
  border: 1px dashed var(--gold);
  border-radius: 50%;
  opacity: .5;
  animation: rotate 60s linear infinite;
}
@keyframes rotate { to { transform: rotate(360deg); } }

/* ===================== Timeline ===================== */
.timeline {
  position: relative;
  padding: 90px 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(185, 135, 74, .2), transparent 50%),
    linear-gradient(180deg, #2b1a0c 0%, #1f0d04 100%);
  color: #fff8e8;
}
.timeline-track {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  position: relative;
}
.timeline-track::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 22px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .55;
}
.timeline-track li {
  position: relative;
  padding-top: 50px;
  text-align: center;
  padding-inline: 6px;
}
.timeline-dot {
  position: absolute;
  top: 14px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(185, 135, 74, .25), 0 0 0 10px rgba(185, 135, 74, .12);
}
.timeline-era {
  font-size: 12px;
  letter-spacing: .5px;
  color: var(--gold-soft);
  font-weight: 700;
  display: block;
  margin-bottom: 8px;
}
.timeline-track h4 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 8px;
  color: #fff8e8;
}
.timeline-track p {
  font-size: 13px;
  color: rgba(255, 248, 232, .7);
  margin: 0;
  line-height: 1.65;
}

/* ===================== Characters ===================== */
.characters { padding: 90px 0; }
.character-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}
.character-card {
  background: var(--paper);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  transition: transform .25s ease, box-shadow .25s ease;
}
.character-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.character-thumb {
  height: 160px;
  display: grid;
  place-items: center;
  position: relative;
  background: linear-gradient(135deg, #b9874a, #6b3410);
  color: rgba(255, 250, 241, .9);
  font-family: var(--font-display);
}
.character-thumb[data-tone="sand"]   { background: linear-gradient(135deg, #d9b378, #8a5a2b); }
.character-thumb[data-tone="gold"]   { background: linear-gradient(135deg, #e5c46b, #a37322); }
.character-thumb[data-tone="olive"]  { background: linear-gradient(135deg, #8b8a4d, #4d4a1c); }
.character-thumb[data-tone="bronze"] { background: linear-gradient(135deg, #b08056, #5b3416); }
.character-thumb::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .18), transparent 50%),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, .05) 0 6px, transparent 6px 16px);
}
.character-mono {
  position: relative;
  z-index: 1;
  font-size: 72px;
  font-weight: 700;
  text-shadow: 0 4px 18px rgba(0, 0, 0, .35);
}
.character-body { padding: 20px 22px 24px; }
.character-kind {
  font-size: 12px;
  letter-spacing: .5px;
  color: var(--gold);
  font-weight: 700;
  display: block;
  margin-bottom: 6px;
}
.character-card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--primary-deep);
}
.character-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

/* ===================== Articles ===================== */
.articles {
  padding: 80px 0;
  background: var(--bg-soft);
  border-block: 1px solid var(--line-soft);
}
.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.article-list a {
  display: block;
  background: var(--paper);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  border: 1px solid var(--line-soft);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  height: 100%;
}
.article-list a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold-soft);
}
.article-cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.article-list h4 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 8px;
  color: var(--primary-deep);
}
.article-list p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ===================== CTA ===================== */
.cta {
  padding: 90px 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(217, 179, 120, .25), transparent 50%),
    linear-gradient(135deg, var(--primary-deep) 0%, #6b3410 100%);
  color: #fff8e8;
  text-align: center;
}
.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 42px);
  margin: 0 0 14px;
  color: #fff8e8;
}
.cta p {
  margin: 0 auto 28px;
  max-width: 540px;
  color: rgba(255, 248, 232, .85);
}
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ===================== Footer ===================== */
.site-footer {
  background: #1f0d04;
  color: rgba(255, 248, 232, .8);
  padding-top: 50px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
}
.footer-brand .logo-title { color: #fff8e8; font-size: 22px; }
.footer-brand p { margin-top: 10px; color: rgba(255, 248, 232, .65); font-size: 14px; max-width: 380px; }
.footer-cols h5 {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--gold-soft);
  margin: 0 0 14px;
}
.footer-cols ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.footer-cols a {
  font-size: 14px;
  color: rgba(255, 248, 232, .7);
  transition: color .18s ease;
}
.footer-cols a:hover { color: var(--gold-soft); }
.footer-bottom {
  border-top: 1px solid rgba(255, 248, 232, .1);
  padding: 18px 0;
  font-size: 13px;
  color: rgba(255, 248, 232, .55);
}
.footer-bottom p { margin: 0; text-align: center; }

/* ===================== Responsive ===================== */
@media (max-width: 960px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }

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

  .featured-inner { grid-template-columns: 1fr; gap: 40px; }
  .featured-visual { order: -1; }
  .featured-frame { max-width: 320px; }

  .timeline-track { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .timeline-track::before { display: none; }
  .timeline-track li { padding-top: 36px; text-align: start; }
  .timeline-dot { inset-inline-start: 0; transform: none; top: 6px; }

  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .header-inner { gap: 12px; }
  .logo-sub { display: none; }
  .logo-title { font-size: 16px; }
  .logo-mark { width: 38px; height: 38px; }

  .hero { padding: 60px 0 80px; }
  .hero-search { flex-direction: column; border-radius: var(--radius-lg); padding: 14px; }
  .hero-search input { width: 100%; text-align: center; padding: 10px; }
  .hero-search button { width: 100%; }
  .search-icon { display: none; }

  .fact-card { flex-direction: column; padding: 24px; }

  .portal-grid { grid-template-columns: 1fr; }
  .character-grid { grid-template-columns: 1fr; }
  .article-list { grid-template-columns: 1fr; }

  .featured-meta { grid-template-columns: 1fr; }
  .timeline-track { grid-template-columns: 1fr; }

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