/* ==========================================================================
   Job board — iOS-flavoured premium theme
   Colours come from admin settings and are injected as CSS variables.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, .04), 0 1px 3px rgba(11, 18, 32, .05);
  --shadow-md: 0 2px 8px rgba(11, 18, 32, .06), 0 8px 24px rgba(11, 18, 32, .06);
  --shadow-lg: 0 10px 40px rgba(11, 18, 32, .12);
  --wrap: 980px;
  --gap: 12px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.022em; font-weight: 700; }
p { margin: 0 0 1em; }
ol, ul { margin: 0; padding: 0; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--surface); padding: .75rem 1rem; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.dot { margin: 0 .4em; color: color-mix(in srgb, var(--muted) 60%, transparent); }

/* ------------------------------ Header ---------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: -.02em; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 35%, transparent);
}
.brand__img { height: 30px; width: auto; }
.brand__text { font-size: 17px; }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--ink); font-size: 15px; font-weight: 500;
  padding: 7px 12px; border-radius: 999px;
}
.site-nav a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }

/* ------------------------------- Hero ----------------------------------- */

.hero { padding: 40px 0 20px; text-align: center; }
.hero__title { font-size: clamp(28px, 6vw, 40px); line-height: 1.1; letter-spacing: -.035em; }
.hero__sub { margin: 10px 0 0; color: var(--muted); font-size: clamp(15px, 2.5vw, 17px); }

/* ------------------------------ Search ---------------------------------- */

.searchbar { padding: 20px 0 8px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.searchcard { padding: 14px; box-shadow: var(--shadow-md); }

/* iOS segmented control */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 2px; padding: 2px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  border-radius: 11px;
}
.segmented__item {
  text-align: center; padding: 7px 10px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--ink);
  transition: background .18s ease, box-shadow .18s ease, transform .1s ease;
}
.segmented__item:active { transform: scale(.98); }
.segmented__item.is-active {
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(11, 18, 32, .12), 0 1px 1px rgba(11, 18, 32, .06);
}

.searchform {
  display: grid; gap: 8px;
  grid-template-columns: 1fr;
}
.field {
  display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  border-radius: 12px; padding: 0 14px; min-height: 46px;
}
.field__icon { color: var(--muted); display: grid; place-items: center; flex: none; }
.field__icon svg { width: 19px; height: 19px; }
.field input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  font: inherit; font-size: 16px; color: var(--ink); padding: 12px 0;
}
.field input::placeholder { color: color-mix(in srgb, var(--muted) 85%, transparent); }
.field input::-webkit-search-cancel-button { -webkit-appearance: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 16px;
  padding: 12px 20px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; transition: transform .1s ease, background .18s ease, box-shadow .18s ease;
}
.btn:active { transform: scale(.98); }
.btn--primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--primary) 40%, transparent),
              0 6px 18px color-mix(in srgb, var(--primary) 25%, transparent);
}
.btn--primary:hover { background: var(--primary-dark); }
.btn--ghost { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.btn--ghost:hover { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.searchform__submit { min-height: 46px; }

.activefilters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.activefilters__hint { font-size: 13px; color: var(--muted); }
.chip--filter {
  display: inline-flex; align-items: center; gap: 8px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary-dark); border-radius: 999px;
  padding: 6px 8px 6px 13px; font-size: 14px; font-weight: 600;
}
.chip--filter a { color: inherit; font-size: 17px; line-height: 1; opacity: .6; padding: 0 4px; }
.chip--filter a:hover { opacity: 1; }

/* ------------------------------ Results --------------------------------- */

.results { padding: 18px 0 56px; }
.results__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.results__head { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 4px 12px; }
.results__count { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.results__page { font-size: 13px; color: var(--muted); }

.list { list-style: none; display: block; }
.list__item, .list__ad { display: block; margin-bottom: var(--gap); }
.list__item:last-child { margin-bottom: 0; }

.jobcard {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease;
}
.jobcard:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}
.jobcard:active { transform: scale(.995); }

.jobcard__logo {
  width: 46px; height: 46px; margin-top: 1px; flex: none; border-radius: 13px;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(155deg,
    color-mix(in srgb, var(--primary) 14%, var(--surface)),
    color-mix(in srgb, var(--primary) 6%, var(--surface)));
  color: var(--primary-dark);
  font-weight: 700; font-size: 19px;
  border: 1px solid color-mix(in srgb, var(--primary) 12%, transparent);
}
.jobcard__logo img { width: 100%; height: 100%; object-fit: cover; }

.jobcard__body { display: block; min-width: 0; }
.jobcard__title {
  font-size: 17px; font-weight: 650; letter-spacing: -.02em;
  line-height: 1.3; margin: 0 0 3px;
}
.jobcard__title a { color: var(--ink); }
/* Stretch the title link over the whole card: the card stays one click target
   while the text itself sits outside the anchor, where ad and reader tools
   can still see it as content. */
.jobcard__title a::after { content: ""; position: absolute; inset: 0; }
.jobcard__meta { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.jobcard__meta strong { color: var(--ink); font-weight: 600; }

.jobcard__desc {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: var(--clamp-lines);
  line-clamp: var(--clamp-lines);
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px; line-height: 1.55; color: var(--muted);
}

.jobcard__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.tag {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 600; letter-spacing: -.005em;
  padding: 4px 9px; border-radius: 8px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  color: color-mix(in srgb, var(--ink) 78%, transparent);
}
.tag--salary {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: color-mix(in srgb, var(--accent) 88%, black);
}
.tag--count { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary-dark); }
.tag--quiet { background: none; color: var(--muted); padding-left: 0; }
.tag--featured {
  margin-left: 8px; vertical-align: 2px;
  background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary-dark);
}

.chevron { color: color-mix(in srgb, var(--muted) 55%, transparent); flex: none; align-self: center; position: relative; }
.chevron svg { width: 9px; height: 15px; }

.empty { padding: 40px 24px; text-align: center; }
.empty h3, .empty h1 { font-size: 19px; margin-bottom: 6px; }
.empty p { color: var(--muted); }

/* ------------------------------- Ads ------------------------------------ */

.ad-slot {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
  text-align: center;
}
.ad-slot__label {
  display: block; font-size: 10px; letter-spacing: .09em; text-transform: uppercase;
  color: color-mix(in srgb, var(--muted) 75%, transparent); margin-bottom: 8px;
}
.ad-slot__body { min-height: 90px; display: block; width: 100%; }
/* An unfilled unit should collapse rather than leave a labelled empty box. */
.ad-slot--empty { display: none !important; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
/* AdSense measures the ins element itself. It must be a full-width block or the
   loader reports availableWidth=0 and refuses to fill the slot. */
.ad-slot__body .adsbygoogle { display: block; width: 100%; }
.ad-slot__body > * { max-width: 100%; }
.ad-slot--banner { margin: 12px auto; max-width: var(--wrap); }
.prose .ad-slot { margin: 22px 0; }
@media (max-width: 640px) {
  .prose { padding: 18px; }
  /* Break the in-description ad out to the full card width and drop its side
     padding. On a 320px phone this is the difference between a slot Google will
     fill and one that falls under the 250px minimum for multiplex units. */
  .prose .ad-slot {
    margin-left: -18px; margin-right: -18px;
    padding-left: 0; padding-right: 0; border-radius: 0;
  }
}
@media (max-width: 380px) {
  .wrap { padding: 0 14px; }
  .ad-slot { padding-left: 6px; padding-right: 6px; }
}

/* ----------------------------- Pagination -------------------------------- */

.pager { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.pager__pages { display: flex; gap: 4px; }
.pager__nav, .pager__num, .pager__gap {
  min-width: 40px; height: 40px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; font-size: 15px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.pager__num { padding: 0 6px; }
.pager__gap { background: none; border: 0; box-shadow: none; color: var(--muted); min-width: 24px; }
.pager__nav:hover, .pager__num:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.pager__num.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ------------------------------ Job page --------------------------------- */

.jobpage { padding: 24px 0 56px; }
.jobpage__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.jobpage__main { display: grid; gap: var(--gap); }

.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; padding: 0 4px 4px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }

.jobhead { padding: 22px; }
.jobhead__top { display: flex; gap: 14px; align-items: flex-start; }
.jobhead__logo { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
.jobhead__title { font-size: clamp(22px, 4vw, 28px); line-height: 1.2; letter-spacing: -.03em; }
.jobhead__meta { margin: 6px 0 0; font-size: 15px; color: var(--muted); }
.jobhead__meta a { font-weight: 600; }
.jobhead__tags { margin-top: 16px; }
.jobhead__apply { margin-top: 18px; width: 100%; }

.prose { padding: 24px; font-size: 16px; line-height: 1.65; }
.prose__heading { font-size: 19px; margin-bottom: 14px; }
.prose__subheading { font-size: 16px; margin: 22px 0 8px; }
.prose ul { padding-left: 20px; margin-bottom: 1em; }
.prose li { margin-bottom: .4em; }
.prose p:last-child { margin-bottom: 0; }
.prose__cta { margin-top: 24px; margin-bottom: 0; }

.related { margin-top: 20px; }
.related__title { font-size: 17px; margin: 0 4px 12px; }

.static { padding: 32px 0 56px; }
.static__wrap { max-width: 760px; }
.static__title { font-size: clamp(26px, 5vw, 34px); letter-spacing: -.03em; margin-bottom: 16px; }

.sticky { position: sticky; top: 76px; }

/* ------------------------------- Footer ---------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 0 40px;
  margin-top: auto;
}
.site-footer__inner { display: grid; gap: 14px; }
.site-footer__brand { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.site-footer__brand span { color: var(--muted); font-size: 14px; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.site-footer__links a { color: var(--muted); }
.site-footer__links a:hover { color: var(--primary); }
.site-footer__legal { font-size: 13px; color: color-mix(in srgb, var(--muted) 85%, transparent); margin: 0; }

/* ----------------------------- Responsive -------------------------------- */

@media (max-width: 480px) {
  .jobcard { padding: 14px; gap: 12px; }
  .jobcard__logo { width: 40px; height: 40px; border-radius: 11px; font-size: 17px; }
  .jobcard__title { font-size: 16px; }
  .searchcard { padding: 12px; }
  .hero { padding: 28px 0 14px; }
}

@media (min-width: 700px) {
  .searchform { grid-template-columns: 1.4fr 1fr auto; gap: 10px; }
  .hero { padding: 56px 0 24px; }
  .jobhead__apply { width: auto; min-width: 220px; }
}

@media (min-width: 1080px) {
  .results__layout.has-side,
  .jobpage__layout.has-side { grid-template-columns: minmax(0, 1fr) 300px; }
  :root { --wrap: 1140px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .btn:active, .jobcard:active, .segmented__item:active { transform: none; }
}

.ad-slot--test { border-style: dashed; }
.ad-slot__test {
  display: grid; place-items: center; min-height: 90px;
  font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted); background: color-mix(in srgb, var(--ink) 3%, transparent);
  border-radius: var(--radius-sm);
}

/* Admin-only ad debug overlay */
.ad-slot--debug { outline: 2px dashed color-mix(in srgb, var(--primary) 50%, transparent); outline-offset: 2px; }
.ad-slot--debug.ad-slot--empty { display: block !important; opacity: .55; }
.ad-slot__debug {
  display: block; margin-bottom: 6px; font-size: 11px; font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted); word-break: break-all;
}
.ad-slot__debug.is-good { color: #0F8F5F; }
.ad-slot__debug.is-bad { color: #C8321F; }
