@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600&display=swap');

/* ============================================================
   Variables
   ============================================================ */
:root {
  --bg:           #FAFAF8;
  --text:         #1C1917;
  --text-muted:   #78716C;
  --accent:       #C8993A;
  --accent-light: #F5EDD8;
  --border:       #E7E2DB;
  --max-width:    680px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  direction: rtl;
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Sans Arabic', 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.85;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Thin gold line at top — the signature element */
body::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #E8B96A, var(--accent));
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

/* ============================================================
   Header
   ============================================================ */
header {
  padding: 64px 0 36px;
}

.site-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-name {
  font-family: 'Amiri', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  transition: color 0.2s ease;
  display: inline-block;
}

.site-name:hover {
  color: var(--accent);
}

.site-tagline {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 0.03em;
}

nav {
  display: flex;
  gap: 28px;
  margin-top: 24px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

nav a {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 400;
  transition: color 0.2s ease;
  position: relative;
}

nav a:hover,
nav a.active {
  color: var(--text);
}

nav a.active::after {
  content: '';
  display: block;
  position: absolute;
  bottom: -4px;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* ============================================================
   Intro / Lead (homepage only)
   ============================================================ */
.intro {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.intro p {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.85;
  max-width: 540px;
}

/* ============================================================
   Posts List
   ============================================================ */
.section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 32px;
}

.posts-list {
  list-style: none;
}

.post-item {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
  transition: all 0.15s ease;
}

.post-item:first-child {
  padding-top: 0;
}

.post-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-tag {
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
}

.post-title {
  font-family: 'Amiri', serif;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.5;
}

.post-title a {
  color: var(--text);
  transition: color 0.2s ease;
}

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

.post-excerpt {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.8;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  transition: gap 0.2s ease;
}

.read-more:hover {
  gap: 10px;
}

/* ============================================================
   Single Post Page
   ============================================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 52px;
  margin-top: 12px;
  transition: color 0.2s ease, gap 0.2s ease;
}

.back-link:hover {
  color: var(--accent);
  gap: 12px;
}

.post-header {
  margin-bottom: 52px;
}

.post-header .post-meta {
  margin-bottom: 18px;
}

.post-header h1 {
  font-family: 'Amiri', serif;
  font-size: 2.5rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--text);
}

.post-divider {
  width: 36px;
  height: 2.5px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 24px;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.95;
}

.post-content p {
  margin-bottom: 1.6rem;
  color: var(--text);
}

.post-content h2 {
  font-family: 'Amiri', serif;
  font-size: 1.55rem;
  font-weight: 700;
  margin: 2.8rem 0 1.1rem;
  color: var(--text);
  line-height: 1.4;
}

.post-content h3 {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 0.8rem;
  color: var(--text);
}

.post-content blockquote {
  border-right: 3px solid var(--accent);
  padding: 4px 22px;
  margin: 2.2rem 0;
  font-family: 'Amiri', serif;
  font-size: 1.2rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.7;
}

.post-content ul,
.post-content ol {
  padding-right: 24px;
  margin-bottom: 1.6rem;
  color: var(--text);
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content strong {
  font-weight: 600;
  color: var(--text);
}

/* Post footer */
.post-footer {
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-footer-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.post-footer-link {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  transition: text-decoration 0.15s;
}

.post-footer-link:hover {
  text-decoration: underline;
}

/* ============================================================
   About Page
   ============================================================ */
.page-header {
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.page-header h1 {
  font-family: 'Amiri', serif;
  font-size: 2rem;
  font-weight: 700;
}

.about-content p {
  font-size: 1.05rem;
  line-height: 1.95;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.about-content p.lead {
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 400;
}

.topics-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0;
}

.topic-pill {
  background: var(--accent-light);
  color: var(--accent);
  padding: 6px 18px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 500;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  padding: 52px 0 40px;
  margin-top: 100px;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 300;
}

.footer-inner a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  header {
    padding: 44px 0 28px;
  }

  .post-header h1 {
    font-size: 1.9rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .post-footer {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
