/* Bazar Hozák — mobile first, no JS, system fonts.
   One loud element: the yellow price sticker (cenovka) on every photo. */

:root {
  --page: #eceff1;
  --surface: #ffffff;
  --ink: #1d2731;
  --muted: #5b6773;
  --line: #d3d9de;
  --link: #1f5fae;
  --sticker: #ffd84d;
  --sticker-ink: #1d2731;
  --sold: #b3261e;

  --round: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;

  --gutter: 1rem;
  --radius: 0.75rem;
  --measure: 36rem;
  --wide: 72rem;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #12181e;
    --surface: #1b232b;
    --ink: #e6ebef;
    --muted: #9aa6b1;
    --line: #2e3a45;
    --link: #8ab4f8;
    --sticker: #f2cc45;
    --sold: #ff8a80;
  }
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 1rem/1.5 var(--sans);
}

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

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

a:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}

main,
.masthead,
.footer {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */

.masthead {
  padding-top: 1.5rem;
  padding-bottom: 0.75rem;
}

.brand {
  font: 800 1.75rem/1.1 var(--round);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--muted);
  max-width: var(--measure);
}

/* Category chips scroll sideways on a phone instead of wrapping into a wall. */

.categories {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  margin: 0.5rem calc(-1 * var(--gutter)) 1.25rem;
  padding: 0.25rem var(--gutter);
  scrollbar-width: none;
}

.categories a {
  flex: none;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.categories a[aria-current] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--page);
}

.heading {
  font: 800 1.5rem/1.2 var(--round);
  margin: 0 0 1rem;
}

/* Card grid */

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 0.75rem;
}

.card a {
  position: relative;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
}

.cover img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--line);
}

.card .name {
  margin-top: 0.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.card a:hover .name {
  text-decoration: underline;
}

.card .size {
  color: var(--muted);
  font-size: 0.875rem;
}

.is-sold .cover img {
  filter: grayscale(1);
  opacity: 0.6;
}

/* The sticker: punched hole on the left like a paper price tag. */

.tag {
  display: inline-block;
  padding: 0.3rem 0.7rem 0.3rem 1.35rem;
  border-radius: 0.4rem;
  background:
    radial-gradient(circle at 0.6rem 50%, var(--page) 0.2rem, transparent 0.24rem),
    var(--sticker);
  color: var(--sticker-ink);
  font: 800 1rem/1.2 var(--round);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
}

.stamp {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border: 2px solid var(--sold);
  border-radius: 0.3rem;
  color: var(--sold);
  font: 800 1rem/1.2 var(--round);
  transform: rotate(-6deg);
}

.card .tag,
.card .stamp {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
}

.card .stamp {
  background: var(--surface);
}

.empty {
  color: var(--muted);
}

/* Pagination */

.pages {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0 0;
}

.pages [rel="prev"] {
  justify-self: start;
}

.pages [rel="next"] {
  justify-self: end;
}

.pages a {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  text-decoration: none;
}

.pages .count {
  color: var(--muted);
  font-size: 0.875rem;
}

/* Item page */

.crumbs {
  margin: 0.25rem 0 1rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Phone: title + price, photos, facts. Desktop: photos left, the rest right. */

.item {
  display: grid;
  grid-template-areas: "head" "photos" "details";
  gap: 1.25rem;
}

.head {
  grid-area: head;
}

.photos {
  grid-area: photos;
}

.details {
  grid-area: details;
}

.photos {
  display: grid;
  gap: 0.75rem;
}

.photos img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--line);
}

.title {
  font: 800 1.6rem/1.2 var(--round);
  margin: 0 0 0.6rem;
  max-width: var(--measure);
}

.head .tag,
.head .stamp {
  margin: 0.25rem 0 0;
  font-size: 1.25rem;
}

.facts {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
}

.facts th,
.facts td {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.facts th {
  width: 7.5rem;
  color: var(--muted);
  font-weight: 400;
}

.description {
  max-width: var(--measure);
}

.description p {
  margin: 0 0 0.75rem;
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0;
  padding: 0;
}

.tags li {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.contact {
  margin: 1.5rem 0 1rem;
}

.button {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  background: var(--link);
  color: var(--surface);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  filter: brightness(1.1);
}

.ads {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.ads li + li {
  margin-top: 0.25rem;
}

.missing {
  padding: 2rem 0;
  max-width: var(--measure);
}

/* Footer */

.footer {
  margin-top: 3rem;
  padding-bottom: 2rem;
  color: var(--muted);
  font-size: 0.875rem;
}

/* Rule on the paragraph so it lines up with the content, not the gutter. */
.footer p {
  margin: 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* Wider screens: more columns, item photos left and facts sticky right. */

@media (min-width: 40rem) {
  :root {
    --gutter: 1.5rem;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem 1.25rem;
  }
}

@media (min-width: 64rem) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .item {
    grid-template-areas: "photos head" "photos details";
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-rows: auto 1fr;
    gap: 1.25rem 2.5rem;
    align-items: start;
  }

  .details {
    position: sticky;
    top: 1.5rem;
  }
}
