:root {
  --ink: #0a0a0a;
  --bg: #fff;
  --muted: #6b6b6b;
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --max: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
ol,
dl,
dd {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

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

main:focus {
  outline: none;
}

.wrap {
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 12px;
  z-index: 10;
  padding: 6px 12px;
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(12px);
}

/* ---------- Header & footer ---------- */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 32px;
  padding-block: 22px 16px;
  border-bottom: 2px solid var(--ink);
}

.brand {
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 24px;
  font-weight: 600;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

main {
  padding-bottom: clamp(96px, 12vw, 160px);
}

/* ---------- Page head ---------- */

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.display {
  margin-block: clamp(20px, 5vw, 64px) clamp(20px, 3vw, 36px);
  font-size: clamp(3.25rem, 12vw, 10.5rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.display a {
  text-decoration: none;
}

.display a:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.08em;
}

/* ---------- Body text ---------- */

.entry-body {
  padding-top: 24px;
  border-top: 2px solid var(--ink);
}

.prose {
  max-width: 60ch;
  font-size: clamp(1.125rem, 0.95rem + 0.5vw, 1.375rem);
  line-height: 1.55;
}

.prose p {
  text-wrap: pretty;
}

.prose p + p {
  margin-top: 1em;
}

/* Text on the left, photo on the right; stacked (photo first) on smaller screens. */
.entry-body--photo {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: start;
  gap: 32px clamp(32px, 5vw, 64px);
}

.photo {
  margin: 0;
}

.photo[hidden] {
  display: none;
}

.photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f2f2f2;
}

.photo figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8125rem;
}

/* ---------- Index lists ---------- */

.index {
  margin-top: clamp(72px, 10vw, 128px);
}

.index + .index {
  margin-top: 56px;
}

.index-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
}

.index-head h2 {
  font-size: inherit;
  font-weight: 800;
  text-transform: uppercase;
}

.index-link {
  text-decoration: none;
}

.index-link:hover {
  text-decoration: underline;
}

.rows li {
  border-bottom: 1px solid var(--ink);
}

.row {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  margin-inline: -10px;
  padding: 14px 10px 12px;
  text-decoration: none;
  transition: background-color 0.12s, color 0.12s;
}

.row:hover {
  background: var(--ink);
  color: var(--bg);
}

.row-no,
.row-date {
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Fixed-width digits keep the numbers aligned (only here: this font also widens punctuation). */
.row-no {
  font-variant-numeric: tabular-nums;
}

.row-title {
  font-size: clamp(1.375rem, 2.6vw, 2.125rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.row-date {
  white-space: nowrap;
}

.search {
  width: 100%;
  margin-top: 8px;
  padding: 10px 0;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.5rem;
  font-weight: 600;
  outline: none;
}

.search::placeholder {
  color: var(--muted);
}

.archive-results .index:first-child {
  margin-top: 40px;
}

.empty {
  padding-top: 24px;
  color: var(--muted);
}

/* ---------- Email signup ---------- */

.signup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: clamp(56px, 8vw, 96px);
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}

.signup-title {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.signup-note {
  color: var(--muted);
  font-size: 0.875rem;
}

.signup-form {
  display: flex;
  flex: 0 1 380px;
}

.signup-form input {
  flex: 1;
  min-width: 0;
  border-right: 0;
  background: var(--bg);
  color: var(--ink);
}

.signup-form input::placeholder {
  color: var(--muted);
}

.signup-form input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--ink);
}

/* Small black buttons, shared by the signup form and the email tools. */
.signup-form input,
.signup-form button,
.email-tools button {
  padding: 9px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  font: inherit;
  font-size: 0.9375rem;
}

.signup-form button,
.email-tools button {
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s;
}

.signup-form button:hover,
.email-tools button:hover {
  background: var(--bg);
  color: var(--ink);
}

/* ---------- Email tools (only shown with ?email) ---------- */

.email-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1.5px dashed var(--ink);
}

.email-tools-label {
  margin-right: auto;
  font-weight: 700;
}

.email-tools-status {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.875rem;
}

.email-tools-status:empty {
  display: none;
}

/* ---------- Post pager ---------- */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: clamp(72px, 10vw, 128px);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.pager-link {
  display: grid;
  gap: 6px;
  grid-column: 1;
  padding: 18px 20px 20px;
  text-decoration: none;
  transition: background-color 0.12s, color 0.12s;
}

.pager-link--next {
  grid-column: 2;
  border-left: 1px solid var(--ink);
  text-align: right;
}

.pager-link:hover {
  background: var(--ink);
  color: var(--bg);
}

.pager-label {
  font-size: 0.9375rem;
  font-weight: 600;
}

.pager-title {
  font-size: clamp(1.5rem, 3.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

/* ---------- Smaller screens ---------- */

@media (max-width: 860px) {
  .entry-body--photo {
    grid-template-columns: minmax(0, 1fr);
  }

  .photo {
    order: -1;
  }
}

@media (max-width: 560px) {
  .signup-form {
    flex-basis: 100%;
  }

  .row {
    grid-template-columns: 2.25rem minmax(0, 1fr) auto;
    gap: 12px;
  }

  .row-no,
  .row-date {
    font-size: 0.8125rem;
  }

  .pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager-link,
  .pager-link--next {
    grid-column: 1;
    padding-inline: 0;
  }

  .pager-link--next {
    border-top: 1px solid var(--ink);
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
