@import url("https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap");

:root {
  --gold: #c9a84c;
  --gold-light: #e8d48b;
  --dark: #1a1a2e;
  --dark2: #16213e;
  --ink: #253046;
  --surface: #ffffff;
  --surface-soft: #f5f5f5;
  --surface-muted: #eef1f6;
  --border: rgba(26, 26, 46, 0.1);
  --success: #1f8a57;
  --error: #c24b48;
  --shadow: 0 20px 60px rgba(14, 22, 38, 0.12);
  --shadow-soft: 0 8px 24px rgba(14, 22, 38, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --page-width: min(1120px, calc(100vw - 32px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Calibri", "Noto Naskh Arabic", sans-serif;
  background: linear-gradient(180deg, #f7f7f9 0%, #edf2f7 100%);
  color: var(--ink);
}

body.is-locked {
  overflow: hidden;
}

img,
video {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.is-hidden {
  display: none !important;
}

.site-shell {
  width: var(--page-width);
  margin: 0 auto;
}

.site-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark2) 55%, #0f3460 100%);
  color: #fff;
  padding: 22px 0 80px;
}

.site-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(201, 168, 76, 0.18), transparent 30%),
    radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.08), transparent 28%);
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-lockup img {
  width: 72px;
  height: auto;
}

.brand-copy strong {
  display: block;
  color: var(--gold-light);
  font-size: 1.2rem;
}

.brand-copy span {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.98rem;
}

.donate-btn,
.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.inline-action,
.lightbox-close {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.donate-btn,
.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  font-weight: 700;
}

.donate-btn,
.primary-button {
  background: linear-gradient(135deg, #e9bb7d, #d4a56a);
  color: var(--dark);
  box-shadow: 0 10px 24px rgba(201, 168, 76, 0.28);
}

.secondary-button,
.ghost-button,
.inline-action {
  background: rgba(22, 33, 62, 0.08);
  color: var(--dark);
}

.danger-button {
  background: rgba(194, 75, 72, 0.12);
  color: var(--error);
}

.donate-btn:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.ghost-button:hover,
.inline-action:hover,
.lightbox-close:hover {
  transform: translateY(-1px);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  max-width: 620px;
  padding: 56px 0 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-light);
  font-size: 0.95rem;
  font-weight: 700;
}

.eyebrow::before {
  content: "";
  width: 42px;
  height: 1px;
  background: currentColor;
}

.hero-copy h1,
.section-header h2,
.section-header h3,
.admin-title {
  margin: 0;
  line-height: 1.2;
}

.hero-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.08rem;
}

.hero-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.summary-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.82);
}

.page-main,
.admin-main {
  margin-top: -46px;
  padding-bottom: 48px;
}

.stack-layout {
  display: grid;
  gap: 24px;
}

.panel-card,
.admin-card,
.admin-section {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.panel-card {
  padding: 26px;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.section-header p,
.muted-text,
.hint-text {
  margin: 0;
  color: #607089;
}

.hero-stage {
  display: grid;
  gap: 16px;
}

.hero-skeleton,
.hero-placeholder,
.admin-preview-empty,
.empty-news-state {
  border: 1px dashed rgba(26, 26, 46, 0.14);
  border-radius: calc(var(--radius-lg) - 6px);
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(22, 33, 62, 0.04));
}

.hero-skeleton {
  position: relative;
  min-height: min(68vh, 520px);
  overflow: hidden;
}

.hero-skeleton::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

.hero-placeholder,
.admin-preview-empty,
.empty-news-state {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 260px;
  padding: 28px;
  text-align: center;
}

.hero-placeholder img,
.admin-preview-empty img {
  width: 88px;
}

.media-shell,
.admin-media-shell {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 6px);
  background: #111827;
  min-height: 220px;
}

.hero-media-asset,
.admin-preview img,
.admin-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media-asset {
  max-height: min(72vh, 620px);
}

.hero-media-video {
  aspect-ratio: 16 / 9;
}

.video-fallback {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 32px;
  color: #fff;
  text-decoration: none;
}

.video-fallback img {
  width: 86px;
}

.fade-media {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.fade-media.is-loaded {
  opacity: 1;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.news-card {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: calc(var(--radius-lg) - 8px);
  background: var(--surface);
  text-align: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.news-card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.16), rgba(22, 33, 62, 0.08));
}

.news-card-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(17, 24, 39, 0.12) 55%, rgba(17, 24, 39, 0.64) 100%);
  z-index: 1;
}

.news-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.news-card:hover img {
  transform: scale(1.05);
}

.news-card-caption {
  position: absolute;
  right: 0;
  left: 0;
  bottom: 0;
  z-index: 2;
  padding: 18px 16px 14px;
  color: #fff;
}

.news-card-caption strong,
.news-card-caption span {
  display: block;
}

.news-card-caption span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

.news-card-external {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--gold-light);
  font-size: 0.88rem;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  background: rgba(22, 33, 62, 0.06);
  color: var(--dark);
}

.notice[data-kind="success"] {
  background: rgba(31, 138, 87, 0.1);
  color: var(--success);
}

.notice[data-kind="error"] {
  background: rgba(194, 75, 72, 0.1);
  color: var(--error);
}

.notice button {
  min-height: 38px;
  padding: 0 14px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 11, 18, 0.88);
  backdrop-filter: blur(10px);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-dialog {
  position: relative;
  width: min(92vw, 980px);
  display: grid;
  gap: 12px;
}

.lightbox-frame {
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 82vh;
}

.lightbox-frame img {
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
}

.site-footer {
  background: linear-gradient(135deg, var(--dark), var(--dark2));
  color: #fff;
  padding: 34px 0;
}

.footer-content {
  text-align: center;
}

.footer-logo {
  color: var(--gold);
  font-size: 1.3rem;
  font-weight: 700;
}

.footer-sub {
  margin: 8px 0 20px;
  color: rgba(255, 255, 255, 0.65);
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.footer-bottom {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.55);
}

.admin-main {
  padding-top: 20px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.admin-card,
.admin-section {
  padding: 24px;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.field-label {
  display: grid;
  gap: 8px;
}

.field-label span {
  font-weight: 700;
  color: var(--dark);
}

.field-label input,
.inline-edit-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(26, 26, 46, 0.12);
  border-radius: 14px;
  background: #fff;
}

.field-label input:focus,
.inline-edit-form input:focus {
  outline: 0;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201, 168, 76, 0.14);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.file-chip,
.order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(22, 33, 62, 0.07);
  color: #516075;
}

.progress-wrap {
  position: relative;
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(22, 33, 62, 0.08);
  margin: 12px 0 10px;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--gold), #f0c66c);
  transition: width 0.2s ease;
}

.admin-preview {
  min-height: 240px;
  overflow: hidden;
  border-radius: calc(var(--radius-lg) - 10px);
  background: var(--surface-muted);
}

.admin-preview video {
  aspect-ratio: 16 / 9;
}

.news-admin-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.news-admin-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(26, 26, 46, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.news-admin-card img {
  width: 112px;
  height: 112px;
  border-radius: 14px;
  object-fit: cover;
}

.news-admin-content {
  display: grid;
  gap: 12px;
}

.news-admin-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.news-admin-top h4 {
  margin: 0;
  font-size: 1.05rem;
}

.news-admin-top p {
  margin: 4px 0 0;
  color: #607089;
}

.compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-action {
  min-height: 38px;
  padding: 0 14px;
  font-weight: 700;
}

.inline-edit-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(22, 33, 62, 0.04);
}

.inline-edit-form .button-row {
  margin-top: 2px;
}

.compact-form {
  padding-bottom: 8px;
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(100%);
  }
}

@media (max-width: 960px) {
  .news-grid,
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-hero {
    padding-bottom: 66px;
  }

  .topbar,
  .panel-toolbar,
  .news-admin-top,
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .news-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .news-admin-card {
    grid-template-columns: 1fr;
  }

  .news-admin-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .panel-card,
  .admin-card,
  .admin-section {
    padding: 20px;
  }

  .hero-copy {
    padding-top: 34px;
  }
}

@media (max-width: 520px) {
  .site-shell {
    width: min(100vw - 20px, 1120px);
  }

  .brand-copy strong {
    font-size: 1.05rem;
  }

  .brand-copy span,
  .hero-copy p,
  .summary-pill {
    font-size: 0.95rem;
  }

  .hero-skeleton,
  .hero-media-asset {
    min-height: 240px;
    max-height: 58vh;
  }

  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
