/* ==================================================================
   International survey on ADHD - country selection
   - English text: Public Sans (self-hosted, SIL OFL 1.1), a plain,
     highly legible typeface in the spirit of the HKU Med logo.
   - Country names in their own language use the visitor's system font,
     so every script shows in the font their device already uses.
   - No third-party requests (Google Fonts / CDNs), so the page also
     loads where those services are blocked or slow.
   ================================================================== */

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/public-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/public-sans-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/public-sans-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/public-sans-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --paper: #f4f6f8;
  --card: #ffffff;
  --ink: #17293a;
  --slate: #536371;
  --line: #d5dde4;
  --line-dashed: #b3c1cc;
  --harbour: #1f5f8b;
  --harbour-tint: #e8f1f8;

  --font-ui: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-native: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.55;
}

a {
  color: var(--harbour);
  text-underline-offset: 0.18em;
}

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--harbour);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Native-language text ---------- */

.native {
  font-family: var(--font-native);
}

.native:lang(zh-Hans) {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", var(--font-native);
}

.native:lang(zh-Hant) {
  font-family: "PingFang HK", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK HK", "Noto Sans CJK TC", "Noto Sans TC", var(--font-native);
}

.native:lang(ja) {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans CJK JP", "Noto Sans JP", var(--font-native);
}

.native:lang(ko) {
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", "Noto Sans KR", var(--font-native);
}

/* ---------- Logo bar ---------- */

.brand-bar {
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.brand-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  width: min(100%, 66rem);
  margin-inline: auto;
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
}

.logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: 3.25rem;
}

/* The a4a mark is a fine line drawing, so it needs more height than
   the dense HKU Med logo to carry the same visual weight. */
.logo-a4a {
  height: 5rem;
}

@media (max-width: 30rem) {
  .brand-inner {
    gap: 0.75rem 1rem;
  }

  .logo {
    height: 2.375rem;
  }

  .logo-a4a {
    height: 3.5rem;
  }
}

/* ---------- Page ---------- */

.page {
  width: min(100%, 66rem);
  margin-inline: auto;
  padding: clamp(1.75rem, 5vw, 3.25rem) clamp(1rem, 4vw, 2.5rem) clamp(3rem, 8vw, 5rem);
}

.intro {
  max-width: 52rem;
}

/* The full project title is long, so it is set smaller than a usual
   headline and allowed to break after the slash in the long word. */
h1 {
  margin: 0;
  font-size: clamp(1.4375rem, 1.1rem + 1.5vw, 2.125rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
  text-wrap: balance;
}

/* ---------- Introduction in seven languages ---------- */

.langs {
  max-width: 44rem;
  margin-top: 1.25rem;
  padding: 1rem 1.25rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.lang-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}

/* The real radio buttons are visually hidden; the labels are the buttons you see */
.langs {
  position: relative;
}

.lang-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
}

.lang-panel {
  display: none;
}

#lang-ar:checked ~ #intro-ar,
#lang-zh-hans:checked ~ #intro-zh-hans,
#lang-zh-hant:checked ~ #intro-zh-hant,
#lang-en:checked ~ #intro-en,
#lang-fr:checked ~ #intro-fr,
#lang-ru:checked ~ #intro-ru,
#lang-es:checked ~ #intro-es {
  display: block;
}

.globe-icon {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  margin-inline-end: 0.25rem;
  color: var(--slate);
}

.lang-tab {
  display: inline-flex;
  align-items: center;
  min-height: 2.375rem;
  padding: 0.25rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.lang-tab:hover {
  border-color: var(--harbour);
}

#lang-ar:checked ~ .lang-tabs [for="lang-ar"],
#lang-zh-hans:checked ~ .lang-tabs [for="lang-zh-hans"],
#lang-zh-hant:checked ~ .lang-tabs [for="lang-zh-hant"],
#lang-en:checked ~ .lang-tabs [for="lang-en"],
#lang-fr:checked ~ .lang-tabs [for="lang-fr"],
#lang-ru:checked ~ .lang-tabs [for="lang-ru"],
#lang-es:checked ~ .lang-tabs [for="lang-es"] {
  border-color: var(--harbour);
  background: var(--harbour);
  color: #ffffff;
}

#lang-ar:focus-visible ~ .lang-tabs [for="lang-ar"],
#lang-zh-hans:focus-visible ~ .lang-tabs [for="lang-zh-hans"],
#lang-zh-hant:focus-visible ~ .lang-tabs [for="lang-zh-hant"],
#lang-en:focus-visible ~ .lang-tabs [for="lang-en"],
#lang-fr:focus-visible ~ .lang-tabs [for="lang-fr"],
#lang-ru:focus-visible ~ .lang-tabs [for="lang-ru"],
#lang-es:focus-visible ~ .lang-tabs [for="lang-es"] {
  outline: 3px solid var(--harbour);
  outline-offset: 2px;
}

.intro-text {
  margin: 0;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
}

.intro-heading {
  margin: 1rem 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.intro-time {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.875rem 0 0;
}

/* The arrow sits inside the sentence and follows its size */
.intro-action {
  margin: 0.875rem 0 0;
  font-weight: 700;
}

.action-icon {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-inline-end: 0.3em;
  vertical-align: -0.08em;
  color: var(--harbour);
}

.time-icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15em;
  color: var(--slate);
}

.lang-panel .contact {
  margin-top: 0.5rem;
}

/* ---------- Contact ---------- */

.contact {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  max-width: 42rem;
  margin: 1rem 0 0;
}

.contact-icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15em;
  color: var(--slate);
}

.contact a {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.page-narrow .contact {
  display: block;
  max-width: none;
  margin-top: 1.25rem;
  text-align: center;
}

.page-narrow .contact-icon {
  display: inline-block;
  margin: 0 0.35rem 0 0;
  vertical-align: -0.25em;
}

/* ---------- Who can participate list ---------- */

.who-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.who-list li {
  position: relative;
  padding-inline-start: 1.25rem;
  line-height: 1.65;
}

.who-list li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  inset-inline-start: 0.2rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--harbour);
}

/* ---------- Section headings ---------- */

.countries {
  margin-top: clamp(2rem, 5vw, 3rem);
}

.soon {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  padding-top: clamp(1.75rem, 4vw, 2.25rem);
  border-top: 1px solid var(--line);
}

.section-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

.section-note {
  max-width: 40rem;
  margin: 0.25rem 0 0;
  color: var(--slate);
}

/* ---------- Country lists: one country per row ---------- */
/* Reads top to bottom, A-Z. On wider screens the list flows into
   up to three columns, still read downwards like an index. */

.country-list,
.soon-list {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  columns: 17.5rem 3;
  column-gap: 0.75rem;
}

.country-list > li,
.soon-list > li {
  break-inside: avoid;
  padding-bottom: 0.5rem;
}

.row {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  min-height: 4.25rem;
  padding: 0.625rem 0.75rem 0.625rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

a.row:hover {
  border-color: var(--harbour);
  background: var(--harbour-tint);
}

.flag {
  display: block;
  flex: none;
  width: 3.25rem;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgb(23 41 58 / 0.14);
}

.row-names {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.25;
}

.name-en {
  font-size: 1.0625rem;
  font-weight: 700;
}

.name-local {
  margin-top: 0.125rem;
  font-size: 1rem;
  overflow-wrap: break-word;
}

.name-lang {
  margin-top: 0.125rem;
  color: var(--slate);
  font-size: 0.875rem;
}

/* Keep each language name whole (e.g. 简体中文); lines may only break at the slashes */
.name-lang > span {
  white-space: nowrap;
}

.row-icon,
.mail-icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
}

.row-icon {
  color: var(--slate);
}

a.row:hover .row-icon {
  color: var(--harbour);
}

/* In two or three columns, give every open-survey row the same height so the columns line up */
@media (min-width: 40rem) {
  .country-list .row {
    min-height: 5.375rem;
  }
}

/* Coming soon: lighter rows, email icon instead of the arrow */

.row-soon {
  min-height: 3.75rem;
  border-style: dashed;
  border-color: var(--line-dashed);
  background: transparent;
}

a.row-soon:hover {
  border-style: solid;
  background: var(--card);
}

.row-soon .flag {
  width: 2.5rem;
}

.row-soon .name-en {
  font-size: 1rem;
}

.row-soon .name-local {
  font-size: 0.9375rem;
}

.mail-icon {
  width: 1.375rem;
  height: 1.375rem;
  color: var(--harbour);
}

/* ---------- Hong Kong page ---------- */

.page-narrow {
  width: min(100%, 32rem);
  text-align: center;
}

.page-narrow .intro {
  margin-inline: auto;
}

.page-narrow h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.875rem);
  line-height: 1.1;
}

.flag-lg {
  width: 7.5rem;
  margin: 0 auto 1.25rem;
}

.h1-sub {
  display: block;
  margin-top: 0.375rem;
  color: var(--slate);
  font-size: 0.5em;
  letter-spacing: 0;
}

.choice-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}

.choice {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--harbour);
  border-radius: 999px;
  background: var(--card);
  color: var(--harbour);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.choice:hover {
  background: var(--harbour);
  color: #ffffff;
}

.back {
  margin: 2.25rem 0 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
