/* Gallery wall: cool neutral walls, white mats, slate-blue for the one thing
   you can act on. Titles of works are set in italic, like a museum label. */

:root {
  --wall: #eceeeb;
  --mat: #fcfcfa;
  --ink: #1f2326;
  --graphite: #5d6369;
  --rule: #d3d6d1;
  --accent: #2d4b6c;
  --accent-ink: #ffffff;
  --warn: #9a3412;
  --hang-shadow: 0 1px 1px rgb(31 35 38 / 0.06), 0 10px 24px -12px rgb(31 35 38 / 0.35);

  --font: "Schibsted Grotesk", system-ui, sans-serif;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.75rem;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --wall: #1a1d1f;
    --mat: #26292c;
    --ink: #e8eae6;
    --graphite: #a0a6ab;
    --rule: #383c40;
    --accent: #9dbbe0;
    --accent-ink: #12202f;
    --warn: #fdba74;
    --hang-shadow: 0 1px 1px rgb(0 0 0 / 0.3), 0 12px 28px -12px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.5;
}

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

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

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

main {
  padding: 0 var(--gutter) 96px;
}

/* ---------------------------------------------------------------- header */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 28px var(--gutter) 0;
}

.site-name {
  font-size: var(--step-1);
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-contact {
  color: var(--graphite);
}

.tagline {
  max-width: 34ch;
  margin: 8px 0 56px;
  color: var(--graphite);
  font-size: var(--step-1);
  line-height: 1.35;
}

/* ---------------------------------------------------------------- the wall */

.mat {
  display: block;
  padding: clamp(10px, 2.2vw, 22px);
  background: var(--mat);
  box-shadow: var(--hang-shadow);
}

.wall {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 3 280px;
  column-gap: clamp(24px, 4vw, 56px);
}

.wall li {
  break-inside: avoid;
  margin-bottom: clamp(32px, 5vw, 64px);
}

.print-link {
  display: block;
  text-decoration: none;
}

.print-link:hover .work-title {
  text-decoration: underline;
}

.label {
  display: flex;
  flex-direction: column;
  margin-top: 14px;
}

.work-title {
  font-style: italic;
  font-weight: 500;
}

.meta {
  color: var(--graphite);
  font-size: var(--step--1);
}

.empty,
.unavailable {
  color: var(--graphite);
}

/* ---------------------------------------------------------------- photo page */

.photo-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  margin-top: 40px;
}

@media (min-width: 900px) {
  .photo-page {
    grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  }
  .wall-label {
    position: sticky;
    top: 32px;
  }
}

.photo-hero {
  margin: 0;
}

.photo-hero img {
  max-height: 78vh;
  width: auto;
  margin: 0 auto;
}

.wall-label h1 {
  margin: 0;
  font-size: var(--step-2);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.description {
  max-width: 60ch;
  margin: 12px 0 0;
  color: var(--graphite);
}

.buy {
  margin-top: 36px;
}

.buy fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.buy legend {
  padding: 0;
  margin-bottom: 14px;
  font-weight: 600;
}

/* Every size is drawn at the same scale and stood on a common baseline, so the
   relative difference between an 8x12 and a 24x36 is visible at a glance. */
.sizes {
  --unit: calc(150px / var(--largest-long));
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px 14px;
}

.size {
  display: grid;
  justify-items: start;
  gap: 2px;
  cursor: pointer;
}

.size input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.to-scale {
  display: block;
  width: max(18px, calc(var(--w) * var(--unit)));
  height: max(18px, calc(var(--h) * var(--unit)));
  margin-bottom: 8px;
  padding: 3px;
  background: var(--mat);
  box-shadow: var(--hang-shadow);
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: outline-color 120ms ease;
}

.to-scale img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.size-name {
  font-size: var(--step--1);
}

.size-price {
  color: var(--graphite);
  font-size: var(--step--1);
}

.size input:checked ~ .to-scale {
  outline-color: var(--accent);
}

.size input:checked ~ .size-name {
  font-weight: 600;
}

.size input:focus-visible ~ .to-scale {
  outline-color: var(--accent);
  outline-style: dashed;
}

.paper,
.shipping {
  margin: 20px 0 0;
  color: var(--graphite);
  font-size: var(--step--1);
  max-width: 44ch;
}

button,
.button {
  appearance: none;
  border: 0;
  border-radius: 2px;
  padding: 12px 22px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.buy button {
  margin-top: 20px;
  min-width: 200px;
}

button:disabled {
  opacity: 0.55;
  cursor: progress;
}

button.quiet {
  background: transparent;
  color: var(--graphite);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  padding-inline: 8px;
}

/* ---------------------------------------------------------------- messages */

.message {
  max-width: 52ch;
  margin-top: 64px;
}

.message h1 {
  font-size: var(--step-2);
  margin: 0 0 12px;
}

/* ---------------------------------------------------------------- admin */

.admin {
  max-width: 1100px;
  margin-top: 24px;
}

.admin section {
  margin-top: 48px;
}

.admin h2 {
  font-size: var(--step-1);
  margin: 0 0 16px;
}

.admin-who,
.hint {
  color: var(--graphite);
  font-size: var(--step--1);
}

.admin input:not([type="checkbox"]):not([type="file"]),
.admin textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--mat);
  color: var(--ink);
  font: inherit;
}

.dropzone {
  display: block;
  padding: 40px 24px;
  border: 2px dashed var(--rule);
  background: var(--mat);
  color: var(--graphite);
  text-align: center;
  cursor: pointer;
}

.dropzone.dragging {
  border-color: var(--accent);
  color: var(--ink);
}

.dropzone input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.upload-log {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  font-size: var(--step--1);
}

.upload-log li {
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
}

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

.admin-photos li {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}

.admin-photos .fields {
  display: grid;
  gap: 10px;
}

.admin-photos label {
  display: grid;
  gap: 4px;
  font-size: var(--step--1);
  color: var(--graphite);
}

.admin-photos label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-photos label.inline input[type="number"] {
  width: 80px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.actions {
  display: flex;
  gap: 4px;
  align-items: center;
  white-space: nowrap;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

.admin-table th {
  text-align: left;
  font-weight: 600;
  padding: 8px 8px 8px 0;
  border-bottom: 1px solid var(--ink);
}

.admin-table td {
  padding: 10px 8px 10px 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.admin-table input[name="price"] {
  max-width: 110px;
}

.add-size {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.warn {
  color: var(--warn);
  margin: 4px 0 0;
}

.status-submitted {
  color: var(--accent);
}

.status-failed {
  color: var(--warn);
  font-weight: 600;
}

@media (max-width: 700px) {
  .admin-photos li {
    grid-template-columns: 80px 1fr;
  }
  .admin-photos .actions {
    grid-column: 2;
  }
  .admin-table {
    display: block;
    overflow-x: auto;
  }
}

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