/* The Foundation site (#47). A plain look on purpose: the brand work comes in
   the next version. The type and the rhythm follow sites/samam/public/styles.css. */

/* League Spartan, latin subset, self-hosted, as on the Samam site. */
@font-face {
  font-family: "League Spartan";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/league-spartan-latin.woff2") format("woff2");
}

:root {
  --accent: #511d1d;
  --ink: #374151;
  --ink-strong: #111827;
  --ink-dim: #6b7280;
  --ink-faint: #9ca3af;
  --paper: #ffffff;
  --rule: #d1d5db;
  --well: #f3f4f6;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    "League Spartan",
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
}

.container-main {
  max-width: 48rem;
  margin-inline: auto;
  padding: 3rem 2rem 4rem;
}

@media (max-width: 30rem) {
  .container-main {
    padding: 2.5rem 1rem 3rem;
  }
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

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

/* Header */

header {
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
  border-bottom: 2px solid var(--ink-strong);
}

.kicker {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.25rem, 7vw, 3.25rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
}

.tagline {
  margin: 0;
  font-size: 1.25rem;
  color: var(--ink-dim);
}

.lede {
  font-size: 1.25rem;
  line-height: 1.55;
}

/* Sections */

section {
  margin-bottom: 3.5rem;
}

/* A block inside a section: one wing, or one strand of the work done. */
article {
  margin-bottom: 2.5rem;
}
article:last-child {
  margin-bottom: 0;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink-strong);
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink-strong);
}

p {
  margin: 0 0 1rem;
}
p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 600;
  color: var(--ink-strong);
}

/* Photos and videos. Two columns at every width: the strands of work carry
   many photos, and one column would make the page very long on a phone. A
   .wide figure takes the whole row. */

.media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 0.75rem;
  margin: 1.25rem 0 0;
}

figure {
  margin: 0;
}

.media .wide {
  grid-column: 1 / -1;
}

.media img,
.media video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.375rem;
  background: var(--well);
}

/* The photos come in landscape, portrait and square. In the grid each one
   takes the same 3:2 shape, cropped to its centre, so a row lines up. A .wide
   photo keeps its own shape. */
.media figure:not(.wide) img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* A .whole photo is never cropped: the two maps carry their labels at the
   edges. They are the same shape, 16:9, and sit side by side, so the row
   still lines up. */
.media figure.whole img {
  aspect-ratio: auto;
}

/* A video's own frame size varies: the clips are landscape and one is
   portrait. A fixed shape keeps the grid even, and the player letterboxes. */
.media video {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
}

figcaption {
  margin-top: 0.35rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--ink-dim);
}

@media (max-width: 30rem) {
  figcaption {
    font-size: 0.875rem;
  }
}

/* Footer */

footer {
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-faint);
  font-size: 1rem;
}

footer a {
  color: inherit;
}

/* dark mode - start */
/* Pure CSS, follows the OS setting, as on the Samam site. */
@media screen and (prefers-color-scheme: dark) {
  html {
    color-scheme: dark;
  }

  :root {
    --accent: #d99696;
    --ink: #c9ced7;
    --ink-strong: #e9ebef;
    --ink-dim: #9aa1ae;
    --ink-faint: #868d9b;
    --paper: #0f1115;
    --rule: #373e49;
    --well: #1c2027;
  }

  header {
    border-bottom-color: #7c8593;
  }
}
/* dark mode - end */
