/* ===========================================================================
   Національна Федерація Спортивного Айкідо України

   The palette is MEASURED from the federation's own logo artwork (see
   docs/00-context.md), not chosen. Everything else follows from it.

   Two contrast facts drive most of the colour decisions:
     - #008DD2 on white is about 3.4:1. Fine for rules, borders and large
       type; NOT enough for body text, so links use a deepened blue.
     - #FFDD00 on white is about 1.3:1. It can never carry text. It is a
       structural accent only — bars and edges, echoing the flag.

   No external requests: no font CDN, no analytics. The file:// preview in
   local/ must work with nothing but the files on disk.
   =========================================================================== */

:root {
  /* Measured from the artwork */
  --blue: #008dd2;
  --yellow: #ffdd00;
  --ink: #21201e;

  /* Derived for legibility */
  --blue-text: #00679b;   /* ~4.9:1 on white — links and small type */
  --blue-light: #4fb8e8;  /* ~8:1 on the dark surface */
  --muted: #5a5852;       /* ~6.5:1 on white */
  --paper: #ffffff;
  --paper-tint: #f5f7f9;
  --rule: #dfe4e8;
  --dark: #1a1a1c;
  --dark-text: #f7f7f5;

  --measure: 68rem;
  --gap: 1.5rem;

  /* Fluid but bounded. Ukrainian runs longer than English, so headings are
     capped lower than they would be for an English-only site. */
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2.125rem);
  --step-3: clamp(1.9rem, 1.5rem + 1.9vw, 3rem);

  /* System stack. Every entry has Cyrillic coverage on its platform, so the
     Ukrainian pages never fall back to a serif default. */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          "Noto Sans", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.65;
  /* The flag, as the page's top edge. */
  border-top: 6px solid var(--blue);
}

img { max-width: 100%; height: auto; }

a { color: var(--blue-text); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.15; text-wrap: balance; margin: 0 0 0.6em; }
h1 { font-size: var(--step-3); letter-spacing: -0.02em; }
h2 { font-size: var(--step-2); letter-spacing: -0.01em; }

.main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gap) 1rem;
}

.main > section { margin: 0 0 clamp(2.5rem, 6vw, 4rem); }
/* The contact band supplies its own top space, so the last section must not
   stack another 4rem on top of it. */
.main > section:last-child { margin-bottom: 0; }

.lede {
  font-size: var(--step-1);
  color: var(--muted);
  max-width: 44ch;
  margin: 0 0 2.5rem;
}

/* --- header ------------------------------------------------------------- */

.nav {
  display: flex;
  align-items: center;
  gap: var(--gap);
  flex-wrap: wrap;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.1rem var(--gap);
  border-bottom: 1px solid var(--rule);
}

/* The logo ships at its intrinsic 320x128. Height-constrain it: the source is
   1297px and goes soft when scaled up, so it is only ever scaled down. */
.nav__brand { display: inline-flex; flex: 0 0 auto; }
.nav__brand img { height: clamp(2.6rem, 7vw, 3.4rem); width: auto; }

.nav__links {
  display: flex;
  gap: clamp(0.9rem, 3vw, 1.8rem);
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav__links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding-bottom: 3px;
  border-bottom: 3px solid transparent;
}
.nav__links a:hover { border-bottom-color: var(--yellow); }

/* The language switch is the one control a bilingual site must not hide, so
   it is a button rather than another link in the row. */
.nav__lang {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--blue-text);
  border: 2px solid var(--blue);
  border-radius: 2rem;
  padding: 0.3rem 0.85rem;
  white-space: nowrap;
}
.nav__lang:hover { background: var(--blue); color: #fff; }

/* --- halls -------------------------------------------------------------- */

.halls {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}

.halls li {
  background: var(--paper-tint);
  border-left: 5px solid var(--blue);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hall__city { font-weight: 700; font-size: var(--step-1); }
.hall__street { color: var(--muted); }

/* --- coaches ------------------------------------------------------------ */

.coaches {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.75rem;
}

.coaches li {
  border: 1px solid var(--rule);
  border-bottom: 3px solid var(--yellow);
  padding: 0.55rem 1rem;
  font-weight: 600;
}

/* --- leadership + official details -------------------------------------- */

.people {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0;
  align-items: baseline;
}
.people dt {
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.people dd { margin: 0; font-weight: 700; font-size: var(--step-1); }

.official {
  background: var(--paper-tint);
  border-left: 5px solid var(--yellow);
  padding: 1.1rem 1.25rem;
  line-height: 1.9;
}

/* --- event -------------------------------------------------------------- */

.event {
  border: 1px solid var(--rule);
  border-top: 5px solid var(--blue);
  padding: clamp(1.25rem, 4vw, 2rem);
}
.event h2 { margin-top: 0; }
.event__when { font-weight: 700; font-size: var(--step-1); margin: 0 0 0.2rem; }
.event__where { color: var(--muted); margin: 0 0 1.25rem; }

/* Results were announced and never sent. This has to read as pending, not as
   an error or an apology — muted, but deliberately shaped as a slot. */
.event__pending {
  background: var(--paper-tint);
  border-left: 4px solid var(--yellow);
  padding: 0.85rem 1rem;
  color: var(--muted);
  margin: 1.5rem 0 0;
}

/* --- contact ------------------------------------------------------------ */

.contact {
  background: var(--paper-tint);
  border-top: 1px solid var(--rule);
  padding: clamp(2rem, 5vw, 3rem) var(--gap);
  margin-top: 3rem;
}
.contact > * { max-width: var(--measure); margin-inline: auto; }
.contact h2 { margin-bottom: 0.4rem; }
.contact__email { font-size: var(--step-1); font-weight: 700; margin: 1rem auto 0.3rem; }
.contact__address { color: var(--muted); margin-top: 0; }

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

/* Dark surface. Uses the FLAG lockup: the Olympic variant has no bright
   backing behind its figures and fails on dark (established in m2). */
.footer {
  background: var(--dark);
  color: var(--dark-text);
  padding: clamp(2rem, 5vw, 3rem) var(--gap);
  /* The flag again, as the page's bottom edge. */
  border-bottom: 6px solid var(--yellow);
}
.footer__inner {
  max-width: var(--measure);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  align-items: start;
}
.footer__logo img { height: 3rem; width: auto; }
.footer__org { font-weight: 700; margin: 0 0 0.4rem; max-width: 30ch; }
.footer__contact { margin: 0; color: #c9c8c4; }
.footer a { color: var(--blue-light); }

/* --- narrow screens ------------------------------------------------------ */

@media (max-width: 34rem) {
  .nav { gap: 0.75rem 1rem; padding: 0.9rem var(--gap); }
  /* At 320px the Ukrainian labels cannot share a row with the logo, so the
     links wrap to their own full-width row and the switch stays on the top. */
  .nav__links { order: 3; width: 100%; }
  .people { grid-template-columns: 1fr; gap: 0.15rem; }
  .people dd { margin-bottom: 0.9rem; }
}

@media (prefers-reduced-motion: no-preference) {
  a, .nav__links a, .nav__lang { transition: background-color .15s, color .15s, border-color .15s; }
}
