/* maxrocks — mobile-first, no framework.
   Covers: base, layout chrome, card grid + badges, rock page (gallery,
   stats, description, purchase note), responsive + a11y polish. */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #f7f6f4;
  --surface: #ffffff;
  --text: #21252b;
  --muted: #6b7280;
  --border: #e4e2df;
  --accent: #2f6f4e;
  --accent-soft: #e8f2ec;

  --for-sale-bg: #dcfce7;
  --for-sale-fg: #166534;
  --reserved-bg: #fef3c7;
  --reserved-fg: #92400e;
  --sold-bg: #fee2e2;
  --sold-fg: #991b1b;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-lift: 0 6px 16px rgba(15, 23, 42, 0.10);
  --content: 1080px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
}

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

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

/* ------------------------------------------------------------------ layout chrome */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(247, 246, 244, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand:hover {
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: underline;
}

.site-main {
  max-width: var(--content);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.25rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  max-width: var(--content);
  margin: 0.3rem auto;
}

/* ------------------------------------------------------------------ page header */
.page-header {
  margin-bottom: 1.75rem;
}

.page-header h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.2em;
}

.tagline {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.breadcrumb {
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--text);
  text-decoration: underline;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
  padding: 2.5rem 0;
}

.see-archive {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.card__image {
  aspect-ratio: 4 / 3;
  background: #eceae7;
  overflow: hidden;
}

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

.card__body {
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.card__title {
  font-size: 1.05rem;
  margin: 0;
}

.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: auto 0 0;
}

/* Reserved: badge + a subtle amber edge. Want badge-only? Delete this rule. */
.card--reserved {
  box-shadow: inset 0 0 0 2px var(--reserved-bg), var(--shadow);
}

.card--reserved:hover {
  box-shadow: inset 0 0 0 2px var(--reserved-bg), var(--shadow-lift);
}

/* Sold (archive): greyscale photos that colour on hover. */
.card--sold .card__image img {
  filter: grayscale(1);
  transition: filter 0.3s ease;
}

.card--sold:hover .card__image img {
  filter: grayscale(0);
}

/* ------------------------------------------------------------------ price + badges */
.price {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price--lead {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.badge {
  display: inline-block;
  padding: 0.18em 0.6em;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--for-sale {
  background: var(--for-sale-bg);
  color: var(--for-sale-fg);
}

.badge--reserved {
  background: var(--reserved-bg);
  color: var(--reserved-fg);
}

.badge--sold {
  background: var(--sold-bg);
  color: var(--sold-fg);
}

/* ------------------------------------------------------------------ rock page */
.rock-header {
  margin-bottom: 1rem;
}

.rock-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  letter-spacing: -0.02em;
}

.rock-header__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.banner {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  border-left: 4px solid;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.banner--sold {
  background: var(--sold-bg);
  border-left-color: var(--sold-fg);
  color: var(--sold-fg);
}

.banner--reserved {
  background: var(--reserved-bg);
  border-left-color: var(--reserved-fg);
  color: var(--reserved-fg);
}

/* Gallery: stacked — main photo, then a wrapping thumb strip (swap in Phase 3). */
.gallery {
  margin-bottom: 2rem;
}

.gallery__main {
  margin: 0;
}

.gallery__main img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.gallery__thumbs a {
  display: block;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
  transition: border-color 0.15s ease;
}

.gallery__thumbs a:hover,
.gallery__thumbs a:focus-visible {
  border-color: var(--accent);
}

.gallery__thumbs img {
  width: 84px;
  height: 84px;
  object-fit: cover;
}

.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
  font-size: 0.9rem;
  font-style: italic;
}

.photo-placeholder--large {
  min-height: 260px;
}

/* Stats table (dl) */
.stats-section {
  margin-bottom: 2rem;
}

.stats-section h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.stats {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stats__row {
  display: grid;
  grid-template-columns: minmax(8.5rem, 11rem) 1fr;
  gap: 1rem;
  padding: 0.6rem 1rem;
}

.stats__row + .stats__row {
  border-top: 1px solid var(--border);
}

.stats dt {
  color: var(--muted);
  font-size: 0.9rem;
}

.stats dd {
  margin: 0;
}

/* Description */
.description {
  max-width: 68ch;
  margin-bottom: 2rem;
}

.description h2,
.description h3 {
  margin-top: 1.5em;
}

.description ul,
.description ol {
  padding-left: 1.3em;
}

.description blockquote {
  margin: 1em 0;
  padding: 0.2em 1em;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

.description code {
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.92em;
}

.description pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
}

.description pre code {
  background: none;
  padding: 0;
}

/* Purchase note */
.purchase-note {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  font-size: 0.98rem;
}

.purchase-note--sold {
  background: var(--surface);
  color: var(--muted);
}

.purchase-note p:last-child,
.purchase-note--sold p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ responsive */
@media (min-width: 720px) {
  .site-main {
    padding-top: 2.5rem;
  }

  .gallery__thumbs img {
    width: 100px;
    height: 100px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .card:hover {
    transform: none;
  }
}

@media print {
  .site-header,
  .site-footer,
  .gallery__thumbs,
  .breadcrumb {
    display: none;
  }

  body {
    background: #fff;
  }
}

/* ------------------------------------------------------------------ gallery swap */
/* main.js marks the thumbnail currently shown in the big panel. */
.gallery__thumbs a[aria-current="true"] {
  border-color: var(--accent);
}

.gallery__thumbs a[aria-current="true"] img {
  opacity: 0.85;
}
