/* ============================================================
   KRS Training & Projects — Design tokens, v2
   Direction: clean editorial/corporate (BCG-style structure):
   white canvas, one restrained accent, serif headlines, thin
   hairline rules, card-grid "insights" rhythm, generous space.
   Palette:  ink #161616, red #A8241C (KRS brand accent, used the
             way BCG uses its green), paper #FFFFFF, mist #F5F4F1,
             steel #5B5F63, line #E3E1DC
   Type:     Source Serif 4 (headlines) + Public Sans (body/UI)
   ============================================================ */

:root {
  --ink: #161616;
  --red: #A8241C;
  --red-dark: #7E1B15;
  --paper: #FFFFFF;
  --mist: #F5F4F1;
  --steel: #5B5F63;
  --steel-light: #8A8E92;
  --line: #E3E1DC;

  --display: "Source Serif 4", "Georgia", serif;
  --body: "Public Sans", "Segoe UI", sans-serif;

  --max: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.14;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.2rem; font-weight: 600; }

p { max-width: 62ch; color: var(--steel); }
p.wide { max-width: none; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------- Header / nav ----------------
   Thin, quiet, white — text links only, no colored chrome. */
header.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 38px; width: auto; }
.brand-text {
  font-family: var(--display);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-text small {
  display: block;
  font-family: var(--body);
  font-weight: 400;
  color: var(--steel-light);
  font-size: 0.7rem;
  letter-spacing: 0.01em;
}

nav.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
}

nav.primary-nav a {
  color: var(--ink);
  font-size: 0.95rem;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
nav.primary-nav a:hover,
nav.primary-nav a.active { color: var(--red); border-color: var(--red); }

.nav-cta {
  color: var(--red) !important;
  font-weight: 600;
}
.nav-cta::after { content: " →"; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 12px;
  font-family: var(--body);
}

@media (max-width: 860px) {
  nav.primary-nav { display: none; width: 100%; order: 3; }
  nav.primary-nav.open { display: block; }
  nav.primary-nav ul {
    flex-direction: column; gap: 0;
    border-top: 1px solid var(--line);
    margin-top: 14px; padding-top: 10px;
  }
  nav.primary-nav li { border-bottom: 1px solid var(--line); }
  nav.primary-nav a { display: block; padding: 12px 2px; }
  .nav-toggle { display: block; }
  .nav-inner { flex-wrap: wrap; }
}

/* ---------------- Hero ----------------
   Editorial hero: kicker word, large serif headline, one quiet
   CTA link. No photography needed — restrained, text-led. */
.hero {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero .container { padding-top: 76px; padding-bottom: 64px; max-width: 880px; }

/* Hero variant with a photo alongside the text, homepage only */
.hero.with-media .container {
  max-width: var(--max);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero-photo {
  height: 100%;
  min-height: 340px;
  background-size: cover;
  background-position: center;
}
@media (max-width: 900px) {
  .hero.with-media .container { grid-template-columns: 1fr; }
  .hero-photo { min-height: 240px; order: -1; }
}

/* Full-width photo banner under an interior page header */
.page-photo {
  height: 320px;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 700px) { .page-photo { height: 200px; } }
.hero-tag {
  display: block;
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}
.hero h1 { color: var(--ink); }
.hero p.lede { color: var(--steel); font-size: 1.15rem; max-width: 56ch; margin-top: 18px; }
.hero-actions { margin-top: 30px; display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }

/* ---------------- Links / buttons ---------------- */
.link-arrow { color: var(--red); font-weight: 600; }
.link-arrow::after { content: " →"; transition: margin-left 0.15s ease; }
.link-arrow:hover::after { margin-left: 4px; }

.btn {
  display: inline-block;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 26px;
  border: 1px solid var(--ink);
  color: var(--ink);
}
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: var(--red); border-color: var(--red); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-on-dark { border-color: #fff; color: #fff; }
.btn-on-dark:hover { background: #fff; color: var(--ink); }

/* ---------------- Sections ---------------- */
section { padding: 72px 0; }
section.tight { padding: 48px 0; }
section.on-mist { background: var(--mist); }
section.on-ink { background: var(--ink); color: #fff; }
section.on-ink p { color: #C9C9C9; }
section.on-ink h2 { color: #fff; }
section + section { border-top: 1px solid var(--line); }

.eyebrow {
  color: var(--red);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-head { max-width: 680px; margin-bottom: 40px; }

/* ---------------- Insight-style card grid ----------------
   Mirrors an editorial article-card rhythm: tag / headline /
   teaser / Learn More link, laid out as a clean grid with a
   colour block standing in for photography. */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}
.card-grid .card {
  background: var(--paper);
  padding: 30px;
  display: flex;
  flex-direction: column;
}
.card-media {
  height: 140px;
  margin: -30px -30px 20px;
  background: var(--ink) center / cover no-repeat;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 14px 18px;
}
.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0));
}
.card-media span {
  position: relative;
  z-index: 1;
  color: #fff;
  font-family: var(--display);
  font-size: 1.4rem;
}
.card .tag { color: var(--red); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: 10px; }
.card h3 { margin-bottom: 8px; }
.card p { font-size: 0.95rem; margin-bottom: 16px; }
.card .more { margin-top: auto; }

@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* ---------------- Stat row ---------------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 44px 0;
}
.stat { padding: 26px 24px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; }
.stat .num { font-family: var(--display); font-size: 2.1rem; color: var(--ink); line-height: 1; }
.stat .label { color: var(--steel); font-size: 0.88rem; margin-top: 6px; }
@media (max-width: 760px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; }
}

/* ---------------- Generic grids ---------------- */
.grid { display: grid; gap: 32px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* Accreditation list — simple hairline rows, not decorative cards */
.accred-list { list-style: none; padding: 0; margin: 0; }
.accred-list li {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.accred-list li:first-child { border-top: 1px solid var(--line); }
.accred-list .idx { color: var(--steel-light); font-variant-numeric: tabular-nums; }

/* Training rows */
.training-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  border-top: 1px solid var(--line);
  padding: 26px 0;
  gap: 20px;
}
.training-row:last-child { border-bottom: 1px solid var(--line); }
.training-row h3 { margin: 0; }
.training-row p { margin: 0; font-size: 0.95rem; }
@media (max-width: 700px) { .training-row { grid-template-columns: 1fr; gap: 8px; } }

/* Project entries */
.project-entry { padding: 26px 0; border-top: 1px solid var(--line); }
.project-entry:last-child { border-bottom: 1px solid var(--line); }
.project-entry .meta { color: var(--red); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: 8px; }
.project-entry h3 { margin-bottom: 8px; }

/* Team */
.team-card { padding: 28px 0; border-top: 1px solid var(--line); display: flex; gap: 20px; align-items: center; }
.team-card:last-child { border-bottom: 1px solid var(--line); }
.team-initials {
  min-width: 56px; height: 56px;
  background: var(--ink); color: #fff;
  font-family: var(--display); font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.team-card h3 { margin-bottom: 2px; }
.team-role { color: var(--red); font-size: 0.85rem; font-weight: 600; }

/* ---------------- Contact ---------------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 56px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-item { padding: 18px 0; border-bottom: 1px solid #333; display: flex; gap: 14px; }
.contact-item .ic { color: var(--steel-light); min-width: 90px; font-size: 0.85rem; padding-top: 2px; }

form.enquiry { background: var(--mist); padding: 36px; border: 1px solid var(--line); }
form.enquiry label { display: block; font-size: 0.85rem; font-weight: 600; margin: 18px 0 6px; color: var(--ink); }
form.enquiry label:first-of-type { margin-top: 0; }
form.enquiry input, form.enquiry select, form.enquiry textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  background: var(--paper); font-family: var(--body); font-size: 0.98rem; color: var(--ink);
}
form.enquiry textarea { resize: vertical; min-height: 110px; }
form.enquiry .btn { margin-top: 22px; width: 100%; border: none; }
.form-note { color: var(--steel-light); font-size: 0.82rem; margin-top: 12px; }

/* Full-bleed photo section with dark overlay (photo variant of on-ink) */
.section-photo {
  position: relative;
  background-size: cover;
  background-position: center;
  color: #fff;
}
.section-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.72);
}
.section-photo .container { position: relative; z-index: 1; }
.section-photo p { color: #D8D8D8; }
.section-photo h2 { color: #fff; }

/* ---------------- CTA band ---------------- */
.cta-band { background: var(--ink); color: #fff; padding: 54px 0; }
.cta-band h2 { color: #fff; margin-bottom: 6px; }
.cta-band .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band p { color: #C9C9C9; margin: 0; }

/* ---------------- Footer ---------------- */
footer.site-footer { background: var(--paper); color: var(--steel); padding: 54px 0 26px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
footer.site-footer h4 { color: var(--ink); font-size: 0.9rem; margin-bottom: 14px; font-weight: 600; }
footer.site-footer a:hover { color: var(--red); }
footer.site-footer ul { list-style: none; padding: 0; margin: 0; }
footer.site-footer li { margin-bottom: 10px; font-size: 0.92rem; }
.footer-bottom { padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 0.82rem; color: var(--steel-light); }

/* ---------------- Page header (interior pages) ---------------- */
.page-header { background: var(--paper); border-bottom: 1px solid var(--line); padding: 56px 0 42px; }
.page-header h1 { font-size: clamp(2rem, 3.6vw, 2.8rem); }
.page-header p { color: var(--steel); max-width: 60ch; margin-top: 12px; }
.breadcrumb { font-size: 0.82rem; color: var(--steel-light); margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--red); }
