:root {
  color-scheme: light; /* stop forced-dark browsers from recoloring text */
  --red: #E63946;
  --red-dark: #C42A37;
  --red-soft: #FDEDEE;
  --bg: #F7F7F8;
  --card: #FFFFFF;
  --border: #EBEBEE;
  --ink: #16171B;
  --body: #45474E;
  --muted: #6B6D75;       /* was #8E8E93 — failed WCAG contrast */
  --shadow: 0 1px 2px rgba(22, 23, 27, .04), 0 10px 28px -14px rgba(22, 23, 27, .14);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 360px at 85% -120px, rgba(230, 57, 70, .07), transparent 70%) no-repeat,
    var(--bg);
  color: var(--body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Khmer", "Khmer OS", Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Links: explicit color for every state so nothing ever falls back to
   the browser's default navy / visited-purple. */
a { color: var(--red); }
a:visited { color: var(--red); }
a:hover { color: var(--red-dark); }

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 18px 64px;
}

/* ─── Header ─── */
header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand .brandmark {
  width: 30px; height: 30px;
  border-radius: 9px;
  box-shadow: 0 4px 10px -3px rgba(230, 57, 70, .45);
  display: block;
  object-fit: cover;
}
.brand b { color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: -.01em; }

nav.top a {
  color: var(--body);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-left: 14px;
}
nav.top a:hover { color: var(--red); }

/* ─── Language toggle ─── */
.lang {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(22, 23, 27, .04);
}
.lang button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);          /* was muted gray — hard to read */
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.lang button:hover { background: var(--red-soft); color: var(--red-dark); }
.lang button.active {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 6px -1px rgba(230, 57, 70, .5);
}

/* ─── Cards ─── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

/* Hero (first card on the home page) */
.card.hero {
  background:
    radial-gradient(440px 200px at 100% 0%, rgba(230, 57, 70, .08), transparent 70%),
    var(--card);
  padding: 34px 28px;
}
.card.hero h1 { font-size: 28px; }
.card.hero p { font-size: 15px; max-width: 56ch; }

h1 { font-size: 23px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; margin: 0 0 6px; }
.date { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
h2 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 24px 0 6px; }
p { font-size: 14px; margin: 0 0 8px; }
ul { margin: 0 0 8px; padding-left: 0; list-style: none; }
li { font-size: 14px; padding-left: 18px; position: relative; margin-bottom: 6px; }
li::before { content: "•"; color: var(--red); font-weight: 700; position: absolute; left: 2px; }

.step { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.step .num {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 1px;
}

/* Contact links — works for BOTH <a class="contact"> and .contact <a> */
.contact, .contact a, a.contact {
  color: var(--red);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
a.contact:visited, .contact a:visited { color: var(--red); }
a.contact:hover, .contact a:hover { color: var(--red-dark); text-decoration: underline; }

/* ─── Link cards (home grid) ─── */
.cards-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .cards-grid { grid-template-columns: 1fr; } }
.link-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  color: var(--body);           /* never inherit the UA link navy */
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.link-card:visited { color: var(--body); }
.link-card:hover {
  border-color: rgba(230, 57, 70, .45);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(22, 23, 27, .05), 0 16px 32px -16px rgba(230, 57, 70, .25);
}
.link-card .ic {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 13px;
  background: var(--red-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}
.link-card h3 { margin: 0 0 3px; color: var(--ink); font-size: 16px; font-weight: 700; }
.link-card p { margin: 0; color: var(--muted); font-size: 13px; }
.link-card::after {
  content: "→";
  position: absolute;
  right: 18px; top: 20px;
  color: var(--muted);
  font-weight: 700;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .15s, transform .15s, color .15s;
}
.link-card:hover::after { opacity: 1; transform: none; color: var(--red); }

/* ─── Footer ─── */
footer.site { margin-top: 32px; font-size: 12.5px; color: var(--muted); text-align: center; }
footer.site a { color: var(--muted); font-weight: 600; }
footer.site a:visited { color: var(--muted); }
footer.site a:hover { color: var(--red); }

/* Keyboard focus */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Language switching */
.km { display: none; }
body.km-on .en { display: none; }
body.km-on .km { display: block; }
/* Keep the bilingual footer link inline (overrides the block rule above). */
body.km-on footer.site .km { display: inline; }
