:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --navy: #0f172a;
  --navy-light: #1e293b;
  --text: #334155;
  --text-muted: #64748b;
  --accent: #b45309;
  --accent-hover: #92400e;
  --accent-soft: #fef3c7;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand {
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: 'Amiri', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.main-nav a {
  text-decoration: none;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

.main-nav .nav-admin {
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.main-nav .nav-admin:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #ffffff;
  padding: 72px 0;
  text-align: center;
}

.hero-inner {
  max-width: 760px;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  color: #fde68a;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero-title {
  font-family: 'Amiri', serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.25;
}

.hero-lead {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-outline {
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Sections */
.section {
  padding: 64px 0;
}

.section-header {
  margin-bottom: 36px;
}

.section-title {
  font-family: 'Amiri', serif;
  font-size: 2rem;
  color: var(--navy);
  margin-bottom: 6px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  margin-top: 6px;
  border-radius: 2px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.98rem;
}

/* Biography */
.bio-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: start;
}

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

.card-title {
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.facts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fact-item dt {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.fact-item dd {
  font-size: 0.95rem;
  color: var(--navy);
  font-weight: 500;
}

.bio-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bio-block h3 {
  font-size: 1.15rem;
  color: var(--navy);
  margin-bottom: 8px;
}

.bio-block p + p {
  margin-top: 10px;
}

.books-list {
  padding-right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Video Archive */
.videos-section {
  background: #f1f5f9;
  border-top: 1px solid var(--border);
}

.archive-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.search-box {
  flex: 1 1 280px;
  max-width: 420px;
}

.search-box input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--navy);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.year-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.filter-btn.active {
  background: var(--navy);
  color: #ffffff;
  border-color: var(--navy);
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  overflow: hidden;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.video-card:hover .play-overlay {
  background: rgba(15, 23, 42, 0.45);
}

.play-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(180, 83, 9, 0.92);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.video-platform-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.video-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

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

.video-cat {
  background: var(--accent-soft);
  color: var(--accent-hover);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.video-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.5;
}

.loading-state,
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 860px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.05rem;
  color: var(--navy);
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.modal-ext-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-soft);
}

.modal-ext-link:hover {
  background: var(--accent);
  color: #ffffff;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.modal-close:hover {
  color: var(--navy);
}

.modal-video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.modal-video-wrap.is-twitter {
  aspect-ratio: auto;
  height: min(75vh, 580px);
  background: #15202b;
}

.modal-video-wrap iframe {
  width: 100%;
  height: 100%;
  display: block;
}

/* Footer */
.site-footer {
  background: var(--navy);
  color: #cbd5e1;
  padding: 24px 0;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-admin-link {
  color: #fde68a;
  text-decoration: none;
  font-weight: 600;
}

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

/* Articles Section */
.articles-section {
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.article-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0f172a;
  overflow: hidden;
}

.article-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.article-card:hover .article-card-thumb img {
  transform: scale(1.03);
}

.article-card-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.article-card-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.5;
}

.article-card-excerpt {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.7;
  flex: 1;
}

.article-read-more {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  align-self: flex-start;
}

.article-modal-dialog {
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.article-modal-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.article-modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 1.02rem;
  line-height: 1.9;
  color: var(--text);
}

.article-modal-cover {
  margin-bottom: 20px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}

.article-modal-cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
  margin: 0;
}

.article-modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px auto;
  display: block;
}

.article-modal-body p + p {
  margin-top: 14px;
}

.article-modal-body h2,
.article-modal-body h3,
.article-modal-body h4 {
  color: var(--navy);
  margin: 18px 0 8px;
}

.article-modal-body ul,
.article-modal-body ol {
  padding-right: 24px;
  margin: 12px 0;
}

.article-modal-body blockquote {
  border-right: 4px solid var(--accent);
  background: var(--bg);
  padding: 12px 16px;
  margin: 14px 0;
  border-radius: 6px;
  color: var(--navy);
}

.article-modal-body a {
  color: var(--accent);
  text-decoration: underline;
}

/* Load More Pagination */
.load-more-wrap {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.load-more-wrap[hidden] {
  display: none;
}

.btn-load-more {
  background: var(--navy);
  color: #ffffff;
  padding: 11px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-load-more:hover {
  background: var(--accent);
}

.load-more-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 860px) {
  .bio-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    padding: 12px 20px;
    text-align: center;
  }

  .main-nav {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero {
    padding: 52px 0;
  }
}
