/* --------------------------------------------------------------------------
   Hong Kong Society of Authorized Persons — website stylesheet
   Palette taken from the name card: navy #16325C, gold #E0B14A.
   No JavaScript, no web fonts, no external requests — the whole site is
   static files that can be dropped onto any host.
   -------------------------------------------------------------------------- */

:root {
  --navy: #16325C;
  --navy-deep: #0E2140;
  --gold: #E0B14A;
  --gold-soft: #F3E2B8;
  --ink: #1C2530;
  --muted: #5A6675;
  --rule: #D8DDE4;
  --paper: #FFFFFF;
  --paper-warm: #F7F5F0;
  --measure: 66rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif TC", "Songti TC", serif;
  --sans: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

/* A designed line break in a heading — dropped on a narrow screen, where the
   line it holds would be wider than the screen and push the page sideways.
   `display: none` on a <br> removes the break; the default `inline` keeps it. */
br.desk { display: none; }

/* --- language switch ----------------------------------------------------
   Three radios — English, Traditional Chinese, Simplified Chinese — and no
   JavaScript. The inputs sit at the top of <body>; the rules below reach
   through to the content with a sibling combinator. A radio group always
   has one member checked, so there is no "nothing selected" state to
   handle.

   `display: revert` puts each element back to its own default — a span
   goes inline, a div or p goes block — so the same two classes work on
   headings, paragraphs and inline labels alike. */
.l-en, .l-hant, .l-hans {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.lang-en { display: revert; }
.hant, .hans { display: none; }

/* Choosing a Chinese script hides the English. English is the default, so
   there is no rule for #l-en — it only has to switch the others off. */
#l-hant:checked ~ .page .lang-en { display: none; }
#l-hans:checked ~ .page .lang-en { display: none; }
#l-hant:checked ~ .page .hant { display: revert; }
#l-hans:checked ~ .page .hans { display: revert; }

/* The masthead shows the Society's English name in every language, and the
   Chinese name in whichever script is selected. */
.wm { display: revert; }
#l-en:checked ~ .page .wm.hant,
#l-en:checked ~ .page .wm.hans { display: none; }
#l-hant:checked ~ .page .wm.hans { display: none; }
#l-hans:checked ~ .page .wm.hant { display: none; }

.lbl {
  cursor: pointer;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.15rem 0.55rem;
  color: var(--muted);
  background: var(--paper);
  user-select: none;
  white-space: nowrap;
}
.lbl:hover { border-color: var(--gold); color: var(--navy); }

/* The button for the language you are reading in is filled in, so the state
   is visible without having to remember which one you pressed. */
#l-en:checked ~ .page .lbl-en,
#l-hant:checked ~ .page .lbl-hant,
#l-hans:checked ~ .page .lbl-hans {
  background: var(--navy);
  border-color: var(--navy);
  color: #FFFFFF;
}

.lbl-set { display: flex; gap: 0.3rem; }

/* --- layout -------------------------------------------------------------- */

.page { display: flex; flex-direction: column; min-height: 100vh; }

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.crest {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
}

.wordmark { flex: 1 1 auto; line-height: 1.25; }
.wordmark .en {
  font-family: var(--serif);
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  color: var(--navy);
}
.wordmark .zh {
  font-size: 0.95rem;
  color: var(--muted);
}

nav {
  border-top: 1px solid var(--rule);
  background: var(--paper);
}
nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 auto;
  padding: 0 1.5rem;
  max-width: var(--measure);
}
nav li { margin: 0; }
nav a {
  display: block;
  padding: 0.7rem 0.9rem;
  color: var(--navy);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
}
nav a:hover { border-bottom-color: var(--gold); }
nav a[aria-current="page"] { border-bottom-color: var(--gold); font-weight: 600; }

/* --- hero ---------------------------------------------------------------- */

.hero {
  background: var(--navy);
  color: #EDF1F6;
  padding: 4.5rem 0 4rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5.2vw, 3.1rem);
  line-height: 1.16;
  margin: 0 0 0.6rem;
  color: #FFFFFF;
}
.hero .zh-title {
  font-size: clamp(1.3rem, 3.4vw, 1.8rem);
  margin: 0 0 1.4rem;
  color: var(--gold-soft);
  font-weight: 400;
}
.hero p {
  max-width: 40rem;
  font-size: 1.05rem;
  color: #C9D3E0;
  margin: 0 0 1.6rem;
}
.hero .rule {
  width: 4.5rem;
  height: 3px;
  background: var(--gold);
  border: 0;
  margin: 0 0 1.6rem;
}
.hero .meta {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: #93A6BE;
  text-transform: uppercase;
}

/* --- content ------------------------------------------------------------- */

main { flex: 1 1 auto; }

section { padding: 3.2rem 0; }
section + section { border-top: 1px solid var(--rule); }
section.warm { background: var(--paper-warm); }

.eyebrow {
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.4rem;
  font-weight: 700;
}
h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  line-height: 1.25;
  color: var(--navy);
  margin: 0 0 0.2rem;
}
.zh-h2 {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 1.6rem;
}
h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.16rem;
  color: var(--navy);
  margin: 0 0 0.5rem;
}
h4 {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.6rem;
}
p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }
.lead { font-size: 1.08rem; color: var(--ink); }
.muted { color: var(--muted); }

a { color: var(--navy); }
a:hover { color: var(--gold); }

ul.plain { list-style: none; padding: 0; margin: 0 0 1.1rem; }
ul.plain li {
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.5rem;
}
ul.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 6px;
  height: 6px;
  background: var(--gold);
}

/* --- cards --------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.2rem;
  margin: 1.6rem 0 0;
}
/* Four sections read better two by two than four across on one line. */
.grid.four { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) {
  .grid.four { grid-template-columns: 1fr; }
}
.card {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 1.4rem 1.4rem 1.5rem;
}
.card .n {
  font-family: var(--serif);
  color: var(--gold);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}
.card h3 { margin-bottom: 0.45rem; }
.card p { font-size: 0.95rem; color: var(--muted); }

/* A card that is really a link to a file. */
.card.download { display: flex; flex-direction: column; }
.card.download .file {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: 0.8rem;
}

/* --- people --------------------------------------------------------------
   The founders and the council: photograph on the left, words on the
   right, one person after another down the page. The president's
   photograph is 30% larger than the rest. */

.person {
  display: flex;
  gap: 1.6rem;
  align-items: flex-start;
  padding: 1.6rem 0;
  border-top: 1px solid var(--rule);
}
.person:first-of-type { border-top: 0; }

.person .pic {
  flex: 0 0 auto;
  width: 190px;
}
.person .pic img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--paper);
}
/* The president is 30% larger than the other five. */
.person.lead .pic { width: 247px; }

.person .who { flex: 1 1 auto; min-width: 0; }
.person .who h3 { margin-bottom: 0.15rem; }
.person .who .en-name {
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--navy);
}
.person .who .meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
}
.person .who .meta b { color: var(--gold); font-weight: 600; }
.person .who p { font-size: 0.96rem; }

@media (max-width: 640px) {
  .person { flex-direction: column; gap: 1rem; }
  .person .pic, .person.lead .pic { width: 190px; }
}

/* --- legacy timeline ---------------------------------------------------- */

.era {
  border-left: 2px solid var(--gold);
  padding: 0 0 0 1.2rem;
  margin-bottom: 1.6rem;
}
.era .year {
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--navy);
  line-height: 1.2;
}
.era p { font-size: 0.96rem; margin: 0.3rem 0 0; }

figure.photo { margin: 2rem 0 0; }
figure.photo img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--paper);
}
figure.photo figcaption {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

/* --- table --------------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
caption {
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted);
  padding-bottom: 0.7rem;
}
th, td {
  text-align: left;
  padding: 0.7rem 0.8rem 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 2px solid var(--navy);
}
td.role { color: var(--navy); white-space: nowrap; }
td.no {
  font-family: var(--serif);
  color: var(--gold);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

/* --- marker for text Jeff still has to supply ---------------------------- */

.confirm {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8A6410;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: 2px;
  padding: 0.05rem 0.4rem;
  margin-left: 0.5rem;
  vertical-align: 0.25em;
  white-space: nowrap;
}
.placeholder {
  border-left: 3px solid var(--gold);
  background: #FCF9F1;
  padding: 1rem 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.placeholder strong { color: var(--navy); font-weight: 600; }

/* A slot reserved for text that will be supplied later — the biography of
   each founder, for instance. It shows the shape of what is coming without
   pretending to be it. */
.reserved {
  border: 1px dashed var(--gold);
  background: #FCF9F1;
  padding: 0.9rem 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.reserved .tag {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8A6410;
  margin-bottom: 0.3rem;
}

/* --- call to action ------------------------------------------------------ */

.cta {
  background: var(--navy-deep);
  color: #E7EDF5;
  padding: 2.6rem 0;
}
.cta h2 { color: #FFFFFF; }
.cta .zh-h2 { color: #9FB0C6; }
.cta a.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--navy-deep);
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 0.4rem;
}
.cta a.btn:hover { background: #FFFFFF; color: var(--navy-deep); }

/* --- footer -------------------------------------------------------------- */

footer {
  background: var(--navy-deep);
  color: #A9B8CB;
  font-size: 0.88rem;
  padding: 2.4rem 0 2.6rem;
}
footer h3 {
  color: #FFFFFF;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0 0 0.7rem;
}
footer a { color: #D9E2EC; }
footer a:hover { color: var(--gold); }
.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.8rem;
}
footer .fine {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: 1.8rem;
  padding-top: 1.1rem;
  font-size: 0.8rem;
  color: #8494A8;
}
/* The registered name, with its liability status. Cap. 622B requires it on
   the company's website, so it sits here at the very bottom of the page. */
footer .registered {
  margin-top: 0.7rem;
  font-size: 0.76rem;
  color: #7C8CA0;
  letter-spacing: 0.02em;
}

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 3rem 0 2.8rem; }
  section { padding: 2.4rem 0; }
  .crest { width: 44px; height: 44px; }
  nav a { padding: 0.6rem 0.7rem; font-size: 0.86rem; }
  .masthead { flex-wrap: wrap; }
  .wordmark { min-width: 0; }
  .wordmark .en { font-size: 0.92rem; }
  .grid { grid-template-columns: 1fr; }
  table { font-size: 0.88rem; }
  th, td { padding: 0.6rem 0.5rem 0.6rem 0; }
  footer .foot-grid { grid-template-columns: 1fr; gap: 1.4rem; }
}

/* Above the small-screen breakpoint the designed line break comes back. */
@media (min-width: 641px) {
  br.desk { display: inline; }
}

/* --- print --------------------------------------------------------------- */

@media print {
  header, .cta, footer { display: none; }
  body { font-size: 11pt; }
  a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
