/* Garage Sale — public stylesheet.
   Colour, type and sizing come from /theme.css as custom properties, so the
   admin can retune the site without touching this file. See docs/DESIGN.md. */

/* ---------------------------------------------------------------- fonts */

@font-face {
  font-family: 'Anton';
  src: url('../fonts/anton-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------- base */

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

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

body {
  margin: 0;
  background: var(--gs-paper);
  color: var(--gs-ink);
  font-family: var(--gs-font-body);
  font-size: 1rem;
  line-height: 1.55;
  font-synthesis-weight: none;
}

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

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--gs-accent); }

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

.shell {
  width: min(100% - 2.5rem, var(--gs-max-width));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gs-ink);
  color: var(--gs-paper);
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------------------------------------------------------------- type */

h1, h2, h3 {
  font-family: var(--gs-font-display);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.005em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.4rem, 7vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; max-width: 68ch; }

.lede { font-size: 1.08rem; }
.muted { color: var(--gs-muted); }
.small { font-size: 0.875rem; }

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

.site-header {
  background: var(--gs-paper);
  border-bottom: var(--gs-border) solid var(--gs-ink);
  padding: 1.75rem 0 1.25rem;
}
.site-header__content > :first-child { margin-top: 0; }
.site-header__content > :last-child { margin-bottom: 0; }
.site-header__content h1 { margin-bottom: 0.15em; }
.site-header__content p { color: var(--gs-muted); max-width: 60ch; }
.site-header__logo { max-height: 96px; width: auto; }

/* ---------------------------------------------------------------- menu */

.menu {
  background: var(--gs-ink);
  color: var(--gs-paper);
  position: sticky;
  top: 0;
  z-index: 40;
}
.menu__bar {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 3.25rem;
}
.menu__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  flex: 1;
  gap: 0;
}
.menu__list--end { flex: 0 0 auto; justify-content: flex-end; }

.menu__link,
.menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 100%;
  padding: 0.85rem 1.1rem;
  font-family: var(--gs-font-display);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--gs-paper);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 400;
}
.menu__link:hover,
.menu__toggle:hover { background: rgba(255, 255, 255, 0.12); }

.menu__link[aria-current='page'] {
  box-shadow: inset 0 -5px 0 var(--gs-accent);
}

/* Categories dropdown. A <details> element, so it works without JS, on touch,
   and from the keyboard — a :hover menu does none of those. */
.menu__dropdown { position: relative; display: flex; }
.menu__dropdown > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
}
.menu__dropdown > summary::-webkit-details-marker { display: none; }
.menu__caret { font-size: 0.65em; transform: translateY(1px); }
.menu__dropdown[open] > summary { background: rgba(255, 255, 255, 0.12); }

.menu__panel {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 15rem;
  background: var(--gs-paper);
  color: var(--gs-ink);
  border: var(--gs-border) solid var(--gs-ink);
  border-top: 0;
  padding: 0.4rem;
  margin: 0;
  list-style: none;
  z-index: 50;
}
.menu__panel a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.65rem;
  text-decoration: none;
}
.menu__panel a:hover { background: var(--gs-surface); }
.menu__panel .count { color: var(--gs-muted); font-size: 0.85rem; }

.menu__burger { display: none; }

/* ---------------------------------------------------------------- ribbon */

.ribbon {
  background: var(--gs-surface);
  border-bottom: var(--gs-border) solid var(--gs-ink);
  padding: 1.1rem 0 1.35rem;
  overflow: hidden;
}
.ribbon__heading {
  font-family: var(--gs-font-body);
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.7rem;
  color: var(--gs-muted);
}
/* Full-bleed so the row can scroll past the page gutter without being clipped
   by it; the gutter is reproduced as padding on the track, so the first card
   still lines up with the heading above it. */
.ribbon__viewport {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.ribbon__viewport::-webkit-scrollbar { display: none; }
.ribbon__track {
  display: flex;
  gap: 0.9rem;
  padding-inline: max(1.25rem, calc((100% - var(--gs-max-width)) / 2));
  width: max-content;
}
.ribbon__item {
  flex: 0 0 auto;
  width: 190px;
  background: var(--gs-paper);
  border: var(--gs-border) solid var(--gs-ink);
  border-radius: var(--gs-radius);
  text-decoration: none;
  overflow: hidden;
}
.ribbon__item img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; height: auto; }
.ribbon__caption { padding: 0.5rem 0.6rem 0.6rem; }
.ribbon__title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ribbon__price { font-size: 0.85rem; color: var(--gs-muted); margin-top: 0.15rem; }

/* ---------------------------------------------------------------- grid */

.section { padding: 2.5rem 0 3.5rem; }
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.section__head h2 { margin: 0; }

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

/* Cards are objects on a folding table: hard border, no shadow. */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--gs-paper);
  border: var(--gs-border) solid var(--gs-ink);
  border-radius: var(--gs-radius);
}
.card__link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.card__link:focus-visible { outline-offset: 4px; }
.card__media {
  position: relative;
  background: var(--gs-surface);
  border-bottom: var(--gs-border) solid var(--gs-ink);
}
.card__media img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; height: auto; }
.card__media--empty {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  color: var(--gs-muted);
  font-size: 0.85rem;
}
.card__body { padding: 0.85rem 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.card__title { font-family: var(--gs-font-body); font-weight: 700; font-size: 1.02rem; line-height: 1.25; margin: 0; }
.card__excerpt { color: var(--gs-muted); font-size: 0.88rem; margin: 0; }
.card__foot { margin-top: auto; padding-top: 0.55rem; font-size: 0.82rem; color: var(--gs-muted); }

/* The price sticker: the one loud element on the page. A day-glo dot from a
   roll of them, slapped on slightly crooked. */
.sticker {
  position: absolute;
  right: -0.55rem;
  bottom: -0.9rem;
  z-index: 2;
  width: 4.3rem;
  height: 4.3rem;
  border-radius: 50%;
  background: var(--gs-accent);
  color: var(--gs-accent-ink);
  display: grid;
  place-content: center;
  text-align: center;
  transform: rotate(-8deg);
  border: 2px solid var(--gs-ink);
  padding: 0.2rem;
}
.sticker__price {
  font-family: var(--gs-font-display);
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: -0.01em;
}
.sticker__price--long { font-size: 0.95rem; }
.sticker__obo {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  margin-top: 0.18rem;
}
.sticker--sold {
  background: var(--gs-sold);
  color: var(--gs-ink);
  transform: rotate(6deg);
}
.sticker--sold .sticker__price { font-size: 1rem; }
.sticker--lg { width: 6rem; height: 6rem; right: -1rem; bottom: -1.4rem; }
.sticker--lg .sticker__price { font-size: 1.6rem; }
.sticker--lg .sticker__obo { font-size: 0.7rem; }

.card--sold .card__media img { filter: saturate(0.35) opacity(0.75); }

.badge-claims {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gs-ink);
  background: var(--gs-surface);
  border: 1px solid var(--gs-ink);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}

/* ---------------------------------------------------------------- item page */

.item {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 2.5rem;
  padding: 2.5rem 0 3.5rem;
  align-items: start;
}
.item__gallery { position: relative; }
.item__figure {
  /* Positioned so the price sticker hangs off the photo frame. Without this it
     anchors to .item__gallery, which includes the thumbnail strip, and ends up
     floating below the photo. No overflow:hidden for the same reason — the
     sticker is meant to overhang the edge. */
  position: relative;
  margin: 0;
  border: var(--gs-border) solid var(--gs-ink);
  border-radius: var(--gs-radius);
  background: var(--gs-surface);
}
.item__figure img { aspect-ratio: 4 / 3; object-fit: contain; width: 100%; height: auto; background: var(--gs-surface); }
.item__thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.7rem;
  flex-wrap: wrap;
  padding: 0;
  list-style: none;
}
.item__thumb {
  width: 68px;
  height: 68px;
  padding: 0;
  border: var(--gs-border) solid var(--gs-ink);
  border-radius: var(--gs-radius);
  background: none;
  cursor: pointer;
  overflow: hidden;
}
.item__thumb img { width: 100%; height: 100%; object-fit: cover; }
.item__thumb[aria-current='true'] { outline: 3px solid var(--gs-accent); outline-offset: 1px; }

.item__title { margin-bottom: 0.35rem; }
.item__cats { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0 0 1.2rem; list-style: none; }
.item__cats a {
  font-size: 0.8rem;
  text-decoration: none;
  border: 1px solid var(--gs-ink);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
}
.item__cats a:hover { background: var(--gs-surface); }

.item__price {
  font-family: var(--gs-font-display);
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1;
  margin: 0 0 0.15rem;
}
.item__obo { color: var(--gs-muted); margin-bottom: 1.3rem; }
.item__desc { margin-bottom: 1.6rem; }
.item__desc > :last-child { margin-bottom: 0; }

.claimbox {
  border: var(--gs-border) solid var(--gs-ink);
  border-radius: var(--gs-radius);
  padding: 1.15rem 1.2rem;
  background: var(--gs-surface);
}
.claimbox > :last-child { margin-bottom: 0; }
.claimbox h3 { font-family: var(--gs-font-body); font-weight: 700; font-size: 1rem; margin-bottom: 0.4rem; }
.claimbox__position {
  font-family: var(--gs-font-display);
  font-size: 1.6rem;
  line-height: 1.1;
  margin: 0 0 0.3rem;
}

/* --------------------------------------------------------------- questions

   Questions and answers below the item. Same hard-edged card as everything
   else; the answer is inset on the surface colour so a long thread reads as
   pairs rather than as one wall of paragraphs. */

.qa { max-width: 44rem; }
.qa h2 { margin-bottom: 1rem; }
.qa--list { list-style: none; padding: 0; margin: 0; }

.qa__item {
  border: var(--gs-border) solid var(--gs-ink);
  border-radius: var(--gs-radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  background: var(--gs-paper);
}
.qa__item > :last-child { margin-bottom: 0; }

/* The asker's own, which nobody else can see. */
.qa__item--mine { border-style: dashed; }

.qa__q { font-weight: 700; margin-bottom: 0.3rem; }
.qa__meta { color: var(--gs-muted); font-size: 0.85rem; margin: 0; }

.qa__a {
  margin-top: 0.85rem;
  padding: 0.8rem 0.9rem;
  background: var(--gs-surface);
  border-left: var(--gs-border) solid var(--gs-accent);
}
.qa__a > :last-child { margin-bottom: 0; }
.qa__a p { margin-bottom: 0.3rem; }

.qa__note { color: var(--gs-muted); font-size: 0.9rem; font-style: italic; margin: 0.6rem 0 0; }

.qa__form { margin-top: 1.5rem; }
.qa__form textarea { min-height: 5rem; }

/* ---------------------------------------------------------------- controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--gs-font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.7rem 1.25rem;
  border: var(--gs-border) solid var(--gs-ink);
  border-radius: var(--gs-radius);
  background: var(--gs-paper);
  color: var(--gs-ink);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--gs-surface); }
.btn--primary { background: var(--gs-accent); color: var(--gs-accent-ink); }
.btn--primary:hover { filter: brightness(1.07); background: var(--gs-accent); }
.btn--block { width: 100%; }
.btn--small { font-size: 0.85rem; padding: 0.4rem 0.75rem; }
.btn--quiet { background: none; border-color: transparent; text-decoration: underline; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.3rem; }
.field .hint { color: var(--gs-muted); font-size: 0.85rem; margin: 0.25rem 0 0; }
.field .error { color: #B3120B; font-size: 0.85rem; margin: 0.25rem 0 0; font-weight: 600; }

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='password'],
input[type='number'],
input[type='search'],
select,
textarea {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: var(--gs-border) solid var(--gs-ink);
  border-radius: var(--gs-radius);
  background: var(--gs-paper);
  color: inherit;
}
textarea { min-height: 8rem; resize: vertical; }
select { appearance: none; padding-right: 2rem; }

.code-input {
  font-family: var(--gs-font-display);
  font-size: 2rem;
  letter-spacing: 0.5em;
  text-align: center;
  padding-left: 0.5em;
}

.form-narrow { max-width: 26rem; }

/* ---------------------------------------------------------------- flash */

.flash { margin: 1.25rem 0; padding: 0.85rem 1rem; border: var(--gs-border) solid var(--gs-ink); border-radius: var(--gs-radius); font-weight: 600; }
.flash--success { background: var(--gs-sold); }
.flash--error { background: #FFE2DC; }
.flash--info { background: var(--gs-surface); }

/* ---------------------------------------------------------------- pagination */

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: var(--gs-border) solid var(--gs-ink);
}
.pagination__pages { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; list-style: none; margin: 0; padding: 0; }
.pagination__pages a,
.pagination__pages span {
  display: inline-block;
  min-width: 2.3rem;
  text-align: center;
  padding: 0.35rem 0.5rem;
  border: var(--gs-border) solid var(--gs-ink);
  border-radius: var(--gs-radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.pagination__pages [aria-current='page'] { background: var(--gs-ink); color: var(--gs-paper); }
.pagination__pages .gap { border: 0; min-width: auto; }
.pagination__perpage { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.pagination__perpage select { width: auto; }

/* ---------------------------------------------------------------- empty */

.empty {
  border: var(--gs-border) dashed var(--gs-ink);
  border-radius: var(--gs-radius);
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--gs-muted);
}
.empty h2 { color: var(--gs-ink); }
.empty p { margin-inline: auto; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  border-top: var(--gs-border) solid var(--gs-ink);
  background: var(--gs-surface);
  padding: 2rem 0 3rem;
  margin-top: 3rem;
}
.site-footer__content > :last-child { margin-bottom: 0; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 1.1rem; list-style: none; padding: 0; margin: 1rem 0 0; font-size: 0.9rem; }

/* ---------------------------------------------------------------- errors */

.error-page { padding: 5rem 0; }
.error-page__status { font-family: var(--gs-font-display); font-size: 5rem; line-height: 1; color: var(--gs-accent); margin: 0; }
.error-page pre { background: var(--gs-surface); padding: 1rem; overflow-x: auto; font-size: 0.8rem; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .item { grid-template-columns: 1fr; gap: 1.75rem; }
}

@media (max-width: 700px) {
  .menu__bar { flex-wrap: wrap; align-items: center; }
  .menu__burger {
    display: inline-flex;
    margin-left: auto;
    order: 1;
  }
  .menu__list {
    order: 3;
    flex: 1 0 100%;
    flex-direction: column;
    align-items: stretch;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
  }
  .menu__list[hidden] { display: none; }
  .menu__list--end {
    order: 2;
    flex: 0 0 auto;
    border-top: 0;
    flex-direction: row;
  }
  .menu__dropdown { display: block; }
  .menu__panel {
    position: static;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    background: var(--gs-paper);
  }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.25rem 0.9rem; }
  .sticker { width: 3.5rem; height: 3.5rem; }
  .sticker__price { font-size: 0.95rem; }
  .sticker__obo { font-size: 0.52rem; }
  .pagination { flex-direction: column; align-items: flex-start; }
}

/* ---------------------------------------------------------------- motion */

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

@media print {
  .menu, .ribbon, .site-footer, .claimbox, .qa__form { display: none; }
}

/* ---------------------------------------------------------------- utilities

   A small set of spacing helpers. These exist because the Content-Security-
   Policy forbids inline styles: `style="margin-top:1rem"` is silently dropped
   by the browser, so every such adjustment needs a class. */

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: 0.6rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.25rem; }
.mt-3 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 1.25rem; }
.pt-0 { padding-top: 0; }
.pb-0 { padding-bottom: 0; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.bullets { padding-left: 1.1rem; }
.no-rule { border: 0; padding-left: 0; }
.ratio-4-3 { aspect-ratio: 4 / 3; }
.card__foot-actions { padding: 0 0.9rem 0.9rem; }

/* ---------------------------------------------------------------- brand */

/* Logo above the site name, both inside one link home. The name comes from the
   site settings rather than the editable header block, so nothing an admin
   types into the editor can remove or reformat it. */
.site-header__brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
  margin-bottom: 0.35rem;
}
.site-header__title {
  font-family: var(--gs-font-display);
  font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.005em;
  display: block;
}
.site-header__brand:hover .site-header__title,
.site-header__brand:focus-visible .site-header__title {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
  text-decoration-color: var(--gs-accent);
}
.site-header__logo {
  max-height: 84px;
  width: auto;
}

/* The built-in mark. Rotated a couple of degrees so it reads as a sign someone
   nailed up in a hurry rather than a piece of corporate furniture. */
.logo-mark {
  width: 108px;
  height: 77px;
  display: block;
  overflow: visible;
  transform: rotate(-3deg);
}
.logo-mark__sign path {
  fill: var(--gs-accent);
  stroke: var(--gs-ink);
  stroke-width: 5;
  stroke-linejoin: round;
}
.logo-mark__nail {
  fill: var(--gs-paper);
  stroke: var(--gs-ink);
  stroke-width: 3.5;
}

@media (max-width: 700px) {
  .logo-mark { width: 74px; height: 53px; }
  .site-header__logo { max-height: 58px; }
}

/* The catalogue heading is the home page's h1, but it should look the same as
   the section headings elsewhere rather than competing with the site name. */
.section__head h1 {
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  margin: 0;
}
.site-header__tagline {
  color: var(--gs-muted);
  max-width: 60ch;
  margin: 0 0 0.75rem;
}

/* Separates "Everything" from the categories proper in the dropdown. */
.menu__panel-rule {
  height: 1px;
  background: var(--gs-ink);
  opacity: 0.18;
  margin: 0.35rem 0.65rem;
}
.menu__panel a[aria-current='page'] { background: var(--gs-surface); font-weight: 700; }
