/* Associate links: a small centred page. Logos on the left, three sections of collapsed navy bars on the right. */
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
}

:root {
  --page: #f4f8fb;
  --surface: #ffffff;
  --rule: #e2e9ef;
  --hover: #e9f1f6;
  --label: #e8f1f7;
  --ink: #1c2830;
  --muted: #4d5c68;
  --navy: #003b5c;
  --navy-hover: #004e78;
  --olive: #556b2f;
  --font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --wrap: 52rem;
  --gutter: 1.5rem;
  --gap: 1.25rem;
  --radius: 0.5rem;
  --shadow: 0 2px 8px rgb(0 40 70 / 0.06);
}
@media (max-width: 44rem) { :root { --gutter: 1rem; --gap: 0.875rem; } }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink);
  background: var(--page);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 0.25rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }

/* Masthead: the logo and the page name, centred. */
.mast { padding: 1.25rem var(--gutter) 1.125rem; text-align: center; }
.brand { display: inline-block; line-height: 0; }
.brand img { width: 15rem; height: auto; }
.mast h1 { margin-top: 0.5rem; font-size: 1.75rem; font-weight: 700; color: var(--navy); }

.layout { display: flex; align-items: stretch; gap: var(--gap); padding-bottom: 2rem; }

/* Daily tools: one equal card each, logos only. */
.tools { flex: none; width: 15rem; align-self: flex-start; }
.tools ul { display: grid; gap: 1rem; }
.tool {
  position: relative; display: flex; align-items: center; justify-content: center; height: 9rem; padding: 0.75rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow);
}
/* One width for every logo, so the four read as a set. */
.tool img { display: block; width: 10rem; height: auto; border-radius: 0.3125rem; }
/* The note appears at the foot of the card, so nothing shifts. */
.tool-note {
  position: absolute; bottom: 0.5rem; left: 50%; transform: translateX(-50%);
  padding: 0.1875rem 0.625rem; font-size: 0.8125rem; white-space: nowrap; color: #fff; background: var(--navy);
  border-radius: 0.25rem; opacity: 0; pointer-events: none;
}
/* Only a visible note takes the pointer, so moving onto it keeps it up and a hidden one never blocks the next logo. */
.tool:hover .tool-note, .tool:focus-visible .tool-note { opacity: 1; pointer-events: auto; }
.tool-name { font-size: 1.375rem; font-weight: 700; color: var(--navy); text-align: center; }
.tool:hover { border-color: var(--navy); box-shadow: 0 6px 16px rgb(0 40 70 / 0.1); }
.tool:focus-visible { border-radius: var(--radius); }

/* Sections: a labelled card each, holding closed navy bars. The column stretches to the logo column, so their bottoms line up. */
.sections { flex: 1; min-width: 0; display: grid; gap: 1rem; }
.card {
  padding: 0.75rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card h2 {
  margin-bottom: 0.625rem; padding: 0.4375rem 0.875rem;
  font-size: 1.0625rem; font-weight: 600; color: var(--navy);
  background: var(--label); border-left: 4px solid var(--olive); border-radius: 0.25rem 0.375rem 0.375rem 0.25rem;
}
.cat + .cat, .cat + .downloads { margin-top: 0.5rem; }
.cat summary {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.5rem 0.875rem; font-weight: 500; color: #fff; background: var(--navy);
  border-radius: 0.375rem; cursor: pointer; list-style: none; user-select: none;
}
.cat summary::-webkit-details-marker { display: none; }
.cat summary::after {
  content: ""; flex: none; width: 0.5rem; height: 0.5rem; margin-top: -0.25rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.cat[open] summary { border-radius: 0.375rem 0.375rem 0 0; }
.cat[open] summary::after { margin-top: 0.25rem; transform: rotate(225deg); }
.cat summary:hover { background: var(--navy-hover); }
.cat summary:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 0.375rem; }
.cat ul { padding: 0.25rem; border: 1px solid var(--rule); border-top: 0; border-radius: 0 0 0.375rem 0.375rem; }
.cat li + li { border-top: 1px solid var(--rule); }
.cat a, .downloads a { display: block; padding: 0.5625rem 0.625rem; border-radius: 0.25rem; }
.note { margin-left: 0.125rem; font-size: 0.875rem; color: var(--muted); }
.cat a:hover, .cat a:focus-visible, .downloads a:hover, .downloads a:focus-visible { background: var(--hover); color: var(--navy); }
.cat a:focus-visible, .downloads a:focus-visible { outline-offset: -2px; }

.downloads a.download { display: flex; align-items: center; gap: 0.625rem; background: var(--label); border-radius: 0.375rem; }
.downloads a.download:hover, .downloads a.download:focus-visible { background: #dbe8f1; }
.badge {
  flex: none; width: 2.5rem; padding: 0.1875rem 0; text-align: center; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--navy); background: var(--surface); border-radius: 0.25rem;
}
.download-text { flex: 1; min-width: 0; }
.download-text .name { font-weight: 600; color: var(--navy); }
.download-text .note { display: block; margin-left: 0; }
.size { flex: none; font-size: 0.875rem; color: var(--muted); }

.foot { display: flex; justify-content: space-between; gap: 1rem; padding-block: 0 2rem; font-size: 0.8125rem; color: var(--muted); }
.foot a { text-decoration: underline; text-underline-offset: 0.2em; }
.foot a + a { margin-left: 1rem; }
.foot a:hover { color: var(--navy); }

/* Narrow screens: logos in a 2 x 2 above the sections. */
@media (max-width: 44rem) {
  .mast { padding-block: 1.25rem 1rem; }
  .brand img { width: 12.5rem; }
  .mast h1 { font-size: 1.5rem; }
  .layout { display: block; }
  .tools { width: auto; margin-bottom: var(--gap); }
  .tools ul { grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
  .tool { height: 6.5rem; }
  .tool { flex-direction: column; gap: 0.25rem; }
  .tool img { width: min(100%, 8.5rem); }
  .cat summary, .cat a, .downloads a { padding-block: 0.75rem; }
}
/* Touch screens have no hover, and narrow windows have no room for a floating label, so the note sits under its logo. */
@media (hover: none), (max-width: 44rem) {
  .tool { flex-direction: column; gap: 0.25rem; }
  .tool-note { position: static; transform: none; padding: 0; white-space: normal; text-align: center; color: var(--muted); background: none; opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .tool, .cat summary, .cat a, .downloads a { transition: background-color 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s; }
  .tool-note { transition: opacity 0.12s; }
}
