/*
 * Neutral minimal stylesheet.
 *
 * This is a starting point, not a design: readable line lengths, visible
 * focus, a working skip link and nothing that presumes colours, fonts or a
 * CSS framework.  The design decisions belong to the frontend work and
 * replace this file.
 */

:root {
  --measure: 42rem;
  --space: 1rem;
  --color-text: #1a1a1a;
  --color-background: #ffffff;
  --color-muted: #5a5a5a;
  --color-accent: #005a9c;
  --color-border: #d0d0d0;
}

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

html {
  font-family: system-ui, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-background);
}

body {
  margin: 0;
}

main,
.site-header,
.site-footer {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--space);
}

/* Blog intro and paging controls sit inside <main> and inherit its width. */
.paging-footer {
  margin-top: var(--space);
}

a {
  color: var(--color-accent);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--color-background);
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space);
  align-items: baseline;
  justify-content: space-between;
  padding-block: var(--space);
  border-bottom: 1px solid var(--color-border);
}

.site-title {
  margin: 0;
  font-weight: 700;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer {
  margin-top: calc(var(--space) * 3);
  padding-block: var(--space);
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
}

.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post {
  padding-block: var(--space);
  border-bottom: 1px solid var(--color-border);
}

.post-meta {
  margin-block: 0.25rem;
  color: var(--color-muted);
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-block: var(--space);
}

.pagination-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination-link {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--color-border);
}

.pagination-link.is-disabled {
  color: var(--color-muted);
}

.pagination-link.is-current {
  font-weight: 700;
}

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

/* The cover image of a post: spacing only, like the blocks below. */
figure.post-cover {
  margin: 0 0 1.5rem;
}

/* StreamField blocks: only spacing, no design decision. */
figure.block-image {
  margin: 1.5rem 0;
}

figure.block-image figcaption {
  margin-top: 0.25rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.download-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
}

.gallery-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Native <dialog>: the browser positions and centres it and paints the
   backdrop, so only the neutral chrome of the element is reset here. */
.gallery-modal {
  max-width: min(90vw, 60rem);
  max-height: 90vh;
  padding: 0;
  border: 0;
  overflow: auto;
  color: inherit;
  background: transparent;
}

.gallery-modal::backdrop {
  background: rgb(0 0 0 / 80%);
}

.gallery-modal-content {
  padding: var(--space);
  background: var(--color-background);
}

.gallery-modal-nav {
  display: flex;
  gap: var(--space);
  justify-content: space-between;
  margin-top: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
