/* ==========================================================================
   International School Jobs - global styles
   Layout and components follow the MathCardo design language (design tokens,
   card grid, hero, badge, pill buttons). The palette is its own.
   ========================================================================== */

:root {
  --bg: #f5f9f9;
  --surface: #ffffff;
  --surface-2: #fbfdfd;
  --ink: #0f2420;
  --ink-soft: #566a66;
  --ink-faint: #8a9b97;
  --line: #e0ecea;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #e4f2f0;
  --accent: #f59e0b;
  --good: #16a34a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 36, 32, 0.04), 0 8px 24px rgba(15, 36, 32, 0.06);
  --shadow-lg: 0 2px 4px rgba(15, 36, 32, 0.05), 0 18px 48px rgba(15, 36, 32, 0.12);
  --maxw: 1180px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.8vw, 2rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.logo:hover { text-decoration: none; }

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #2bb3a6);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.35);
}

.nav { display: flex; gap: 20px; align-items: center; font-size: 0.93rem; font-weight: 600; flex-wrap: wrap; }
.nav a { color: var(--ink-soft); }
.nav a:hover { color: var(--brand); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--brand); }

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

.hero {
  padding: 64px 0 48px;
  text-align: center;
  background:
    radial-gradient(900px 380px at 50% -140px, #d9efec 0%, transparent 70%),
    var(--bg);
}

.hero p.lead {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 660px;
  margin: 0 auto 26px;
}

.badge {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.96rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(15, 118, 110, 0.28); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.btn-ghost:hover { border-color: #c8dedb; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.stats {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}
.stat { text-align: center; }
.stat b { display: block; font-size: 1.6rem; letter-spacing: -0.03em; color: var(--brand-dark); }
.stat span { font-size: 0.84rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- Sections ---------- */

section { padding: 48px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 32px; }
.section-head p { color: var(--ink-soft); margin: 0; }
.section-head.left { text-align: left; margin-left: 0; }

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.crumbs { font-size: 0.85rem; color: var(--ink-faint); padding: 14px 0 0; }
.crumbs a { color: var(--ink-soft); }
.crumbs span { margin: 0 6px; }

/* ---------- Card grids ---------- */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.topic-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: block;
  color: inherit;
}
.topic-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #c8dedb;
}

.topic-card .icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.topic-card h3 { margin-bottom: 4px; }
.topic-card p { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 8px; }
.topic-card .count { font-size: 0.8rem; color: var(--ink-faint); font-weight: 700; }

@media (max-width: 720px) {
  .topic-card { text-align: center; }
  .topic-card .icon { margin: 0 auto 12px; }
}

/* ---------- Region directory ---------- */

.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.region-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.region-card h3 { margin-bottom: 4px; font-size: 1.05rem; }
.region-card .count { font-size: 0.82rem; color: var(--ink-faint); margin-bottom: 12px; display: block; }

.region-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.region-card li { font-size: 0.92rem; }
.region-card li a { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.region-card li a span { color: var(--ink-faint); font-size: 0.83rem; white-space: nowrap; }

.sub-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sub-links a {
  font-size: 0.78rem;
  background: var(--brand-soft);
  color: var(--brand-dark);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
}
.sub-links a:hover { background: var(--brand); color: #fff; text-decoration: none; }

/* ---------- Filters ---------- */

.filters {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 26px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px 18px;
  align-items: start;
}
.filter-row + .filter-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

.filter label, .filter-label {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}

.filter select {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.filter-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--ink-soft);
  flex-wrap: wrap;
}

/* ---------- Job list ---------- */

.job-list { display: grid; gap: 14px; }

.job {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.job[hidden] { display: none; }

.job h3 { margin: 0 0 6px; font-size: 1.06rem; }
.job h3 a { color: var(--ink); }
.job h3 a:hover { color: var(--brand); text-decoration: none; }

.job-meta {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}
.job-meta .dot { color: var(--ink-faint); }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  white-space: nowrap;
}
.tag.cat { background: #eef2fb; color: #2f4d8f; }
.tag.loc { background: #fdf1dd; color: #92600d; }

.job-desc {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.job-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.job-foot .closing { font-size: 0.82rem; color: var(--ink-faint); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* ---------- Breadcrumbs / nav strips ---------- */

.link-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.link-strip a {
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  color: var(--ink-soft);
}
.link-strip a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

/* ---------- School list ---------- */

.school-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.school-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: block;
  color: inherit;
}
.school-card:hover { text-decoration: none; border-color: #c8dedb; box-shadow: var(--shadow-lg); }
.school-card h3 { margin: 0 0 3px; font-size: 1rem; }
.school-card .where { font-size: 0.83rem; color: var(--ink-soft); margin: 0 0 6px; }
.school-card .count { font-size: 0.8rem; color: var(--brand-dark); font-weight: 700; }
.school-card .none { font-size: 0.8rem; color: var(--ink-faint); }

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

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 36px 0 28px;
  margin-top: 40px;
}
.site-footer .cols {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 2fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr; } }
.footer-about { color: var(--ink-soft); font-size: 0.9rem; margin: 12px 0 0; max-width: 46ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.88rem; }
.copy {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.legal-links { display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Utilities ---------- */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.text-center { text-align: center; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.86rem; }
.nowrap { white-space: nowrap; }
