/* =========================================================================
   BriefNepal Jobs — styles for /jobs pages.
   Reuses the site's design tokens (style.css) and layout primitives
   (.container, .layout, .widget, .btn, .chip). Mobile-first.
   Loaded ONLY on the jobs pages, so the dark-mode block here is scoped to
   /jobs and never affects the news pages.
   ========================================================================= */

/* ---------------- Hero / search ---------------- */
.jobs-hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; border-radius: var(--radius);
  padding: 28px 22px; margin-bottom: 26px;
}
.jobs-hero__title { font-family: var(--head); font-size: 1.7rem; line-height: 1.2; margin-bottom: 8px; }
.jobs-hero__sub { font-size: .98rem; opacity: .92; max-width: 60ch; margin-bottom: 18px; }
.jobs-hero__search { display: flex; gap: 8px; flex-wrap: wrap; }
.jobs-hero__input {
  flex: 1 1 240px; min-width: 0; border: 0; border-radius: var(--radius);
  padding: 13px 16px; font: inherit; font-size: 1rem; color: var(--text);
}
.jobs-hero__search .btn { white-space: nowrap; }

/* ---------------- Section head count ---------------- */
.section__count { font-size: .85rem; color: var(--text-faint); font-weight: 600; }

/* ---------------- Category grid ---------------- */
.jobs-cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.jobs-cat {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; transition: border-color .15s, box-shadow .15s;
}
.jobs-cat:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.jobs-cat__name { font-weight: 700; font-size: .95rem; color: var(--text); }
.jobs-cat__count { font-size: .78rem; color: var(--text-faint); }

/* ---------------- Job cards grid ---------------- */
.jobs-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }

.job-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.job-card:hover { border-color: var(--brand); box-shadow: var(--shadow-hover); }
.job-card__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-card__cat {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--brand); background: rgba(3, 78, 162, .08); padding: 3px 9px; border-radius: 999px;
}
.job-card__title { font-size: 1.08rem; line-height: 1.3; }
.job-card__title a { color: var(--text); }
.job-card__title a:hover { color: var(--brand); }
.job-card__company { font-size: .9rem; font-weight: 600; color: var(--text-soft); }
.job-card__meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: .82rem; color: var(--text-faint); }
.job-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.job-card__time { font-size: .78rem; color: var(--text-faint); }

/* Featured / sponsored badges */
.job-badge { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 3px 8px; border-radius: 999px; }
.job-badge--featured { background: #fff4d6; color: #8a6100; border: 1px solid #f0d68a; }
.job-badge--sponsored { background: #e7f6ec; color: #1b7a3d; border: 1px solid #b6e2c4; }

/* Pinned cards get a subtle accent */
.job-card:has(.job-badge--featured) { border-left: 3px solid #f0a830; }
.job-card:has(.job-badge--sponsored) { border-left: 3px solid #27ae60; }

/* ---------------- Load more ---------------- */
.jobs-more { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 22px; }
.jobs-more__status { font-size: .85rem; color: var(--text-faint); }

/* ---------------- Skeleton loading ---------------- */
.job-card--skeleton { pointer-events: none; }
.skel { background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%); background-size: 400% 100%; animation: skel 1.3s ease infinite; border-radius: 3px; display: block; }
.skel--line { height: 12px; margin: 7px 0; }
.skel--title { height: 18px; width: 80%; }
.skel--short { width: 45%; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ---------------- Subscribe widget ---------------- */
.jobs-subscribe__lede { font-size: .86rem; color: var(--text-soft); margin: 0 0 12px; }
.jobs-subscribe__form { display: flex; flex-direction: column; gap: 8px; }
.jobs-subscribe__form input, .jobs-subscribe__form select {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; font: inherit; font-size: .9rem;
  background: var(--surface); color: var(--text);
}
.jobs-subscribe__status { font-size: .82rem; min-height: 1em; }
.jobs-subscribe__status.is-ok { color: #1b7a3d; }
.jobs-subscribe__status.is-err { color: var(--accent); }

/* ---------------- Chips ---------------- */
.jobs-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.jobs-chips .chip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--text); transition: border-color .15s; }
.jobs-chips .chip:hover { border-color: var(--brand); color: var(--brand); }
.chip__n { font-size: .72rem; background: var(--bg); border-radius: 999px; padding: 1px 7px; color: var(--text-faint); }

/* ---------------- Job detail ---------------- */
.job-detail { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 24px; }
.job-detail__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.job-detail__title { font-family: var(--head); font-size: 1.7rem; line-height: 1.22; margin-bottom: 6px; }
.job-detail__company { font-size: 1.05rem; font-weight: 700; color: var(--brand); margin-bottom: 16px; }
.job-detail__facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; background: var(--bg); }
.job-fact { display: flex; flex-direction: column; gap: 2px; }
.job-fact__k { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--text-faint); font-weight: 700; }
.job-fact__v { font-size: .95rem; color: var(--text); font-weight: 600; }
.job-detail__cta { margin: 18px 0; }
.job-detail__cta--bottom { margin-top: 24px; }
.job-detail__body { margin-top: 8px; line-height: 1.7; color: var(--text-soft); }
.job-detail__body h2 { font-family: var(--head); font-size: 1.2rem; margin-bottom: 10px; color: var(--text); }
.job-detail__note { margin-top: 20px; padding: 12px 16px; background: var(--bg); border-left: 3px solid var(--brand); border-radius: var(--radius); font-size: .85rem; color: var(--text-faint); }

/* ---------------- Theme toggle button ---------------- */
.theme-toggle { background: none; border: 0; color: var(--text-soft); font: inherit; font-weight: 600; font-size: .76rem; cursor: pointer; padding: 0; }
.theme-toggle:hover { color: var(--brand); }

/* ---------------- Responsive ---------------- */
@media (min-width: 600px) {
  .jobs-grid { grid-template-columns: repeat(2, 1fr); }
  .jobs-cat-grid { grid-template-columns: repeat(3, 1fr); }
  .jobs-hero__title { font-size: 2rem; }
}
@media (min-width: 1000px) {
  .jobs-cat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ====================================================================
   Dark mode — scoped to the jobs pages (body[data-theme="dark"]).
   Redefines the shared tokens so every component recolours automatically.
   ==================================================================== */
body[data-theme="dark"] {
  --bg: #0f141a;
  --surface: #1a2129;
  --text: #e6e9ee;
  --text-soft: #b4bcc6;
  --text-faint: #8a93a0;
  --border: #2c3540;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, .5);
}
body[data-theme="dark"] { background: var(--bg); color: var(--text); }
body[data-theme="dark"] .datebar,
body[data-theme="dark"] .masthead,
body[data-theme="dark"] .nav,
body[data-theme="dark"] .footer { background: var(--surface); }
body[data-theme="dark"] .brand,
body[data-theme="dark"] .brand__name { color: var(--text); }
body[data-theme="dark"] .job-card__cat { background: rgba(78, 142, 220, .15); color: #6fa8e6; }
body[data-theme="dark"] .skel { background: linear-gradient(90deg, #232c36 25%, #2c3744 37%, #232c36 63%); background-size: 400% 100%; }
body[data-theme="dark"] .jobs-hero__input { background: #fff; color: #1a1a1a; }
