:root {
  --bg: #f7f4ef;
  --paper: #fffdf9;
  --ink: #1f1d1b;
  --muted: #706c66;
  --line: #e9e0d5;
  --brand: #d64f2a;
  --brand-dark: #ab391d;
  --chip: #ffe9dd;
}

@font-face {
  font-family: 'Tajawal';
  src: url('/fonts/Tajawal-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Tajawal';
  src: url('/fonts/Tajawal-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Tajawal';
  src: url('/fonts/Tajawal-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Tajawal', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 14%, #fff2cb 0%, transparent 30%),
    radial-gradient(circle at 85% 5%, #ffd8d8 0%, transparent 28%),
    var(--bg);
}

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
}

.narrow {
  width: min(860px, 92%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1px 0;
  gap: 12px;
}

.logo {
  justify-self: center;
  text-decoration: none;
}

.logo-image {
  display: block;
  height: 130px;
  width: auto;
  object-fit: contain;
  transition: height 0.3s ease;
}

.site-header {
  transition: box-shadow 0.3s, background 0.3s;
}

.site-header.compact .logo-image {
  height: 64px;
}

.header-side {
  min-width: 0;
}

.header-side-left {
  justify-self: start;
}

.header-side-right {
  justify-self: end;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link,
.nav-button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.nav-link:hover,
.nav-button:hover {
  background: var(--chip);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.inline-form {
  margin: 0;
}

.hero {
  padding: 36px 0 24px;
}

.tags-section {
  padding: 0 0 12px;
}

.hero h1 {
  font-family: 'Tajawal', sans-serif;
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.3;
}

.hero p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.section-title {
  margin: 10px 0 16px;
  font-family: 'Tajawal', sans-serif;
  font-size: 1.2rem;
}

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

.tag-chip {
  text-decoration: none;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid #ffd8c3;
  font-size: 0.92rem;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.15s;
}

.tag-chip:not(.active):hover {
  background: #ffdccb;
  border-color: var(--brand);
  transform: translateY(-1px);
}

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

.clear-filter {
  text-decoration: none;
  color: var(--brand-dark);
  font-weight: 700;
  transition: color 0.15s;
}

.clear-filter:hover {
  color: var(--brand);
}

.top-banner {
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--line);
  margin-bottom: 24px;
  max-height: 240px;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 6px 10px;
}

.lang-link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
}

.lang-link.active {
  color: var(--ink);
}

.jobs-section {
  padding: 16px 0 48px;
}

.job-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.job-row:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.09);
  transform: translateY(-2px);
}

.job-row-new {
  animation: jobReveal 0.38s ease;
}

@keyframes jobReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.job-image-wrap {
  text-decoration: none;
}

.job-image {
  width: 120px;
  height: 84px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #efe8dc;
  display: grid;
  place-items: center;
  color: #8d857b;
}

.job-content {
  min-width: 0;
}

.job-meta-block {
  margin: 6px 0 0;
}

.job-meta-line {
  margin: 2px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.job-meta-label {
  font-weight: 700;
  color: #5c5752;
}

.job-title {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  font-size: 1.05rem;
  transition: color 0.15s;
}

.job-title:hover {
  color: var(--brand);
}

.job-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.views-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf3;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.eye-icon {
  position: relative;
  width: 18px;
  height: 12px;
  border: 2px solid #9f9588;
  border-radius: 100px / 70px;
}

.eye-icon::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9f9588;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.details-views {
  margin: 0 0 12px;
}

.job-meta {
  margin: 6px 0 0;
  color: var(--muted);
}

.light-separator {
  border: none;
  border-top: 1px solid var(--line);
}

.show-more-wrap {
  margin-top: 20px;
  text-align: center;
}

.show-more,
.primary-btn,
.whatsapp-button {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  background: var(--brand);
  color: white;
  font-weight: 800;
  font-size: 1rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s, box-shadow 0.18s;
  letter-spacing: 0.01em;
}

.show-more:hover,
.primary-btn:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(214, 79, 42, 0.3);
}

.whatsapp-button {
  background: #25c765;
  display: flex;
  align-items: center;
  justify-content: center;
}

.whatsapp-button:hover {
  background: #1aad54;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 199, 101, 0.35);
}

.show-more.is-loading {
  opacity: 0.85;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  color: var(--muted);
  background: rgba(255, 253, 249, 0.92);
  margin-top: 8px;
}

.site-footer p {
  text-align: center;
  font-size: 0.9rem;
}

.auth-page {
  padding: 40px 0 70px;
}

.auth-card,
.form-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 32px;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.07);
}

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

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
textarea {
  border: 1px solid #d8d2c9;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}

select {
  border: 1px solid #d8d2c9;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(214, 79, 42, 0.12);
}

.tags-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-suggest-btn {
  border: 1px solid #e3d3be;
  background: #fff4e8;
  color: #5b5248;
  border-radius: 999px;
  padding: 6px 11px;
  font-weight: 700;
  cursor: pointer;
}

.tag-suggest-btn:hover {
  background: #ffe8d3;
}

.image-source-group {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.image-source-group legend {
  padding: 0 8px;
  font-weight: 800;
}

.radio-inline-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e3d8ca;
  border-radius: 999px;
  background: #fff9f2;
  padding: 7px 12px;
  font-weight: 700;
}

.radio-inline input {
  margin: 0;
}

.image-option-panel {
  display: none;
  margin: 0;
}

.image-option-panel.is-active {
  display: grid;
}

.gallery-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.gallery-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 10px;
}

.gallery-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.gallery-url {
  margin: 8px 0;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}

.gallery-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.used-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6c5f43;
  background: #fff2cf;
  border: 1px solid #ead8a2;
  border-radius: 999px;
  padding: 5px 8px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.error-text {
  color: #b32323;
  font-weight: 700;
}

.success-text {
  color: #1f7a3f;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.job-page {
  padding: 24px 0 54px;
}

.back-title {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin-bottom: 12px;
}

.back-title h1 {
  margin: 0;
  font-size: 1rem;
  text-align: center;
  color: var(--muted);
}

.job-sequence {
  justify-self: end;
  font-size: 0.86rem;
  font-weight: 800;
  color: #8f8578;
}

.back-arrow {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 1.2rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.back-arrow:hover {
  background: var(--chip);
  border-color: var(--brand);
  color: var(--brand);
}

.job-main-title {
  margin: 0 0 14px;
  font-family: 'Tajawal', sans-serif;
}

.details-image {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  margin-bottom: 14px;
  max-height: 360px;
  object-fit: cover;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  padding: 16px;
  transition: box-shadow 0.18s, transform 0.18s;
}

.detail-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.detail-card h3 {
  margin: 0 0 6px;
}

.requirements ul {
  margin-top: 10px;
  padding-left: 20px;
}

.whatsapp-button {
  margin: 12px 0 20px;
}

.related-jobs h3 {
  margin: 18px 0 12px;
}

.related-list {
  display: grid;
  gap: 12px;
}

.related-item {
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--paper);
  color: var(--ink);
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 12px;
  transition: box-shadow 0.18s, transform 0.18s;
}

.related-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.related-image {
  width: 108px;
  height: 76px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: #8d857b;
  background: #efe8dc;
}

.related-item h4 {
  margin: 0 0 6px;
}

.related-item p {
  margin: 0;
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
}

.admin-controls,
.admin-list-actions,
.admin-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-controls {
  margin: 0 0 14px;
}

.admin-edit-link {
  display: inline-block;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 10px 16px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}

.admin-edit-link:hover {
  background: var(--chip);
  border-color: var(--brand);
  color: var(--brand-dark);
}

.danger-btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  background: #c83535;
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
}

.danger-btn:hover {
  background: #a62b2b;
  transform: translateY(-1px);
}

.danger-btn.small {
  padding: 7px 12px;
  font-size: 0.88rem;
}

.admin-list-actions {
  margin-top: 8px;
}

.admin-list-actions form,
.admin-controls form {
  margin: 0;
}

@media (max-width: 768px) {
  .header-inner {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .header-side-left,
  .header-side-right {
    justify-self: center;
  }

  .logo-image {
    height: 100px;
  }

  .job-row {
    grid-template-columns: 86px 1fr;
    padding: 12px;
  }

  .job-row:hover {
    transform: none;
  }

  .job-title-row {
    display: block;
  }

  .job-content {
    position: relative;
    padding-top: 34px;
  }

  .job-row .views-indicator {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    white-space: nowrap;
    font-size: 0.80rem;
    padding: 6px 12px;
  }

  .eye-icon {
    width: 20px;
    height: 13px;
  }

  .eye-icon::after {
    width: 6px;
    height: 6px;
  }

  .job-image {
    width: 86px;
    height: 70px;
  }

  .two-col,
  .details-grid,
  .related-item {
    grid-template-columns: 1fr;
  }

  .related-image {
    width: 100%;
    height: 130px;
  }

  .auth-card,
  .form-card {
    padding: 20px 18px;
  }

  .detail-card:hover,
  .related-item:hover {
    transform: none;
  }
}

@media (max-width: 480px) {
  .job-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 14px;
  }

  .job-img-container,
  .job-image-wrap {
    display: block;
    width: 100%;
  }

  .job-image {
    width: 100%;
    height: 160px;
    border-radius: 12px;
  }

  .job-content {
    padding-top: 0;
  }

  .job-row .views-indicator {
    position: static;
    display: inline-flex;
    margin-bottom: 8px;
  }

  .job-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    display: flex;
  }

  .hero {
    padding: 20px 0 14px;
  }

  .top-banner {
    border-radius: 14px;
    margin-bottom: 16px;
  }
}

/* ── Job badges ─────────────────────────────── */
.job-img-container {
  position: relative;
  align-self: start;
}

.job-badge {
  position: absolute;
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  pointer-events: none;
  z-index: 2;
}

.badge-new {
  top: 6px;
  inset-inline-start: 6px;
  background: #e8a800;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.badge-closed {
  top: 6px;
  inset-inline-end: 6px;
  background: rgba(25, 20, 15, 0.68);
  color: #fff;
}

.badge-draft {
  bottom: 6px;
  inset-inline-start: 6px;
  background: #6b5ecd;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.job-draft {
  opacity: 0.72;
  outline: 2px dashed #6b5ecd;
  outline-offset: -2px;
}

.job-closed .job-image,
.job-closed .job-image.placeholder {
  opacity: 0.42;
  filter: grayscale(30%);
}

/* ── Job details: closed banner ─────────────── */
.closed-banner {
  background: #fff0ed;
  border: 1px solid #f5c4bc;
  border-radius: 12px;
  padding: 12px 16px;
  color: #c13a1c;
  font-weight: 700;
  text-align: center;
  margin-bottom: 14px;
}

.draft-banner {
  background: #f0eeff;
  border: 1px solid #c5bdf5;
  border-radius: 12px;
  padding: 12px 16px;
  color: #4b3baa;
  font-weight: 700;
  text-align: center;
  margin-bottom: 14px;
}

.details-image.is-closed {
  opacity: 0.55;
  filter: grayscale(20%);
}

/* ── Checkbox toggle rows in admin forms ────── */
.toggle-row-group {
  margin-top: 4px;
}

.publish-toggle {
  border-color: #c5bdf5;
  background: #f5f2ff;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand);
  flex-shrink: 0;
  padding: 0;
  border: none;
  box-shadow: none;
}

/* ── Contact section ────────────────────────── */
.contact-section {
  padding: 32px 0 16px;
}

.contact-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px 28px;
  text-align: center;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
}

.contact-ad-msg {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 18px;
}

.contact-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  background: #fff;
  transition: background 0.18s, border-color 0.18s;
}

.contact-item:hover {
  background: var(--chip);
  border-color: var(--brand);
}

/* ── Compact header (scroll) ────────────────── */
@media (max-width: 768px) {
  .logo-image {
    height: 100px;
  }

  .site-header.compact .logo-image {
    height: 56px;
  }
}
