
:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #ddd6cc;
  --accent: #7c4f28;
  --accent-2: #5f3b1d;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

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

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: #fffaf5;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-row,
.footer-row,
.button-row,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-row {
  padding: 14px 0;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  text-decoration: none;
}

.site-logo {
  width: clamp(260px, 34vw, 420px);
  height: auto;
  max-height: 120px;
  object-fit: contain;
}

.header-cta {
  white-space: nowrap;
}

h1, h2, h3, p, figure {
  margin: 0;
}

.muted,
#results-meta {
  color: var(--muted);
}

.main-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding: 24px 0;
}

.card,
.listing-card,
.detail-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card { padding: 18px; }

.stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.filters-panel {
  border: 0;
}

.filters-summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filters-summary::-webkit-details-marker {
  display: none;
}

.filters-summary::after {
  content: "−";
  font-size: 1.25rem;
  line-height: 1;
}

.filters-panel:not([open]) .filters-summary::after {
  content: "+";
}

input,
select,
textarea,
button { font: inherit; }

button,
a.button,
summary {
  min-height: 44px;
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

textarea { resize: vertical; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.button.primary:hover { background: var(--accent-2); }

.content { min-width: 0; }

.listing-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
}

.listing-card {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.listing-image {
  aspect-ratio: 4 / 3;
  background: #ece7e1;
}

.listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-body {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.listing-price {
  font-size: 1.15rem;
  font-weight: 700;
}

.meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.detail-wrap { padding-bottom: 24px; }
.detail-card { overflow: hidden; }

.detail-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr;
}

.detail-image-shell {
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #fbfaf8;
  display: grid;
  gap: 12px;
}

.detail-main-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: #ece7e1;
}

.detail-main-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}

.thumb-button {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}

.thumb-button.active { border-color: var(--accent); }

.thumb-button img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.detail-body {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.detail-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.post-wrap { padding-bottom: 36px; }

.post-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.upload-field {
  display: grid;
  gap: 8px;
}

.upload-label { font-weight: 600; }

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.preview-tile {
  background: #fbfaf8;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.preview-tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.preview-tile figcaption {
  padding: 8px 10px;
  font-size: 0.8rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden { display: none; }

.site-footer {
  padding: 18px 0 28px;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .main-grid,
  .detail-layout,
  .two-col {
    grid-template-columns: 1fr;
  }

  .detail-image-shell {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  .wrap {
    width: min(100%, calc(100% - 20px));
  }

  .site-header {
    position: static;
  }

  .header-row,
  .footer-row,
  .button-row,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .header-row {
    padding: 12px 0 14px;
  }

  .brand-lockup {
    justify-content: center;
  }

  .site-logo {
    width: min(360px, 94vw);
    max-height: 150px;
    margin: 0 auto;
  }

  .header-cta,
  .button-row .button {
    width: 100%;
  }

  .card { padding: 14px; }

  .filters-panel {
    display: block;
  }

  .listing-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .listing-body,
  .detail-body,
  .detail-image-shell {
    padding: 14px;
  }

  .thumb-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-row span:last-child {
    font-size: 0.9rem;
  }
}

@media (min-width: 721px) {
  .filters-summary::after {
    display: none;
  }
}

@media (max-width: 420px) {
  .site-logo {
    width: min(380px, 96vw);
    max-height: 168px;
  }

  .thumb-row {
    grid-template-columns: repeat(3, 1fr);
  }
}
