:root {
  --ink: #17221e;
  --muted: #66706a;
  --paper: #f7f3e9;
  --cream: #fffdf7;
  --forest: #153d32;
  --forest-dark: #0e2b24;
  --gold: #bd8739;
  --line: rgba(23, 34, 30, .14);
  --serif: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", Georgia, serif;
  --sans: Tahoma, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--sans); }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; }
button, input, select { font: inherit; }
.skip-link { background: var(--gold); color: white; padding: 10px 16px; position: fixed; right: 10px; top: -60px; z-index: 100; }
.skip-link:focus { top: 10px; }

.site-header { background: rgba(255,253,247,.97); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { align-items: center; display: flex; height: 84px; justify-content: space-between; margin: auto; max-width: 1500px; padding: 0 max(4vw,24px); }
.brand { align-items: center; display: flex; gap: 12px; }
.brand-mark { align-items: center; display: flex; flex: 0 0 auto; height: 54px; justify-content: center; width: 72px; }
.brand-mark img { display: block; height: 100%; object-fit: contain; width: 100%; }
.brand strong { display: block; font-family: var(--serif); font-size: 20px; line-height: 1.2; }
.brand small { color: var(--muted); display: block; font-size: 10px; margin-top: 3px; }
.main-nav { align-items: stretch; display: flex; height: 100%; }
.nav-item { align-items: center; display: flex; position: relative; }
.nav-item > a, .nav-item > button { align-items: center; background: none; border: 0; cursor: pointer; display: flex; font-size: 12px; font-weight: 700; gap: 6px; height: 100%; padding: 0 17px; }
.nav-item:hover > a, .nav-item:hover > button, .nav-item:focus-within > button { color: #8e6128; }
.submenu { background: var(--cream); border: 1px solid var(--line); box-shadow: 0 18px 45px rgba(23,34,30,.12); display: none; min-width: 255px; padding: 9px; position: absolute; right: 0; top: 72px; }
.nav-item:hover .submenu, .nav-item:focus-within .submenu, .nav-item.open .submenu { display: block; }
.submenu a { border-bottom: 1px solid var(--line); display: block; font-family: var(--serif); font-size: 15px; padding: 11px 12px; }
.submenu a:last-child { border: 0; }
.submenu a:hover { background: var(--paper); color: #8e6128; }
.menu-toggle { background: transparent; border: 1px solid var(--line); border-radius: 4px; display: none; padding: 8px 11px; }

.hero { background: var(--paper); overflow: hidden; position: relative; }
.hero::before { background-image: linear-gradient(rgba(21,61,50,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(21,61,50,.04) 1px,transparent 1px); background-size: 38px 38px; content: ""; inset: 0; position: absolute; }
.hero-inner { align-items: center; display: grid; gap: 75px; grid-template-columns: 1.25fr .75fr; margin: auto; max-width: 1450px; min-height: 650px; padding: 75px max(6vw,34px); position: relative; z-index: 2; }
.eyebrow, .kicker { color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .05em; margin: 0 0 17px; }
.hero h1 { font-family: var(--serif); font-size: clamp(52px,6.4vw,88px); letter-spacing: -.035em; line-height: 1.02; margin: 0; }
.hero h1 em { color: var(--gold); font-style: normal; }
.hero-lead { color: #4c5852; font-family: var(--serif); font-size: 22px; line-height: 1.75; margin: 30px 0; max-width: 730px; }
.hero-dedication { background: rgba(185, 126, 42, .08); border-inline-start: 3px solid var(--accent); color: #8a5b1e; display: inline-block; font-family: var(--serif); font-size: 21px; font-weight: 700; line-height: 1.8; margin: 0 0 28px; padding: 8px 18px; }
.button { align-items: center; background: var(--forest); border: 0; border-radius: 3px; color: white; display: inline-flex; font-size: 12px; font-weight: 800; gap: 22px; padding: 15px 22px; }
.button:hover { background: var(--forest-dark); }
.button.secondary { background: transparent; border: 1px solid var(--forest); color: var(--forest); }
.hero-stats { border-top: 1px solid var(--line); display: flex; margin: 45px 0 0; padding-top: 22px; }
.hero-stats div { border-left: 1px solid var(--line); min-width: 135px; padding: 0 22px; }
.hero-stats div:first-child { padding-right: 0; }
.hero-stats div:last-child { border: 0; }
.hero-stats b { color: var(--forest); display: block; font-family: var(--serif); font-size: 29px; }
.hero-stats span { color: var(--muted); font-size: 10px; }
.hero-portrait { justify-self: center; max-width: 350px; position: relative; }
.hero-portrait img { border: 12px solid rgba(255,255,255,.75); border-radius: 49% 49% 5px 5px; box-shadow: 0 28px 70px rgba(23,34,30,.19); display: block; filter: sepia(.12); min-height: 400px; object-fit: cover; width: 100%; }
.portrait-note { background: var(--forest); bottom: 30px; color: white; left: -30px; padding: 15px 18px; position: absolute; width: 235px; }
.portrait-note strong { display: block; font-family: var(--serif); font-size: 18px; }
.portrait-note small { color: #c7d4ce; font-size: 9px; }

.page-hero { background: var(--forest); color: white; padding: 70px max(6vw,28px); }
.page-hero-inner { margin: auto; max-width: 1280px; }
.breadcrumbs { color: #b8c8c0; font-size: 10px; margin-bottom: 24px; }
.breadcrumbs a { color: #efd49b; }
.page-hero h1 { font-family: var(--serif); font-size: clamp(42px,5vw,67px); line-height: 1.15; margin: 0; max-width: 960px; }
.page-hero p { color: #c6d4ce; font-family: var(--serif); font-size: 17px; line-height: 1.8; margin: 18px 0 0; max-width: 780px; }
.page-meta { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 25px; }
.page-meta span { border: 1px solid rgba(255,255,255,.18); color: #e5eee9; font-size: 10px; padding: 8px 12px; }

.section { margin: auto; max-width: 1400px; padding: 90px max(5vw,28px); }
.section-head { align-items: end; display: flex; justify-content: space-between; margin-bottom: 38px; }
.section-head h2 { font-family: var(--serif); font-size: clamp(36px,4vw,54px); line-height: 1.05; margin: 0; }
.section-head p { color: var(--muted); font-family: var(--serif); font-size: 16px; line-height: 1.7; margin: 0; max-width: 470px; }
.collection-grid { display: grid; gap: 15px; grid-template-columns: repeat(4,1fr); }
.collection-card { background: #efe4cd; min-height: 300px; padding: 28px; position: relative; }
.collection-card:nth-child(2) { background: #dfe8de; }
.collection-card:nth-child(3) { background: #e1e9ec; }
.collection-card:nth-child(4) { background: #eee1df; }
.collection-card small { border-bottom: 1px solid currentColor; display: inline-block; font-size: 10px; opacity: .65; padding-bottom: 6px; }
.collection-card h3 { font-family: var(--serif); font-size: 27px; line-height: 1.25; margin: 38px 0 12px; }
.collection-card p { font-family: var(--serif); font-size: 15px; line-height: 1.7; margin: 0; opacity: .75; }
.collection-card b { bottom: 25px; font-size: 11px; position: absolute; right: 28px; }
.blog-grid { display: grid; gap: 16px; grid-template-columns: repeat(3,1fr); }
.blog-card { background: white; border: 1px solid var(--line); display: flex; flex-direction: column; min-height: 225px; padding: 24px; }
.blog-card small { color: var(--gold); font-size: 9px; font-weight: 800; }
.blog-card h3 { font-family: var(--serif); font-size: 24px; line-height: 1.35; margin: 14px 0 9px; }
.blog-card p { color: var(--muted); font-family: var(--serif); font-size: 14px; line-height: 1.7; margin: 0; }
.blog-card footer { align-items: center; background: none; color: var(--ink); display: flex; font-size: 10px; justify-content: space-between; margin-top: auto; padding: 24px 0 0; }

.archive-tools { align-items: center; background: var(--paper); border: 1px solid var(--line); display: flex; gap: 14px; margin-bottom: 24px; padding: 16px; }
.archive-tools input, .archive-tools select { background: white; border: 1px solid var(--line); min-height: 44px; outline: none; padding: 0 14px; }
.archive-tools input { flex: 1; }
.post-list { display: grid; gap: 14px; grid-template-columns: repeat(3,1fr); }
.post-card { background: white; border: 1px solid var(--line); overflow: hidden; }
.post-card:hover { box-shadow: 0 14px 35px rgba(23,34,30,.09); transform: translateY(-2px); }
.post-card-image { background: #d8dfda; height: 180px; overflow: hidden; }
.post-card-image img { height: 100%; object-fit: cover; width: 100%; }
.post-card-body { min-height: 220px; padding: 20px; position: relative; }
.post-card time { color: var(--gold); font-size: 9px; font-weight: 800; }
.post-card h2, .post-card h3 { font-family: var(--serif); font-size: 22px; line-height: 1.4; margin: 9px 0; }
.post-card p { color: var(--muted); display: -webkit-box; font-family: var(--serif); font-size: 13px; line-height: 1.75; margin: 0; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.post-card .read { bottom: 17px; color: var(--forest); font-size: 10px; font-weight: 800; position: absolute; right: 20px; }
.pagination { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 40px; }
.pagination a, .pagination span { border: 1px solid var(--line); min-width: 39px; padding: 9px 11px; text-align: center; }
.pagination .current { background: var(--forest); color: white; }

.article-shell { align-items: start; display: grid; gap: 45px; grid-template-columns: minmax(0,1fr) 260px; margin: auto; max-width: 1260px; padding: 55px max(4vw,20px) 95px; }
.article-paper { background: white; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(23,34,30,.08); padding: clamp(30px,6vw,78px); }
.article-title { font-family: var(--serif); font-size: clamp(39px,5vw,62px); line-height: 1.3; margin: 0 0 22px; }
.article-byline { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); color: var(--muted); display: flex; flex-wrap: wrap; font-size: 10px; gap: 18px; justify-content: space-between; margin-bottom: 38px; padding: 12px 0; }
.article-content { color: #28322e; font-family: var(--serif); font-size: 18px; line-height: 2; overflow-wrap: anywhere; }
.article-content img { display: block; height: auto !important; margin: 25px auto; max-width: 100% !important; }
.article-content table { border-collapse: collapse; display: block; max-width: 100%; overflow-x: auto; }
.article-content td, .article-content th { border: 1px solid var(--line); padding: 7px; }
.article-content a { color: #83571f; text-decoration: underline; }
.article-content iframe, .article-content object, .article-content embed { max-width: 100%; }
.article-source { background: var(--paper); border-right: 3px solid var(--gold); margin-top: 55px; padding: 24px; }
.article-source h2 { font-family: var(--serif); font-size: 20px; margin: 0 0 7px; }
.article-source p { color: var(--muted); font-family: var(--serif); font-size: 14px; line-height: 1.8; }
.article-source a { color: var(--forest); font-size: 11px; font-weight: 800; text-decoration: underline; }
.article-nav { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 25px; }
.article-nav a { border: 1px solid var(--line); font-family: var(--serif); font-size: 14px; line-height: 1.5; padding: 15px; }
.article-aside { position: sticky; top: 110px; }
.aside-card { background: var(--forest); color: white; margin-bottom: 15px; padding: 22px; }
.aside-card h2 { font-family: var(--serif); font-size: 20px; margin: 0 0 13px; }
.aside-card p, .aside-card li { color: #c7d5cf; font-family: var(--serif); font-size: 13px; line-height: 1.7; }
.aside-card ul { list-style: none; margin: 0; padding: 0; }
.aside-card li { border-bottom: 1px solid rgba(255,255,255,.13); padding: 8px 0; }
.offline-note { background: #f1eadb; border: 1px dashed #bfa574; color: #6a5938; font-family: var(--serif); font-size: 13px; line-height: 1.7; margin: 15px 0; padding: 15px; }
.offline-embed { background: #f1eadb; border: 1px dashed #bfa574; display: block; margin: 15px 0; min-height: 58px; padding: 15px; text-decoration: none !important; }
.offline-embed::before { color: #6a5938; content: "عنصر مضمّن محفوظ ضمن سجل الأرشيف المحلي"; font-family: var(--serif); font-size: 13px; }

.search-panel { background: var(--paper); border: 1px solid var(--line); padding: 24px; }
.search-panel input { background: white; border: 1px solid var(--line); font-family: var(--serif); font-size: 18px; min-height: 54px; outline: none; padding: 0 17px; width: 100%; }
.search-status { color: var(--muted); font-size: 11px; margin: 15px 0 25px; }
.search-results { display: grid; gap: 12px; }
.search-result { background: white; border: 1px solid var(--line); padding: 18px; }
.search-result small { color: var(--gold); font-size: 9px; }
.search-result h2 { font-family: var(--serif); font-size: 22px; margin: 8px 0; }
.search-result p { color: var(--muted); font-family: var(--serif); font-size: 13px; line-height: 1.7; margin: 0; }

.timeline { border-right: 2px solid #d3bd90; margin-right: 12px; padding-right: 35px; }
.timeline-year { margin-bottom: 30px; position: relative; }
.timeline-year::before { background: var(--gold); border: 5px solid var(--cream); border-radius: 50%; content: ""; height: 15px; position: absolute; right: -44px; top: 8px; width: 15px; }
.timeline-year h2 { font-family: var(--serif); font-size: 30px; margin: 0; }
.timeline-year p { color: var(--muted); font-size: 12px; }

.site-footer { background: var(--forest-dark); color: white; }
.footer-inner { display: grid; gap: 40px; grid-template-columns: 1.1fr 1fr 1fr; margin: auto; max-width: 1400px; padding: 55px max(5vw,28px); }
.site-footer h2 { font-family: var(--serif); font-size: 22px; margin: 0 0 13px; }
.site-footer p, .site-footer li { color: #aebfb7; font-family: var(--serif); font-size: 13px; line-height: 1.7; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer a:hover { color: #efd49b; }
.copyright { border-top: 1px solid rgba(255,255,255,.1); color: #8fa29a; font-size: 9px; padding: 15px max(5vw,28px); text-align: center; }

@media (max-width: 1050px) {
  .collection-grid { grid-template-columns: repeat(2,1fr); }
  .post-list, .blog-grid { grid-template-columns: repeat(2,1fr); }
  .article-shell { grid-template-columns: 1fr; }
  .article-aside { position: static; }
}

@media (max-width: 780px) {
  .header-inner { height: 70px; padding: 0 17px; }
  .brand-mark { height: 42px; width: 56px; }
  .brand strong { font-size: 15px; }
  .brand small { display: none; }
  .menu-toggle { display: block; }
  .main-nav { background: var(--cream); border-bottom: 1px solid var(--line); display: none; height: auto; left: 0; padding: 10px 18px; position: absolute; right: 0; top: 70px; }
  .main-nav.open { display: block; }
  .nav-item { display: block; }
  .nav-item > a, .nav-item > button { border-bottom: 1px solid var(--line); height: auto; padding: 13px 4px; width: 100%; }
  .submenu { box-shadow: none; margin: 0 0 8px; position: static; }
  .hero-inner { display: block; min-height: auto; padding: 60px 21px; }
  .hero h1 { font-size: 52px; }
  .hero-lead { font-size: 18px; }
  .hero-dedication { font-size: 17px; }
  .hero-stats div { min-width: 0; padding: 0 10px; }
  .hero-stats b { font-size: 23px; }
  .hero-portrait { margin: 55px auto 0; width: 270px; }
  .hero-portrait img { min-height: 335px; }
  .portrait-note { left: -12px; }
  .section { padding: 68px 19px; }
  .section-head { align-items: start; flex-direction: column; gap: 16px; }
  .collection-grid, .post-list, .blog-grid { grid-template-columns: 1fr; }
  .archive-tools { align-items: stretch; flex-direction: column; }
  .article-paper { padding: 38px 19px; }
  .article-content { font-size: 17px; }
  .article-nav { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media print {
  .site-header, .site-footer, .article-aside, .article-nav { display: none !important; }
  body { background: white; }
  .article-shell { display: block; padding: 0; }
  .article-paper { border: 0; box-shadow: none; padding: 0; }
}
