:root {
  color-scheme: light;
  --ink: #172027;
  --muted: #63707b;
  --line: #d9e1e6;
  --surface: #ffffff;
  --soft: #eef4f7;
  --navy: #17324d;
  --green: #20715f;
  --red: #b72c37;
  --amber: #c68b2c;
  --shadow: 0 18px 50px rgba(23, 32, 39, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  direction: rtl;
}

body {
  margin: 0;
  background: #f8fafb;
  color: var(--ink);
  font-family:
    "Segoe UI", Tahoma, Arial, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
  direction: rtl;
  text-align: right;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 54px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.top-nav a,
.button,
.load-more,
.category-chip {
  border-radius: 8px;
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.top-nav a {
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 700;
}

.top-nav a:hover {
  color: var(--navy);
  background: var(--soft);
}

.hero {
  position: relative;
  min-height: min(680px, calc(100vh - 32px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 460px);
  align-items: center;
  gap: clamp(20px, 4vw, 56px);
  overflow: hidden;
  padding: clamp(34px, 6vw, 72px);
  background: var(--navy);
}

.hero-media {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.hero-media img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.06);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(270deg, rgba(12, 25, 38, 0.86), rgba(12, 25, 38, 0.5) 52%, rgba(12, 25, 38, 0.18)),
    linear-gradient(0deg, rgba(12, 25, 38, 0.54), rgba(12, 25, 38, 0.08));
}

.hero-content {
  position: relative;
  max-width: 780px;
  padding: 0;
  color: #fff;
  margin-right: 0;
  margin-left: auto;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-visual img {
  width: min(100%, 420px);
  height: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--amber);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1,
.section h2,
.dialog h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(40px, 7vw, 86px);
}

.hero p:not(.eyebrow) {
  max-width: 650px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(18px, 2vw, 23px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button,
.load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
}

.button:disabled,
.load-more:disabled {
  cursor: wait;
  opacity: 0.68;
}

.button.primary,
.load-more {
  background: var(--red);
  color: #fff;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.admin-body .button.secondary,
.admin-table .button.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--navy);
}

.button:hover,
.load-more:hover,
.category-chip:hover {
  transform: translateY(-1px);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.metrics article {
  padding: 24px clamp(18px, 4vw, 54px);
  background: var(--surface);
}

.metrics strong,
.metrics span {
  display: block;
}

.metrics strong {
  color: var(--green);
  font-size: clamp(30px, 4vw, 50px);
}

.metrics span {
  color: var(--muted);
  font-weight: 700;
}

.section {
  padding: clamp(42px, 6vw, 82px) clamp(18px, 4vw, 54px);
}

.section-muted {
  background: var(--soft);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  max-width: 1180px;
  margin: 0 auto 24px;
}

.section h2 {
  font-size: clamp(30px, 5vw, 56px);
}

.featured-grid,
.archive-grid {
  display: grid;
  max-width: 1180px;
  margin: 0 auto;
  gap: 16px;
}

.featured-grid {
  grid-template-columns: 1.15fr 0.85fr;
}

.archive-grid {
  grid-template-columns: repeat(3, 1fr);
}

.news-card {
  overflow: hidden;
  min-width: 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(23, 32, 39, 0.04);
}

.news-card.featured:first-child {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background: var(--navy);
  color: #fff;
}

.card-image {
  display: block;
  aspect-ratio: 16 / 9;
  margin: -22px -22px 18px;
  overflow: hidden;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

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

.card-image.image-missing {
  display: grid;
  place-items: center;
  padding: 18px;
  background: #fff;
}

.card-image.image-missing img {
  width: min(42%, 130px);
  height: auto;
  object-fit: contain;
}

.news-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  justify-content: flex-start;
}

.news-card.featured:first-child .meta {
  color: rgba(255, 255, 255, 0.78);
}

.news-card h3 {
  margin: 0 0 12px;
  font-size: clamp(20px, 2vw, 29px);
  line-height: 1.18;
}

.news-card h3 a {
  color: inherit;
  text-decoration: none;
}

.news-card p {
  margin: 0;
  color: var(--muted);
}

.news-card.featured:first-child p {
  color: rgba(255, 255, 255, 0.82);
}

.news-card .read-link {
  display: inline-flex;
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

.news-card.featured:first-child .read-link {
  color: #fff;
}

.controls-heading {
  align-items: center;
}

.search-box {
  display: grid;
  gap: 6px;
  width: min(100%, 360px);
}

.search-box label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.search-box input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  direction: rtl;
}

.category-strip {
  display: flex;
  max-width: 1180px;
  margin: 0 auto 20px;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  direction: rtl;
}

.category-chip {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.category-chip.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.load-more {
  margin: 28px auto 0;
  border: 0;
}

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

.contact-section {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 380px);
  gap: 24px;
  max-width: 1288px;
  margin: 0 auto;
}

.contact-section p {
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
}

.contact-panel {
  display: grid;
  gap: 8px;
  align-content: center;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.contact-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.contact-panel a,
.contact-panel strong {
  overflow-wrap: anywhere;
  color: var(--navy);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 4vw, 54px);
  background: var(--navy);
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  direction: rtl;
}

.page-hero {
  padding: clamp(48px, 7vw, 96px) clamp(18px, 4vw, 54px);
  background:
    linear-gradient(270deg, rgba(23, 50, 77, 0.96), rgba(32, 113, 95, 0.88)),
    var(--navy);
  color: #fff;
}

.page-hero h1 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1.08;
}

.page-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(18px, 2vw, 23px);
}

.form-shell {
  padding: clamp(34px, 6vw, 72px) clamp(18px, 4vw, 54px);
}

.request-form {
  display: grid;
  max-width: 980px;
  margin: 0 auto;
  gap: 18px;
  padding: clamp(20px, 4vw, 34px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.request-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.request-form input,
.request-form textarea,
.request-form select,
.admin-card input,
.inline-edit input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 500;
  direction: rtl;
}

.request-form textarea,
.admin-card textarea {
  resize: vertical;
}

.request-form input:focus,
.request-form textarea:focus,
.request-form select:focus,
.admin-card input:focus,
.inline-edit input:focus {
  outline: 3px solid rgba(32, 113, 95, 0.18);
  border-color: var(--green);
}

.form-note {
  margin: 0;
  color: var(--muted);
}

.form-status {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 800;
}

.form-status.success {
  background: rgba(32, 113, 95, 0.12);
  color: var(--green);
}

.form-status.error {
  background: rgba(183, 44, 55, 0.12);
  color: var(--red);
}

.article-dialog {
  width: min(780px, calc(100vw - 28px));
  max-height: min(780px, calc(100vh - 28px));
  padding: 30px;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  direction: rtl;
  text-align: right;
}

.article-dialog::backdrop {
  background: rgba(15, 25, 33, 0.62);
}

.dialog-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
}

.article-meta {
  color: var(--muted);
  font-weight: 800;
}

#dialogBody {
  white-space: pre-wrap;
}

.article-page {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(34px, 6vw, 78px) clamp(18px, 4vw, 34px);
}

.article-header {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.back-link {
  color: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.article-header h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(34px, 6vw, 70px);
  line-height: 1.08;
  letter-spacing: 0;
}

.article-header > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 20px;
}

.article-gallery {
  display: grid;
  gap: 14px;
  margin: 0 0 28px;
}

.article-gallery img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.article-body {
  display: grid;
  gap: 16px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.9;
  white-space: normal;
}

.article-body p {
  margin: 0;
}

.admin-body {
  background: #f4f7f8;
}

.admin-auth {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.admin-card {
  display: grid;
  width: min(100%, 440px);
  gap: 16px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-card label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

.admin-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 4vw, 54px);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.admin-layout {
  display: grid;
  gap: 22px;
  padding: clamp(24px, 4vw, 54px);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.admin-grid article,
.admin-section,
.admin-table article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-grid article {
  padding: 24px;
}

.admin-grid strong {
  display: block;
  color: var(--green);
  font-size: 44px;
}

.admin-grid span {
  color: var(--muted);
  font-weight: 800;
}

.admin-section {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 28px);
}

.admin-section h1 {
  margin: 0;
  color: var(--navy);
}

.admin-table {
  display: grid;
  gap: 10px;
}

.admin-table article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
}

.admin-table strong,
.admin-table span {
  display: block;
}

.admin-table span,
.admin-table p {
  color: var(--muted);
}

.compact-form {
  max-width: none;
  margin: 0;
  box-shadow: none;
}

.inline-edit {
  display: flex;
  width: 100%;
  gap: 10px;
  align-items: center;
}

.checkbox-line {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px !important;
}

.checkbox-line input {
  width: auto;
  min-height: auto;
}

[dir="rtl"] {
  font-family:
    "Segoe UI", Tahoma, Arial, ui-sans-serif, system-ui, sans-serif;
}

@media (max-width: 900px) {
  .site-header,
  .section-heading,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .metrics,
  .featured-grid,
  .archive-grid,
  .contact-section,
  .form-grid,
  .hero,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .news-card.featured:first-child {
    min-height: auto;
  }

  .hero-media {
    grid-template-columns: 1fr;
  }

  .hero-media img:nth-child(n + 2) {
    display: none;
  }

  .admin-header,
  .admin-table article,
  .inline-edit {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .top-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .hero-content {
    padding: 34px 18px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }
}
