@font-face {
  font-family: "Gang of Three";
  src: url("/fonts/gang_of_three.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Crimson Text";
  src: url("/fonts/crimson_text_regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Crimson Text";
  src: url("/fonts/crimson_text_bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #fdfdfd;
  --text: #1c1c1c;
  --muted: #55595f;
  --navy: #14295b;
  --gold: #e8b923;
  --link: #14295b;
  --card: #f4f6fb;
  --border: #d5dbe8;
  --btn-bg: #14295b;
  --btn-text: #ffffff;
  --btn-alt-bg: transparent;
  --btn-alt-text: #14295b;
  --wa-bg: #17784a;
  --wa-text: #ffffff;
  --note-bg: #fff6d6;
  --note-border: #e8b923;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #121212;
  --text: #ececec;
  --muted: #b4b8bf;
  --link: #9bbcff;
  --card: #1c1f26;
  --border: #343a48;
  --btn-bg: #e8b923;
  --btn-text: #121212;
  --btn-alt-text: #e8b923;
  --wa-bg: #2fae6c;
  --wa-text: #0b1a12;
  --note-bg: #2a2412;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Crimson Text", Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  line-height: 1.55;
}
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
img { max-width: 100%; height: auto; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 8px 14px;
  z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

/* Header */
.site-header {
  position: sticky;
  top: calc(-1 * var(--topbar-h, 0px));
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 760px) {
  .site-header { top: 0; }
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: "Gang of Three", Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.15;
}
.brand img { width: 48px; height: 48px; flex: none; }
.tools { display: flex; align-items: center; gap: 6px; }
.tools a, .tools button {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 0;
  width: 40px;
  height: 40px;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tools a:hover, .tools button:hover { background: var(--card); }
.tools button svg { display: block; width: 24px; height: 24px; }
.menu-btn { display: none !important; }
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 26px;
}
.nav li { margin: 0; }
.nav a {
  display: block;
  padding: 10px 0 8px;
  border-bottom: 3px solid transparent;
  text-decoration: none;
  color: var(--muted);
  font-size: 1.15rem;
}
.nav a:hover { color: var(--text); border-bottom-color: var(--border); }
.nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
  border-bottom-color: var(--gold);
}

@media (max-width: 760px) {
  .menu-btn { display: flex !important; }
  .tools { gap: 2px; }
  .nav { margin: 0 -16px; }
  .js .nav ul { display: none; }
  .js .nav ul.open { display: block; border-top: 1px solid var(--border); }
  .nav ul { display: block; }
  .nav a {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    border-left: 5px solid transparent;
    color: var(--text);
    font-size: 1.2rem;
  }
  .nav a:hover { background: var(--card); }
  .nav a[aria-current="page"] {
    border-left-color: var(--gold);
    background: var(--card);
  }
}

/* Content */
main { padding: 28px 0 40px; }
h1, h2, h3 {
  font-family: "Gang of Three", Georgia, serif;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.5px;
}
h1 { font-size: 2.1rem; margin: 0 0 12px; }
h2 { font-size: 1.6rem; margin: 40px 0 12px; }
h3 { font-size: 1.25rem; margin: 24px 0 8px; }
p, ul, ol { margin: 0 0 14px; }
li { margin-bottom: 6px; }
.lead { font-size: 1.45rem; }
.muted { color: var(--muted); }

.hero { text-align: center; padding: 8px 0 8px; }
.hero img { width: min(300px, 70%); margin: 0 auto 12px; display: block; }

.btns { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.hero .btns { justify-content: center; }
.btn {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: 2px solid var(--btn-bg);
}
.btn.alt {
  background: var(--btn-alt-bg);
  color: var(--btn-alt-text);
  border-color: var(--btn-alt-text);
}
.btn.wa {
  background: var(--wa-bg);
  color: var(--wa-text);
  border-color: var(--wa-bg);
}
.btn.wa, .btn.mail {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn.wa svg, .btn.mail svg {
  width: 1.4em;
  height: 1.4em;
  flex: none;
}
.btn.wa svg { fill: currentColor; }
.btn:hover { filter: brightness(1.1); }

.cards { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 16px 0; }
@media (min-width: 640px) {
  .cards.two { grid-template-columns: 1fr 1fr; }
  .cards.three { grid-template-columns: 1fr 1fr 1fr; }
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

.note {
  background: var(--note-bg);
  border-left: 5px solid var(--note-border);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 16px 0;
}
.note p:last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; margin: 14px 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: 1.1rem; }
th, td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border: 1px solid var(--border);
}
th { background: var(--card); }
td:first-child { min-width: 8.5em; }
td a { overflow-wrap: anywhere; }

.contact-cards { margin-bottom: 20px; }
.contact-cards .card { border-top: 5px solid var(--border); text-align: center; }
.contact-cards .card h2 { margin: 0 0 8px; font-size: 1.5rem; }
.contact-cards .wa-card { border-top-color: var(--wa-bg); }
.contact-cards .mail-card { border-top-color: var(--gold); }
.contact-cards .addr { margin-top: 12px; font-size: 1rem; overflow-wrap: anywhere; }
.contact-cards .ig-card { border-top-color: #c13584; }
.contact-cards .btns { justify-content: center; margin-bottom: 0; }
.contact-cards .btn { padding: 10px 12px; font-size: 1.05rem; gap: 8px; white-space: nowrap; }
.qr { display: block; width: 180px; border-radius: 12px; margin: 10px auto; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 32px;
  font-size: 1.05rem;
  color: var(--muted);
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.site-footer p { margin: 0; }

@media (max-width: 480px) {
  .tools a, .tools button { width: 36px; height: 36px; }
  .brand img { width: 40px; height: 40px; }
  body { font-size: 1.2rem; }
  h1 { font-size: 1.8rem; }
  .brand { font-size: 0.9rem; }
}

.flag {
  display: block;
  width: 26px;
  height: 17px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(128, 128, 128, 0.5);
}

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

/* Clubs list */
.clubs {
  list-style: none;
  margin: 14px 0 20px;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .clubs { grid-template-columns: 1fr 1fr; }
}
.clubs li { margin: 0; }
.club, .club.here, .clubs li.here {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  height: 100%;
}
.clubs li.here { border-color: var(--gold); }
a.club:hover { border-color: var(--gold); }
a.club:hover .club-name { text-decoration: underline; }
.clubs img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex: none;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
}
.clubs li.here img { border-radius: 50%; padding: 0; background: none; }
.club-name { display: block; font-weight: 700; color: var(--link); line-height: 1.2; }
.clubs li.here .club-name { color: var(--text); }
.club-place { display: block; color: var(--muted); font-size: 1.05rem; }

/* Platforms list */
.platforms .club { align-items: flex-start; }
.platforms .club.featured { border-color: var(--gold); }
.platforms img { padding: 0; border-radius: 14px; }
.platforms img[src$=".svg"] { padding: 6px; }
.platforms .club-place { margin-top: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag {
  font-size: 0.85rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--bg);
}
.tag.gold { background: var(--gold); border-color: var(--gold); color: #121212; font-weight: 700; }

/* Organization ladder */
.ladder {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  counter-reset: step;
}
.ladder li {
  position: relative;
  counter-increment: step;
  margin: 0;
  padding: 12px 16px 12px 62px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ladder li + li { margin-top: 26px; }
.ladder li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-weight: 700;
}
.ladder li + li::after {
  content: "↑";
  position: absolute;
  left: 0;
  right: 0;
  top: -26px;
  text-align: center;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 26px;
}
h2[id], h3[id] { scroll-margin-top: 80px; }

/* Organization logos */
.org { display: flex; gap: 16px; align-items: flex-start; margin: 22px 0 12px; }
.org > div { min-width: 0; }
.org h3 { margin-top: 0; }
.org-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex: none;
  background: #fff;
  border-radius: 10px;
  padding: 4px;
}
.org-logo.round { border-radius: 50%; padding: 0; background: none; }
.ladder li.has-logo { padding-right: 78px; }
.ladder .org-logo { position: absolute; right: 14px; top: 12px; width: 48px; height: 48px; padding: 3px; }
.ladder .org-logo.round { padding: 0; }
@media (max-width: 480px) {
  .org-logo { width: 52px; height: 52px; }
  .org { gap: 12px; }
}

/* Bio photo */
.bio-photo { float: right; width: 240px; margin: 4px 0 14px 22px; }
.bio-photo img { display: block; width: 100%; height: auto; border-radius: 10px; }
.bio-photo figcaption { font-size: 1rem; color: var(--muted); margin-top: 6px; text-align: center; }
main .wrap::after { content: ""; display: block; clear: both; }
@media (max-width: 560px) {
  .bio-photo { float: none; width: 100%; max-width: 300px; margin: 8px auto 16px; }
}

/* MIL note card and video */
.org.card { align-items: center; margin: 22px 0 12px; }
.org.card p { margin: 0; }
.video { margin: 16px 0 20px; }
.video-link, .video iframe {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.video-link img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-link .play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 68px;
  height: 48px;
  margin: -24px 0 0 -34px;
  border-radius: 12px;
  background: rgba(20, 41, 91, 0.9);
}
.video-link .play::after {
  content: "";
  position: absolute;
  left: 27px;
  top: 14px;
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff;
}
.video-link:hover .play, .video-link:focus-visible .play { background: #c00; }
.video figcaption { font-size: 1rem; color: var(--muted); margin-top: 6px; }

/* Single card and inline icon */
.clubs.single { grid-template-columns: 1fr; }
.inline-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  vertical-align: -7px;
  margin-right: 6px;
  background: #fff;
}
