/* The froeh.org grid system, the same system as commandb.org.
   6 columns x 6 rows of square fields with one-baseline gutters; the raster is implied, not drawn.
   One weight. Type sizes are 0.9 of their leading, and leading is whole baselines:
   header A on 6, B on 5, C on 2, D on 1; captions sit on three quarters of a baseline.
   Colour: Blue Note blue is the one anchor. It is too dark for black type (2.5:1), so the blue sheet
   carries cream type instead; stone and white paper fields carry black ink, as on commandb.org.
   Type: <html data-type="system"> sets everything in Neue Haas. data-type="mono" keeps Söhne Mono
   for running text, labels and forms, where the old site used it, and Neue Haas for headers A to C. */

:root {
    --blue: #245399;
    --cream: #f0ecdc;
    --stone: #e4ddd2;
    --white: #fbfaf6;
    --ink: #151413;
    --ink-soft: #4b4740;
    --focus: #151413;

    --font: "Neue Haas Grotesk Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-text: var(--font);
    /* Söhne Mono sets wider than Neue Haas, so mono text drops a size step and keeps the same leading. */
    --text: 0.9;
    --track: 0.012em;

    --b: 18px;
    --gap: var(--b);
    --margin: calc(var(--b) * 1.5);
    --max: 1600px;
    /* Square fields: a row is exactly one column wide. */
    --row: calc((min(100vw - 2 * var(--margin), var(--max)) - 5 * var(--gap)) / 6);
}

:root[data-type="mono"] {
    --font-text: "Sohne Mono", ui-monospace, Menlo, monospace;
    --text: 0.78;
    --track: 0;
}

@media (min-width: 900px) {
    :root { --b: 22px; --margin: calc(var(--b) * 2); }
}

body { background: var(--stone); color: var(--ink); font-family: var(--font-text); font-weight: 400; font-size: calc(var(--b) * var(--text)); line-height: var(--b); letter-spacing: var(--track); }
a { color: inherit; }
h1, h2, h3, h4 { font-weight: 400; }

/* Header styles A to C stay in Neue Haas in both type modes; D and captions follow the text face. */
.t-a, .t-b, .t-c { font-family: var(--font); }
.t-a { font-size: calc(var(--b) * 5.4); line-height: calc(var(--b) * 6); letter-spacing: -0.01em; }
.t-b { font-size: calc(var(--b) * 4.5); line-height: calc(var(--b) * 5); letter-spacing: -0.01em; }
.t-c { font-size: calc(var(--b) * 1.8); line-height: calc(var(--b) * 2); letter-spacing: 0; }
.t-d { font-size: calc(var(--b) * var(--text)); line-height: var(--b); }
.t-cap { font-size: calc(var(--b) * var(--text) * 0.75); line-height: calc(var(--b) * 0.75); letter-spacing: 0.02em; }

/* A sheet is one page of the system: a colour, a margin, and the 6-column field grid. */
.sheet {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: var(--row);
    gap: var(--gap);
    padding: var(--margin) max(var(--margin), (100% - var(--max)) / 2);
    isolation: isolate;
}
.sheet > * { position: relative; z-index: 2; min-width: 0; }
.sheet-blue { background: var(--blue); color: var(--cream); --focus: var(--cream); }
.sheet-stone { background: var(--stone); }
.sheet-white { background: var(--white); }
.sheet-free { grid-auto-rows: auto; }

/* Paper fields always carry black ink, even on the blue sheet. */
.field-white { background: var(--white); color: var(--ink); --focus: var(--ink); z-index: 0; }
.field-cream { background: var(--cream); color: var(--ink); --focus: var(--ink); z-index: 0; }

/* Text sits a hair inside the field's top-left corner, like the sheets. */
.inset { padding: calc(var(--b) * 0.2) calc(var(--b) * 0.25) 0; }

/* Spec block: right-aligned labels in one column, values in the next. */
.spec { display: grid; grid-template-columns: subgrid; align-content: start; }
.spec > div { display: contents; }
.spec > div[hidden] { display: none; }
.spec dt { grid-column: 1; text-align: right; padding-right: calc(var(--b) * 0.5); }
.spec dd { grid-column: 2; margin: 0; }
.spec-wide { grid-template-columns: max-content 1fr; }

.edge-mark { position: absolute; right: calc(var(--margin) / 3); top: calc(var(--margin) + var(--row) * 2); writing-mode: vertical-rl; z-index: 3; text-decoration: none; }

/* Links and actions, in the one weight. */
.link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; display: inline-block; min-height: 24px; }
.link:hover { text-decoration-thickness: 2px; }
.plain { text-decoration: none; display: inline-block; min-height: 24px; }
.plain:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.plain[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.action {
    display: inline-flex; align-items: center; min-height: 48px; padding: 0 calc(var(--b) * 0.75);
    background: var(--ink); color: var(--white); text-decoration: none; border: 1px solid var(--ink);
    transition: background-color 120ms ease, color 120ms ease;
}
.action:hover { background: var(--white); color: var(--ink); }
.action:active { transform: translateY(1px); }
/* On the blue sheet the action takes the cream, like a Blue Note title block. */
.sheet-blue > .action, .sheet-blue :not(.field-white, .field-cream) > .action { background: var(--cream); color: var(--blue); border-color: var(--cream); }
.sheet-blue > .action:hover, .sheet-blue :not(.field-white, .field-cream) > .action:hover { background: var(--blue); color: var(--cream); }
.list-plain li { min-height: var(--b); }

/* The type switch: a real button that states the face in use. Only present when the build includes it. */
.type-switch { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; text-align: left; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.type-switch:hover { text-decoration-thickness: 2px; }
.type-switch:active { transform: translateY(1px); }

/* A dated programme: dates right-aligned in the first column, like the spec labels. */
.programme { display: grid; grid-template-columns: subgrid; row-gap: var(--b); }
.programme > li { display: contents; }
.programme time { grid-column: 1; text-align: right; padding-right: calc(var(--b) * 0.5); }
.programme .role { grid-column: 2 / 4; }
.programme .org { grid-column: 4 / -1; }

/* Phones: pair the six columns into two and let rows grow with content. */
@media screen and (max-width: 899px) {
    .sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; row-gap: calc(var(--b) * 1.5); }
    .sheet > * { grid-column: 1 / -1 !important; grid-row: auto !important; }
    .t-a { font-size: calc(var(--b) * 3.6); line-height: calc(var(--b) * 4); }
    .t-b { font-size: calc(var(--b) * 2.7); line-height: calc(var(--b) * 3); }
    .edge-mark { display: none; }
    .programme { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
    .programme > li { display: grid; padding-bottom: var(--b); }
    .programme time, .programme .role, .programme .org { grid-column: 1; text-align: left; padding-right: 0; }
}

/* Footer: Georgia with Atlanta starred, opposite the site name and the places to find me. */
.colophon { grid-auto-rows: auto; align-items: end; }
.colophon-georgia { grid-column: 1; grid-row: 1; width: calc(var(--b) * 2.6 * 0.86); height: auto; }
.colophon-georgia path { fill: var(--ink); }
.colophon-georgia .georgia-star { fill: var(--white); transform-box: fill-box; transform-origin: center; transform: scale(1.8); }
.colophon-details { grid-column: 2 / 4; grid-row: 1; }
.colophon-links { grid-column: 4 / 6; grid-row: 1; columns: 2; column-gap: var(--gap); }
.colophon-name { grid-column: 6; grid-row: 1; justify-self: end; }
@media screen and (max-width: 899px) {
    .colophon-links { columns: 2; }
}
