:root {
  --bg: #f1ede6;
  --surface: rgba(255, 252, 247, 0.95);
  --surface-alt: #faf7f2;
  --text: #2f261f;
  --muted: #6f6154;
  --accent: #8f5a36;
  --accent-hover: #7a4c2d;
  --accent-light: rgba(143, 90, 54, 0.1);
  --border: rgba(83, 58, 41, 0.15);
  --shadow: 0 24px 60px rgba(60, 41, 28, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.8), transparent 45%),
    linear-gradient(180deg, #f8f4ee 0%, var(--bg) 100%);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.7;
}

html[lang="ar"] body {
  font-family: "Noto Naskh Arabic", "Amiri", "Segoe UI", Tahoma, serif;
}

.page-wrap {
  width: min(980px, 100%);
  margin-inline: auto;
  padding: 28px 16px 60px;
}

.site-header {
  display: grid;
  gap: 16px;
  margin-block-end: 18px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.72);
  box-shadow: 0 12px 28px rgba(60, 41, 28, 0.08);
  backdrop-filter: blur(10px);
}

.site-header-banner {
  display: block;
  width: 100%;
  height: 20vh;
  min-height: 120px;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
}

.site-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.site-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex: 0 0 auto;
}

.site-brand-text {
  font-size: 1rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.site-nav a:hover {
  background: var(--accent-light);
  border-color: rgba(143, 90, 54, 0.28);
  transform: translateY(-1px);
}

.breadcrumbs {
  margin-block: 12px 18px;
  padding-inline: 4px;
}

.breadcrumbs-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.breadcrumbs-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.breadcrumbs-item:not(:last-child)::after {
  content: "/";
  color: rgba(111, 97, 84, 0.7);
}

.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.hero {
  text-align: center;
  margin-block-end: 18px;
}

.hero h1 {
  margin: 0 0 6px;
  color: var(--accent);
  letter-spacing: -0.01em;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 24px 28px;
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-block-end: 16px;
}

a {
  color: var(--accent);
  text-decoration-color: rgba(143, 90, 54, 0.4);
}

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

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.post-item {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
  padding: 12px 14px;
}

.post-item-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.post-item h2 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.post-item p {
  margin: 0;
}

.post-thumb-link {
  flex: 0 0 132px;
  width: 132px;
  text-decoration: none;
}

.post-thumb {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 92px;
  border: 1px solid var(--border);
  border-radius: 10px;
  object-fit: cover;
  object-position: center;
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
}

article h1 {
  margin-block: 0 12px;
  color: var(--accent);
  font-size: clamp(1.4rem, 3.5vw, 2rem);
}

article h2,
article h3 {
  color: var(--accent);
  margin-block: 22px 8px;
}

article p,
article ul,
article ol,
article blockquote,
article table {
  margin-block: 10px;
}

article img {
  max-width: 100%;
  height: auto;
}

article table {
  width: 100%;
  border-collapse: collapse;
}

article th,
article td {
  border: 1px solid var(--border);
  padding: 8px;
  text-align: start;
}

article blockquote {
  margin-inline: 0;
  border-inline-start: 4px solid var(--accent);
  padding-inline: 12px;
  color: var(--muted);
}

.glossary-figure {
  margin: 14px 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
  padding: 10px;
}

.glossary-figure img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.glossary-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.video-embed {
  margin: 16px 0 22px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-alt);
  padding: 12px;
}

.video-embed-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
}

.video-embed-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-embed figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.94rem;
}

html[dir="rtl"] .card,
html[dir="rtl"] article,
html[dir="rtl"] .post-item {
  text-align: start;
}

html[dir="rtl"] .post-item {
  direction: ltr;
}

html[dir="rtl"] .post-item-copy {
  direction: rtl;
}

@media (max-width: 640px) {
  .site-header {
    padding: 12px 14px;
  }

  .site-header-banner {
    min-height: 96px;
  }

  .breadcrumbs {
    margin-block: 10px 14px;
  }

  .card {
    padding: 18px 16px;
  }

  .post-item {
    align-items: flex-start;
  }

  .post-thumb-link {
    flex-basis: 108px;
    width: 108px;
  }

  .page-wrap {
    padding: 18px 12px 40px;
  }
}
