/* The frame is `--wrap`, one width for every route. This page used to carry a
   seventh width of its own, which put its header 18 px right of every other
   page's header. */

.gallery-intro {
  max-width: 760px;
  margin-bottom: clamp(1.5rem, 4vw, 2.75rem);
}

.gallery-intro h1 {
  max-width: 18ch;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.gallery-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.gallery-card > article > :not(.gallery-visual) {
  margin-inline: clamp(1rem, 2.5vw, 1.4rem);
}

.gallery-visual {
  position: relative;
  aspect-ratio: 16 / 8.6;
  margin: 0 0 1rem;
  overflow: hidden;
  border-block-end: 1px solid var(--line);
  background: var(--paper);
}

.gallery-visual img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.gallery-visual figcaption {
  position: absolute;
  inset-inline-start: 0.6rem;
  inset-block-end: 0.55rem;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  background: rgb(5 7 10 / 82%);
  color: var(--ink);
  font: 0.68rem/1.25 ui-sans-serif, system-ui, sans-serif;
}

.gallery-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.gallery-card h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
}

.gallery-mode,
.gallery-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font: 700 0.72rem/1.2 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gallery-mode {
  background: rgb(217 164 65 / 12%);
  color: var(--accent);
}

.gallery-status {
  margin: 0 0 1rem;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

/* Two columns inside a 380px card gave each spec 160px, so "small, generated,
   generated, rgb" broke after every second word and the card read as a column of
   fragments. The pair splits only where there is room for both halves. */
.gallery-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.gallery-facts > div {
  min-width: 0;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}

.gallery-facts dt {
  margin-bottom: 0.25rem;
  color: var(--ink-soft);
  font: 700 0.72rem/1.3 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gallery-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.gallery-limit {
  margin: 1rem 0;
  padding: 0.75rem;
  border-left: 3px solid var(--warn);
  background: rgb(226 160 74 / 9%);
}

.gallery-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-block: 1rem clamp(1rem, 2.5vw, 1.4rem);
}

.gallery-try,
.gallery-pending {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-weight: 700;
}

.gallery-try {
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
}

.gallery-try:focus-visible {
  outline: 3px solid var(--paper);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--accent);
}

.gallery-pending {
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.gallery-action-note {
  flex: 1 1 220px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.gallery-note {
  margin-top: 1.25rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.gallery-note h2 {
  margin-top: 0;
}

@media (max-width: 760px) {
  .gallery-grid,
  .gallery-facts {
    grid-template-columns: 1fr;
  }

  .gallery-card-header {
    display: block;
  }

  .gallery-mode {
    margin-top: 0.65rem;
  }
}
