:root {
  color-scheme: dark;
  --bg: #080808;
  --surface: #121212;
  --surface-2: #1b1b1b;
  --text: #f7f1e3;
  --muted: #b9ad93;
  --line: rgba(230, 188, 92, .24);
  --gold: #d9a72e;
  --gold-2: #f1d374;
  --danger: #cf3f3f;
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f4ed;
  --surface: #ffffff;
  --surface-2: #f0eadf;
  --text: #181510;
  --muted: #655d50;
  --line: rgba(139, 100, 22, .22);
  --shadow: 0 18px 60px rgba(80, 54, 0, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--gold) 10%, transparent), transparent 34rem),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 36%, var(--bg)), var(--bg) 22rem);
  color: var(--text);
  font-family: Inter, Cairo, system-ui, sans-serif;
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 82px;
  padding: 10px clamp(16px, 4vw, 54px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.brand img { width: 72px; height: 52px; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(217, 167, 46, .18)); }
.brand span { max-width: 260px; line-height: 1.25; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a, .lang-select, .icon-button, .button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  min-height: 42px;
  padding: 9px 14px;
  font-weight: 700;
}
.nav a:hover, .button:hover, .socials a:hover { border-color: var(--gold); transform: translateY(-1px); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-button { width: 42px; padding: 0; cursor: pointer; }
.menu-button { display: none; }
.primary { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #171105; border-color: transparent; }
.danger { background: var(--danger); color: #fff; border-color: transparent; }

.hero {
  min-height: calc(100vh - 82px);
  display: grid;
  align-items: end;
  position: relative;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .72; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 48%), linear-gradient(90deg, rgba(0,0,0,.72), transparent);
}
[dir="rtl"] .hero::after { background: linear-gradient(to top, var(--bg) 0%, transparent 48%), linear-gradient(270deg, rgba(0,0,0,.72), transparent); }
.hero-content {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 32px));
  margin: 0 clamp(16px, 5vw, 72px) 9vh;
}
.hero h1, .page-hero h1 { margin: 8px 0 14px; font-size: clamp(2.1rem, 5vw, 5.4rem); line-height: 1.05; letter-spacing: 0; }
.hero p, .page-hero p { font-size: 1.1rem; color: var(--muted); max-width: 760px; }
.eyebrow { color: var(--gold-2); font-weight: 800; margin: 0; text-transform: uppercase; }

.section, .featured-grid, .article, .page-hero {
  width: min(1180px, calc(100% - 32px));
  margin: 42px auto;
}
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-head h1, .section-head h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 3rem); }

.featured-grid { display: grid; gap: 18px; }
.lead-story {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 1fr;
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.lead-story img { width: 100%; height: 360px; object-fit: cover; border-radius: 6px; }
.lead-story h2 { font-size: clamp(1.7rem, 3vw, 3rem); line-height: 1.15; }

.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--surface-2);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 45s linear infinite;
}
.ticker a { padding: 16px 28px; color: var(--gold-2); font-weight: 800; white-space: nowrap; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
[dir="rtl"] .ticker-track { animation-direction: reverse; }

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.news-card, .writer-card, .language-panel, .admin-table, .login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.news-card { overflow: hidden; }
.news-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.news-card div { padding: 16px; }
.news-card h2, .news-card h3 { margin: 8px 0; line-height: 1.25; }
.news-card p, time, .summary, .body, .writer-card p { color: var(--muted); }

.page-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 28px;
}
.page-hero img { border-radius: 8px; border: 1px solid var(--line); }
.prose { font-size: 1.1rem; }
.article { max-width: 860px; }
.article h1 { font-size: clamp(2rem, 4vw, 4rem); line-height: 1.08; margin: 10px 0; }
.article-image { width: 100%; max-height: 560px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); margin: 24px 0; }
.summary { font-size: 1.25rem; font-weight: 700; }
.body { font-size: 1.08rem; }
.video-block iframe, .video-block video { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; background: #000; }

.writers-hero {
  width: min(1180px, calc(100% - 32px));
  margin: 48px auto 28px;
  min-height: 300px;
  display: grid;
  grid-template-columns: 1fr 260px;
  align-items: center;
  gap: 28px;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, var(--gold)), var(--surface-2)),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.writers-hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  line-height: 1.04;
}
.writers-hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
}
.writers-hero img {
  width: 220px;
  justify-self: center;
  filter: drop-shadow(0 28px 34px rgba(217, 167, 46, .24));
}
.writers-section { margin-top: 24px; }
.writers-rail {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.writers-rail span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  font-weight: 800;
}
.writer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.writer-card {
  position: relative;
  min-height: 250px;
  padding: 22px;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}
.writer-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 16%, transparent), transparent 54%);
  opacity: .7;
  pointer-events: none;
}
.writer-card > * { position: relative; }
.writer-card:hover { transform: translateY(-4px); border-color: var(--gold); }
.writer-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 34px;
}
.writer-card-top span {
  color: var(--gold-2);
  font-weight: 900;
  font-size: .9rem;
}
.writer-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.2;
}
.avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: #171105;
  font-weight: 900;
  font-size: 1.4rem;
  box-shadow: 0 16px 34px rgba(217, 167, 46, .24);
}

.search { display: flex; gap: 8px; flex-wrap: wrap; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  padding: 12px;
  font: inherit;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 60px;
  padding: 34px clamp(16px, 4vw, 54px);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.footer-logo { width: 86px; filter: drop-shadow(0 14px 20px rgba(217, 167, 46, .18)); }
.socials { display: flex; gap: 8px; }
.socials a {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--gold-2);
  font-weight: 900;
  text-transform: uppercase;
  transition: transform .18s ease, border-color .18s ease;
}

.admin-body { background: var(--bg); min-height: 100vh; }
.admin-shell { width: min(1120px, calc(100% - 32px)); margin: 30px auto; }
.admin-top, .admin-actions, .form-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.admin-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 14px; border-bottom: 1px solid var(--line); text-align: start; }
.inline-form { display: inline; }
.inline-form button { color: var(--danger); background: transparent; border: 0; cursor: pointer; font-weight: 800; }
.login-card { width: min(420px, calc(100% - 32px)); margin: 8vh auto; padding: 24px; }
.login-card img { width: 110px; margin: auto; }
.login-card label, .editor label { display: grid; gap: 6px; font-weight: 800; margin-bottom: 14px; }
.language-panel { padding: 18px; margin: 18px 0; }
.error { color: #fff; background: var(--danger); padding: 10px; border-radius: 8px; }
.notice { color: #171105; background: var(--gold-2); padding: 10px; border-radius: 8px; font-weight: 800; }

@media (max-width: 900px) {
  .menu-button { display: inline-grid; place-items: center; }
  .nav {
    display: none;
    position: absolute;
    inset-inline: 16px;
    top: 82px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    flex-direction: column;
    align-items: stretch;
  }
  .nav.open { display: flex; }
  .brand span { display: none; }
  .lead-story, .page-hero, .writers-hero { grid-template-columns: 1fr; }
  .writers-hero img { width: 160px; }
  .news-grid, .writer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .site-header { min-height: 72px; }
  .brand img { width: 54px; height: 40px; }
  .hero { min-height: 78vh; }
  .hero-content { margin-bottom: 48px; }
  .news-grid, .writer-grid { grid-template-columns: 1fr; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .lead-story img { height: 240px; }
}
