/* ---- /ideas: the gallery ----
   Layout only. Every colour on a card comes from /ideas.css (generated, one class per
   look-and-accent combination) because the site runs style-src 'self' and a style attribute would
   not apply. Nothing in this file knows about any particular look. */

.gallery { max-width: 84rem; margin: 0 auto; padding: 1.5rem 1.25rem 5rem; }
.gallery .back { display: inline-block; color: var(--ink); font-size: .95rem; margin-bottom: 1.4rem; }
.gallery h1 {
  font-family: var(--font-head); font-weight: var(--head-weight); letter-spacing: var(--head-tracking); text-transform: var(--head-case); line-height: .95; margin: 0;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
}
.gal-lede { max-width: 46rem; margin: 1rem 0 .5rem; font-size: 1.05rem; color: var(--ink); }
.gal-fine { max-width: 46rem; margin: 0 0 1.6rem; font-size: .9rem; color: var(--muted); }
.gal-tail { margin: 2.5rem 0 0; color: var(--muted); }
.gal-empty { margin: 2.5rem 0 0; color: var(--muted); }

/* ---- the controls ---- */
.gal-controls { display: grid; gap: .8rem; margin-bottom: 1.8rem; }
.gal-search input {
  width: 100%; max-width: 32rem; min-height: 48px;
  padding: .7rem 1rem; font: inherit; font-size: 1rem;
  background: var(--hover); color: var(--ink);
  border: 2px solid var(--hairline); border-radius: 999px;
}
.gal-search input::placeholder { color: var(--muted); }
.gal-search input:focus-visible { border-color: var(--line-strong); outline: none; box-shadow: none; }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  font: inherit; font-size: .86rem; font-weight: 700; cursor: pointer;
  min-height: 40px; padding: .4rem .85rem; border-radius: 999px;
  background: transparent; color: var(--ink);
  border: 2px solid var(--hairline);
}
.chip b { font-weight: 600; opacity: .55; margin-left: .25rem; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--hairline); }
.chip[aria-pressed="true"] { background: var(--mint); color: var(--ink); border-color: var(--line-strong); }
.chip[aria-pressed="true"] b { opacity: .7; }
.chips-small .chip { font-size: .8rem; min-height: 36px; padding: .3rem .7rem; }
.gal-count { margin: .2rem 0 0; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- the grid ----
   content-visibility lets the browser skip laying out and painting the cards nobody has scrolled
   to. contain-intrinsic-size gives it a believable height for those it skips, so the scrollbar
   does not jump around as they come into view. */
.gc-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
}
.gc-item { content-visibility: auto; contain-intrinsic-size: auto 15rem; }
.gc-item[hidden] { display: none; }

.gc { display: grid; gap: .5rem; text-decoration: none; color: inherit; }
.gc-frame {
  display: grid; gap: .4rem; align-content: start;
  padding: .95rem 1rem 1.05rem; min-height: 11.5rem;
  transition: transform .18s ease;
}
.gc:hover .gc-frame { transform: translateY(-3px); }
.gc:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: var(--r); }

.gc-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.gc-eyebrow {
  font-size: .58rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gc-dot { flex: none; width: 16px; height: 16px; }
.gc-hero { font-size: 1.15rem; line-height: 1.12; overflow-wrap: anywhere; }
.gc-sub { font-size: .8rem; line-height: 1.35; }
.gc-row { display: flex; gap: .35rem; margin-top: .3rem; }
.gc-field { flex: 1; min-width: 0; height: 30px; }
.gc-cta {
  flex: none; display: inline-flex; align-items: center;
  padding: 0 .75rem; height: 30px; font-size: .75rem; font-weight: 700;
}

.gc-foot { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.gc-swatches { display: flex; gap: 3px; flex: none; }
.gc-swatches i { width: 11px; height: 11px; border-radius: 2px; border: 1px solid var(--hairline); }
.gc-tags { display: flex; flex-wrap: wrap; gap: .3rem; font-size: .68rem; color: var(--muted); }
.gc-tags span::after { content: " ·"; }
.gc-tags span:last-child::after { content: ""; }

/* ---- phones: get to the cards ----
   Wrapped, eleven kind chips and six need chips are nine stacked rows — a full screen of filters
   before a single idea. One swipeable line each puts the first cards above the fold, which is the
   whole point of the page. */
@media (max-width: 760px) {
  .gallery { padding-top: 1rem; }
  .gal-lede { font-size: 1rem; margin: .8rem 0 .4rem; }
  .gal-fine { margin-bottom: 1.1rem; }
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    /* the row runs to the screen edge, so it reads as scrollable rather than clipped */
    margin-inline: -1.25rem;
    padding-inline: 1.25rem;
    scroll-snap-type: x proximity;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; scroll-snap-align: start; }
}

/* Two columns on a phone, not one. A single column of big cards is a feed you scroll forever;
   browsing wants several in the eye at once. The card shrinks to suit rather than the grid
   stretching one card across the screen. */
@media (max-width: 560px) {
  .gallery { padding-inline: 1rem; }
  .gal-controls .chips { margin-inline: -1rem; padding-inline: 1rem; }
  .gc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .gc-item { contain-intrinsic-size: auto 12rem; }
  .gc-frame { min-height: 9.5rem; padding: .7rem .75rem .8rem; gap: .3rem; }
  .gc-eyebrow { font-size: .52rem; letter-spacing: .12em; }
  .gc-dot { width: 12px; height: 12px; }
  .gc-hero { font-size: .92rem; }
  .gc-sub { font-size: .72rem; line-height: 1.3; }
  .gc-field, .gc-cta { height: 26px; }
  .gc-cta { font-size: .68rem; padding: 0 .55rem; }
  .gc-tags { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .gc-frame, .gc:hover .gc-frame { transition: none; transform: none; }
}
