/* ─────────────────────────────────────────────────────────────────────────────
   WARAQ — Stylesheet  (Hybrid: Codex × Night Garden)
───────────────────────────────────────────────────────────────────────────── */

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

/* ── RESET ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── VARIABLES ──────────────────────────────────────────────────────────────── */
:root {
  /* Sidebar (dark forest green) */
  --sidebar-bg:     #192b20;
  --sidebar-ink:    #ede4d0;
  --sidebar-muted:  #7a9e86;
  --sidebar-border: #243c2c;

  /* Main content panel (warm cream) */
  --bg:           #f5f0e6;
  --surface:      #fdfaf4;
  --surface-alt:  #faf5ec;
  --ink:          #1a1410;
  --ink-muted:    #7a6e5a;
  --border:       #e5ddd0;

  /* Accent kept for admin compatibility */
  --accent:       #2c4a35;
  --accent-mid:   #4a7c5f;
  --accent-light: #e8f0eb;

  /* Brand accents */
  --gold:         #d4a84b;
  --gold-lt:      rgba(212,168,75,0.12);
  --danger:       #b83232;

  /* Typography */
  --display: 'Bodoni Moda', Georgia, serif;
  --serif:   'Bodoni Moda', Georgia, serif;
  --body:    'Cormorant Garamond', Georgia, serif;
  --arabic:  'Amiri', 'IBM Plex Sans Arabic', Georgia, serif;
  --sans:    'Cormorant Garamond', 'Amiri', 'IBM Plex Sans Arabic', Georgia, serif;

  --max-w:  680px;
  --radius: 6px;
}

/* ── BASE ───────────────────────────────────────────────────────────────────── */
html { font-size: 18px; scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; }

/* ── SITE LAYOUT (sidebar + content) ───────────────────────────────────────── */
.site-layout {
  display: flex;
  min-height: 100vh;
}

/* ── PUBLIC SIDEBAR ─────────────────────────────────────────────────────────── */
.public-sidebar {
  width: 272px;
  min-width: 272px;
  background: var(--sidebar-bg);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

/* Geometric grid pattern */
.public-sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* Ghost Arabic behind sidebar */
.sidebar-ghost {
  position: absolute;
  bottom: -2rem;
  left: -2rem;
  font-family: var(--arabic);
  font-size: 20rem;
  font-weight: 700;
  color: rgba(237,228,208,0.025);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  direction: rtl;
}

.sidebar-top {
  padding: 2rem 1.75rem 1.5rem;
  border-bottom: 1px solid var(--sidebar-border);
  position: relative;
  z-index: 1;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  margin-bottom: 1rem;
}

.logo-en {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--sidebar-ink);
  letter-spacing: 0.06em;
  line-height: 1;
}

.logo-diamond {
  width: 6px;
  height: 6px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.logo-ar {
  font-family: var(--arabic);
  font-size: 1.4rem;
  font-weight: 700;
  color: rgba(237,228,208,0.75);
}

.sidebar-rule {
  width: 36px;
  height: 2px;
  background: var(--gold);
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  z-index: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0;
  font-family: var(--body);
  font-size: 0.78rem;
  color: var(--sidebar-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--sidebar-border);
  transition: color 0.2s;
}

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

.nav-diamond {
  width: 4px;
  height: 4px;
  background: var(--sidebar-border);
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: background 0.2s;
}

.sidebar-nav a:hover .nav-diamond { background: var(--gold); }

/* Sidebar bottom */
.sidebar-bottom {
  padding: 1.5rem 1.75rem;
  border-top: 1px solid var(--sidebar-border);
  position: relative;
  z-index: 1;
}

.sidebar-social {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.sidebar-social-icon {
  color: var(--sidebar-muted);
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.sidebar-social-icon:hover { color: var(--gold); }

.sidebar-tagline {
  font-family: var(--arabic);
  font-size: 0.8rem;
  direction: rtl;
  color: rgba(237,228,208,0.55);
  line-height: 1.8;
}

/* Mobile menu toggle (hidden on desktop) */
.sidebar-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sidebar-ink);
  padding: 0.25rem;
}

/* ── SITE CONTENT (right panel) ─────────────────────────────────────────────── */
.site-content {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* ── MASTHEAD (homepage) ────────────────────────────────────────────────────── */
.masthead {
  padding: 3.5rem 3.5rem 2.75rem;
  border-bottom: 1px solid var(--border);
}

.masthead-eyebrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.masthead-eyebrow-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.masthead-eyebrow-left::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

.masthead-eyebrow-text {
  font-family: var(--body);
  font-size: 0.67rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.masthead-eyebrow-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.masthead-eyebrow-right::after {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--gold);
}

.masthead-eyebrow-ar {
  font-family: var(--arabic);
  font-size: 0.78rem;
  color: var(--ink-muted);
  direction: rtl;
}

.masthead-heads {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.masthead-h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.06;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.masthead-ar {
  font-family: var(--arabic);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 700;
  color: var(--ink);
  direction: rtl;
  text-align: right;
  line-height: 1.3;
}

/* ── CARD GRID ──────────────────────────────────────────────────────────────── */
.card-grid {
  padding: 2.5rem 3.5rem 6rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  flex: 1;
  direction: rtl;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Post card base */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.25s, transform 0.2s;
  position: relative;
  overflow: hidden;
  direction: ltr;
  animation: cardIn 0.4s ease both;
}
.post-card:nth-child(2) { animation-delay: 0.07s; }
.post-card:nth-child(3) { animation-delay: 0.14s; }
.post-card:nth-child(4) { animation-delay: 0.21s; }
.post-card:nth-child(5) { animation-delay: 0.28s; }
.post-card:nth-child(6) { animation-delay: 0.35s; }

/* Corner triangle ornament */
.post-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 44px; height: 44px;
  background: linear-gradient(135deg, transparent 50%, var(--gold-lt) 50%);
}

/* Gold bottom border reveal on hover */
.post-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold) 0%, transparent 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.post-card:hover {
  border-color: rgba(212,168,75,0.35);
  transform: translateY(-2px);
}
.post-card:hover::after { transform: scaleX(1); }
.post-card:hover .card-title,
.post-card:hover .card-title-ar { color: var(--gold); }

/* Featured card (first post — spans both columns) */
.post-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  background: var(--surface-alt);
}

.featured-aside { text-align: center; }

.feat-ar-big {
  font-family: var(--arabic);
  font-size: 8rem;
  font-weight: 700;
  color: var(--gold);
  opacity: 0.20;
  line-height: 1;
  direction: rtl;
  user-select: none;
}

/* Card internals */
.card-meta {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.7rem;
}

.card-tag {
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(212,168,75,0.35);
  padding: 0.1rem 0.5rem;
  border-radius: 1px;
  font-family: var(--body);
}

.card-tag.pdf { color: var(--ink-muted); border-color: rgba(122,110,90,0.35); }

.card-date {
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-family: var(--body);
}

.card-title {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 0.35rem;
  transition: color 0.25s;
  letter-spacing: -0.01em;
}

.featured .card-title,
.post-card.featured .card-title {
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 700;
}

.card-title-ar {
  font-family: var(--arabic);
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  direction: rtl;
  color: var(--ink);
  margin-bottom: 0.2rem;
  line-height: 1.4;
  font-weight: 700;
}

/* English title secondary when bilingual */
.card-title-ar + .card-title {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-muted);
  font-style: italic;
  margin-bottom: 0.35rem;
  transition: color 0.25s;
}

/* Featured Arabic title */
.post-card.featured .card-title-ar {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 700;
}

.card-excerpt {
  font-family: var(--body);
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.8;
  font-style: italic;
  margin-bottom: 1rem;
}

.card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgba(26,20,16,0.42);
  font-family: var(--body);
}

.card-author.arabic-author {
  justify-content: space-between;
  direction: ltr;
}

.card-author-diamond {
  width: 4px;
  height: 4px;
  background: var(--gold);
  transform: rotate(45deg);
  flex-shrink: 0;
  opacity: 0.6;
}

/* ── EMPTY STATE ────────────────────────────────────────────────────────────── */
.empty-state {
  padding: 4rem 3.5rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ── SINGLE POST PAGE ───────────────────────────────────────────────────────── */
.post-section-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--sidebar-bg) 0%, var(--gold) 100%);
}

.post-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-decoration: none;
  margin-bottom: 1.75rem;
  transition: color 0.15s;
  font-family: var(--body);
  letter-spacing: 0.04em;
}
.post-back:hover { color: var(--accent); }
.post-back::before { content: '←'; }

.post-header { margin-bottom: 2rem; }

.post-type-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-mid);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.post-type-label::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--accent-mid);
}

.post-type-label.pdf { color: var(--gold); }
.post-type-label.pdf::before { background-color: var(--gold); }

.post-cover {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1.75rem;
  border: 1px solid var(--border);
}

.post-header h1 {
  font-family: var(--display);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.post-header .title-ar {
  font-family: var(--arabic);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  direction: rtl;
  text-align: right;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.post-excerpt {
  font-size: 1.05rem;
  color: var(--ink-muted);
  line-height: 1.65;
  margin-top: 0.75rem;
  font-style: italic;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
  font-family: var(--body);
}

.post-meta .meta-author { color: var(--ink); font-weight: 600; }

/* ── ARTICLE BODY ───────────────────────────────────────────────────────────── */
.post-body {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--ink);
  font-family: var(--body);
}

.post-body.rtl {
  direction: rtl;
  text-align: right;
  font-family: var(--arabic);
  font-size: 1.12rem;
  line-height: 2.1;
}

.post-body.rtl ul,
.post-body.rtl ol {
  padding-left: 0;
  padding-right: 1.5rem;
}

.post-body.rtl blockquote {
  border-left: none;
  border-right: 3px solid var(--gold);
  border-radius: var(--radius) 0 0 var(--radius);
}

.post-body p { margin-bottom: 1.25rem; }
.post-body h1, .post-body h2, .post-body h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.25;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--ink);
}
.post-body h1 { font-size: 1.7rem; }
.post-body h2 { font-size: 1.35rem; }
.post-body h3 { font-size: 1.1rem; }
.post-body ul, .post-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.post-body li { margin-bottom: 0.35rem; }
.post-body blockquote {
  border-left: 3px solid var(--gold);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  color: var(--ink-muted);
  font-style: italic;
  background: var(--surface-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.post-body pre, .post-body code {
  font-family: 'Courier New', monospace;
  font-size: 0.88rem;
  background: #f0ede6;
  border-radius: 4px;
}
.post-body pre { padding: 1rem 1.25rem; margin-bottom: 1.25rem; overflow-x: auto; }
.post-body code { padding: 0.15em 0.4em; }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-body img { max-width: 100%; border-radius: var(--radius); margin: 1rem 0; }
.post-body strong { font-weight: 700; }

/* ── PDF VIEWER ─────────────────────────────────────────────────────────────── */
.pdf-section { margin-bottom: 1.5rem; }

.pdf-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.pdf-embed {
  width: 100%;
  height: 620px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── REFERENCES ─────────────────────────────────────────────────────────────── */
.references-section {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
}

.references-section h3 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 0.875rem;
  font-family: var(--body);
}

.ref-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }

.ref-list li {
  font-size: 0.875rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--body);
}

.ref-list li::before { content: '↗'; color: var(--gold); font-size: 0.75rem; flex-shrink: 0; }

.ref-list a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s;
}
.ref-list a:hover { text-decoration-color: var(--accent); }

/* ── ADDITIONS ──────────────────────────────────────────────────────────────── */
.additions-section { margin-top: 3rem; }

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--body);
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.addition-item {
  padding: 1.25rem 1.375rem;
  border-inline-start: 3px solid var(--accent-light);
  background: var(--surface);
  margin-bottom: 0.875rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.addition-item p { font-size: 0.975rem; line-height: 1.8; margin-bottom: 0.5rem; }
.addition-meta { font-size: 0.8rem; color: var(--ink-muted); }

/* ── SUGGEST FORM ───────────────────────────────────────────────────────────── */
.suggest-section {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
}
.suggest-section h3 { font-family: var(--body); font-size: 1rem; font-weight: 600; margin-bottom: 0.2rem; }
.suggest-note { font-size: 0.84rem; color: var(--ink-muted); margin-bottom: 1.25rem; }

/* ── FORMS ──────────────────────────────────────────────────────────────────── */
.form-section {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.form-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
}

.form-tab {
  background: none;
  border: none;
  padding: 0.6rem 1.25rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--ink-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
}
.form-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.form-group { margin-bottom: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}
.label-note { font-weight: 400; text-transform: none; letter-spacing: 0; }

input[type="text"],
input[type="password"],
input[type="url"],
input[type="email"],
textarea,
input[type="file"] {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
input:focus, textarea:focus { border-color: var(--accent); background: var(--surface); }
textarea { resize: vertical; min-height: 200px; line-height: 1.7; }
textarea.rtl-input { direction: rtl; font-family: var(--arabic); }

.ref-row { display: flex; gap: 0.5rem; align-items: center; }

/* ── BUTTONS ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, background-color 0.15s;
}
.btn-primary { background-color: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.85; }
.btn-gold { background-color: var(--gold); color: #fff; }
.btn-gold:hover { opacity: 0.85; }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background-color: var(--accent-light); }
.btn-danger { background-color: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.85; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

/* ── ALERTS ─────────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}
.alert-success { background: #edf7f0; border: 1px solid #a8d5b5; color: #2d6a4f; }
.alert-error   { background: #fdf0ef; border: 1px solid #f0b8b5; color: var(--danger); }
.alert-info    { background: var(--accent-light); border: 1px solid #bdd5c6; color: var(--accent); }

/* ── LIKE / SHARE ACTIONS ───────────────────────────────────────────────────── */
.post-actions {
  display: flex;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
  font-family: var(--sans);
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.action-btn:hover { border-color: var(--accent); color: var(--accent); }

.like-btn.liked { border-color: #e85d5d; color: #e85d5d; }
.like-btn.liked svg { fill: #e85d5d; stroke: #e85d5d; }

/* ── COMMENTS ───────────────────────────────────────────────────────────────── */
.comments-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.comment-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.comment-item p { margin: 0 0 0.35rem; font-size: 0.95rem; line-height: 1.6; }

.comment-meta { font-size: 0.78rem; color: var(--ink-muted); font-family: var(--body); }

.no-comments { font-size: 0.9rem; color: var(--ink-muted); font-family: var(--body); margin: 0.5rem 0 1rem; }

/* ── FOOTER ─────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--surface-alt);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  color: rgba(26,20,16,0.35);
  letter-spacing: 0.06em;
}

.footer-diamond {
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: rotate(45deg);
  opacity: 0.5;
  flex-shrink: 0;
}

.footer-ar {
  font-family: var(--arabic);
  font-size: 0.95rem;
  color: rgba(26,20,16,0.3);
}

.footer-tagline {
  font-size: 0.72rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  font-family: var(--body);
}

.footer-social {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.social-icon {
  color: var(--ink-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.social-icon:hover { color: var(--accent); }

/* ── ADMIN LAYOUT ───────────────────────────────────────────────────────────── */
.admin-wrap {
  display: flex;
  min-height: 100vh;
  background: #f0f0ee;
}

.admin-sidebar {
  width: 220px;
  min-width: 220px;
  background: #1a1a1a;
  color: #ccc;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1.25rem 1.1rem 1rem;
  border-bottom: 1px solid #2e2e2e;
}
.admin-sidebar-logo { width: 28px; height: 28px; flex-shrink: 0; }
.admin-sidebar-site-name { font-size: 0.95rem; font-weight: 600; color: #fff; line-height: 1.2; }
.admin-sidebar-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em; color: #666; }
.admin-sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.1rem;
  color: #aaa;
  text-decoration: none;
  font-size: 0.875rem;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.admin-nav-link:hover { background: #242424; color: #fff; }
.admin-nav-link.active { background: #242424; color: #fff; border-left-color: var(--accent); }
.admin-sidebar-footer {
  padding: 1rem 1.1rem;
  border-top: 1px solid #2e2e2e;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.admin-sidebar-link { font-size: 0.8rem; color: #666; text-decoration: none; transition: color 0.15s; }
.admin-sidebar-link:hover { color: #ccc; }

.admin-main {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2rem 4rem;
  min-width: 0;
}
.admin-page-title {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1.75rem;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
}
.stat-card-alert { border-top: 3px solid #e8a020; }
.stat-number {
  font-family: var(--display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.stat-card-alert .stat-number { color: #e8a020; }
.stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-muted); }

.quick-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2rem; }

.admin-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.recent-post-card { display: flex; gap: 1rem; align-items: flex-start; }
.recent-post-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }

.activity-feed { list-style: none; padding: 0; margin: 0; }
.activity-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-badge {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.activity-badge-addition { background: #fff4e0; color: #c07a00; }
.activity-body { flex: 1; min-width: 0; }
.activity-text { font-size: 0.85rem; color: var(--ink); line-height: 1.4; }
.activity-date { font-size: 0.75rem; color: var(--ink-muted); margin-top: 0.2rem; }

.admin-search-bar { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1.75rem; }
.admin-search-input {
  flex: 1;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
}
.admin-search-input:focus { outline: none; border-color: var(--accent); }

.settings-form { max-width: 560px; }
.settings-group { margin-bottom: 2rem; }
.settings-group-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.form-hint { font-size: 0.78rem; color: var(--ink-muted); margin-top: 0.35rem; }

.admin-section { margin-bottom: 2.5rem; }
.admin-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}
.admin-card.pending  { border-left: 3px solid #e8a020; }
.admin-card.approved { border-left: 3px solid var(--accent); }
.admin-card-title { font-weight: 500; margin-bottom: 0.35rem; font-size: 0.95rem; }
.admin-card-meta  { font-size: 0.8rem; color: var(--ink-muted); margin-bottom: 0.75rem; }
.admin-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────────── */

/* Tablet: narrow sidebar */
@media (max-width: 1024px) {
  .public-sidebar { width: 230px; min-width: 230px; }
  .card-grid { padding: 2rem 2.5rem 5rem; }
  .masthead { padding: 3rem 2.5rem 2.5rem; }
  .site-footer { padding: 1.75rem 2.5rem; }
}

/* Mobile: sidebar becomes top bar */
@media (max-width: 768px) {
  html { font-size: 16px; }

  .site-layout { display: block; }

  .public-sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: auto;
    position: relative;
    top: auto;
    overflow: visible;
    border-right: none;
    border-bottom: 1px solid var(--sidebar-border);
    /* Keep sticky nav on mobile */
    position: sticky;
    top: 0;
    z-index: 200;
  }

  /* Hide geometric pattern on mobile for performance */
  .public-sidebar::before { display: none; }
  .sidebar-ghost { display: none; }

  /* Sidebar top becomes a horizontal bar */
  .sidebar-top {
    padding: 0 1.25rem;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
  }

  .site-logo { margin-bottom: 0; }
  .logo-en { font-size: 1.3rem; }
  .sidebar-rule { display: none; }

  /* Nav becomes horizontal scrollable row */
  .sidebar-nav {
    padding: 0;
    flex-direction: row;
    overflow-x: auto;
    border-top: 1px solid var(--sidebar-border);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }

  .sidebar-nav a {
    padding: 0.7rem 1.1rem;
    border-bottom: none;
    border-right: 1px solid var(--sidebar-border);
    white-space: nowrap;
    font-size: 0.7rem;
    flex-shrink: 0;
  }

  .sidebar-nav a:last-child { border-right: none; }

  /* Hide tagline and social on mobile */
  .sidebar-bottom { display: none; }

  /* Card grid: single column */
  .card-grid {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem 4rem;
    gap: 1rem;
  }

  /* Featured card: stack vertically */
  .post-card.featured {
    grid-template-columns: 1fr;
  }
  .featured-aside { display: none; }

  /* Masthead */
  .masthead { padding: 2rem 1rem 1.75rem; }
  .masthead-eyebrow { flex-wrap: wrap; gap: 0.5rem; }
  .masthead-heads { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .masthead-ar { font-size: 2rem; text-align: right; direction: rtl; width: 100%; }
  .masthead-h1 { font-size: 2rem; }

  /* Post page */
  .post-wrap { padding: 1.75rem 1rem 4rem; }
  .pdf-embed { height: 420px; }
  .form-row { grid-template-columns: 1fr; }
  .ref-row  { flex-direction: column; align-items: stretch; }

  /* Footer */
  .site-footer {
    padding: 1.5rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Small screens */
@media (max-width: 480px) {
  html { font-size: 15px; }
  .logo-ar { display: none; }
  .logo-diamond { display: none; }
  .card-grid { padding: 1.25rem 0.875rem 3.5rem; }
  .post-card { padding: 1.5rem; }
}

/* Admin responsive */
@media (max-width: 900px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .admin-cols { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .admin-sidebar { display: none; }
  .admin-main    { padding: 1.25rem 1rem 3rem; }
  .stat-cards    { grid-template-columns: repeat(2, 1fr); }
}
