/* EnglishCBT shared theme.
 *
 * Palette follows the British Council identity: deep purple as the dominant
 * brand colour, bright cyan as the single accent, white ground, near-black text.
 * Cyan on purple is the only pairing that carries; cyan on white fails contrast,
 * so on light backgrounds cyan is used as a rule/underline, never as text.
 */
:root {
  --purple: #23085a;   /* British Council "Violent Violet" — headers, hero, primary buttons */
  --purple-700: #2f0d73;
  --purple-900: #180540;
  --cyan: #00dcff;     /* accent: underlines, rules, focus rings, hover on purple */
  --cyan-ink: #006e80; /* darkened cyan, safe for text on white */
  --ink: #16161a;
  --body: #43434d;
  --muted: #6b6b76;
  --line: #e2e2e8;
  --ground: #ffffff;
  --ground-2: #f6f5f9;
  --radius: 6px;
  --focus: 0 0 0 3px rgba(0, 220, 255, .55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--body);
  background: var(--ground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -.015em; }
a { color: var(--purple); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 3px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------------- Site header + menu ---------------- */
.site-header { background: var(--purple); color: #fff; position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.12rem; color: #fff; text-decoration: none; letter-spacing: -.02em; }
.brand .dot { width: 10px; height: 10px; border-radius: 2px; background: var(--cyan); }

.menu { display: flex; align-items: center; gap: 4px; }
.menu > a, .menu > .has-sub > button {
  display: inline-flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,.86); background: none; border: 0;
  font: inherit; font-size: .95rem; text-decoration: none;
  padding: 9px 13px; border-radius: var(--radius); cursor: pointer;
}
.menu > a:hover, .menu > .has-sub > button:hover,
.menu > a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.10); }
.menu .caret { font-size: .6rem; opacity: .8; transition: transform .15s ease; }
.has-sub { position: relative; }
.has-sub[open-sub] .caret { transform: rotate(180deg); }

.submenu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 300px;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 14px 40px rgba(24, 5, 64, .22);
  padding: 7px; display: none;
}
.has-sub[open-sub] .submenu { display: block; }
.submenu a, .submenu span.soon {
  display: block; padding: 10px 12px; border-radius: var(--radius);
  text-decoration: none; color: var(--ink); font-size: .93rem; line-height: 1.35;
}
.submenu a:hover { background: var(--ground-2); }
.submenu a small, .submenu span.soon small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.submenu span.soon { color: #9a9aa6; cursor: default; }
.submenu span.soon small { color: #b3b3bd; }
.submenu .sep { height: 1px; background: var(--line); margin: 6px 4px; }

.btn {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: .95rem;
  padding: 11px 20px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.btn-cyan { background: var(--cyan); color: var(--purple-900); }
.btn-cyan:hover { background: #5ae9ff; }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover { background: var(--purple-700); }
.btn-line { border-color: rgba(255,255,255,.45); color: #fff; }
.btn-line:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-line-dark { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-line-dark:hover { border-color: var(--purple); }

.menu-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: var(--radius); padding: 7px 11px; font-size: .9rem; cursor: pointer; }

@media (max-width: 900px) {
  .menu-toggle { display: inline-block; }
  .menu {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--purple-900); padding: 10px 16px 18px;
    border-top: 2px solid var(--cyan);
  }
  .menu.open { display: flex; }
  .menu > a, .menu > .has-sub > button { width: 100%; justify-content: space-between; padding: 12px 8px; }
  .submenu { position: static; min-width: 0; margin: 2px 0 8px; box-shadow: none; }
}

/* ---------------- Footer ---------------- */
.site-footer { background: var(--purple-900); color: rgba(255,255,255,.72); margin-top: 80px; padding: 40px 0 46px; font-size: .87rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
.site-footer a { color: #fff; text-decoration: none; border-bottom: 1px solid var(--cyan); }
.site-footer code { color: var(--cyan); font-size: .82rem; }
