/* Rock and Roll Buddha — Antiques Inventory Lookbook */

:root {
  --bg: #f3efe7;
  --text: #171717;
  --muted: #68645e;
  --line: rgba(23, 23, 23, 0.14);
  --card-bg: rgba(255, 255, 255, 0.32);
  --header-height: 128px;
  --page-pad: clamp(20px, 3vw, 48px);
  --gap: clamp(16px, 2vw, 30px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, rgba(255,255,255,.9), transparent 42%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px var(--page-pad) 18px;
  background: linear-gradient(to bottom, rgba(243,239,231,.98) 72%, rgba(243,239,231,.88) 88%, rgba(243,239,231,0));
  backdrop-filter: blur(9px);
}

.brand {
  appearance: none;
  border: 0;
  background: none;
  color: var(--text);
  padding: 0;
  cursor: pointer;
  text-align: center;
  font-family: "Bodoni 72", "Didot", "Baskerville", "Times New Roman", serif;
  font-size: clamp(38px, 5vw, 72px);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.95;
}

.app {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 4px var(--page-pad) 64px;
}

/* INDEX */

.index-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(28px, 3.5vw, 58px) var(--gap);
  align-items: start;
}

.category-card {
  min-width: 0;
}

.category-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.category-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #ddd8cf;
}

.category-thumb {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 260ms ease, opacity 180ms ease;
}

.category-link:hover .category-thumb,
.category-link:focus-visible .category-thumb {
  transform: scale(1.018);
}

.category-name {
  margin: 12px 0 0;
  font-family: "Bodoni 72", "Didot", "Baskerville", "Times New Roman", serif;
  font-size: clamp(19px, 1.7vw, 28px);
  font-weight: 400;
  line-height: 1.1;
  text-align: center;
}

.category-empty-thumb {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.contact-footer {
    margin: 70px auto 40px;
    text-align: center;
}

.contact-card {
    display: inline-block;
    padding: 20px 34px;
    border: 1px solid rgba(0,0,0,.12);
    background: rgba(255,255,255,.35);
    backdrop-filter: blur(6px);
}

.contact-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .22em;
    color: #777;
    margin-bottom: 6px;
}

.contact-name {
    font-family: "Bodoni 72", "Didot", serif;
    font-size: 30px;
    font-style: italic;
    margin-bottom: 10px;
}

.contact-phone {
    color: inherit;
    text-decoration: none;
    font-size: 28px;
    font-weight: 300;
    letter-spacing: .05em;
    transition: opacity .2s ease;
}

.contact-phone:hover {
    opacity: .65;
}

/* GALLERY */

.gallery-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 0 0 30px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.back-button {
  justify-self: start;
  appearance: none;
  border: 0;
  background: none;
  color: var(--text);
  padding: 10px 0;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  letter-spacing: .02em;
}

.gallery-title {
  margin: 0;
  font-family: "Bodoni 72", "Didot", "Baskerville", "Times New Roman", serif;
  font-size: clamp(26px, 3vw, 44px);
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

.gallery-count {
  justify-self: end;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.masonry {
  column-count: 4;
  column-gap: var(--gap);
}

.gallery-item {
  break-inside: avoid;
  margin: 0 0 var(--gap);
  display: inline-block;
  width: 100%;
}

.gallery-image-button {
  appearance: none;
  border: 0;
  background: none;
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
}

.gallery-image {
  width: 100%;
  height: auto;
  display: block;
  background: #ddd8cf;
}

.inventory-number {
  margin-top: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .14em;
  line-height: 1.2;
  text-transform: uppercase;
}

/* LIGHTBOX */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(22px, 4vw, 56px);
  background: rgba(12,12,12,.96);
  color: white;
  touch-action: pan-y;
}

.lightbox.is-open {
  display: flex;
}

.lightbox-figure {
  margin: 0;
  width: min(86vw, 1500px);
  height: min(88vh, 1200px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(100% - 42px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-caption {
  margin-top: 14px;
  min-height: 22px;
  font-size: 14px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  appearance: none;
  border: 0;
  background: transparent;
  color: white;
  cursor: pointer;
  font-family: Arial, sans-serif;
}

.lightbox-close {
  top: 15px;
  right: 20px;
  z-index: 102;
  padding: 12px;
  font-size: 44px;
  line-height: 1;
  font-weight: 200;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  z-index: 101;
  width: 64px;
  height: 96px;
  font-size: 72px;
  line-height: 1;
  font-weight: 200;
}

.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

.empty-state {
  max-width: 680px;
  margin: 80px auto;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}

/* RESPONSIVE */

@media (max-width: 1100px) {
  .index-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .masonry { column-count: 3; }
}

@media (max-width: 760px) {
  :root {
    --header-height: 94px;
    --page-pad: 16px;
    --gap: 14px;
  }

  .site-header {
    min-height: var(--header-height);
    padding-top: 18px;
  }

  .index-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .masonry { column-count: 2; }

  .gallery-topbar {
    grid-template-columns: auto 1fr;
  }

  .gallery-title {
    text-align: right;
  }

  .gallery-count {
    display: none;
  }

  .lightbox-nav {
    width: 48px;
    font-size: 56px;
  }
}

@media (max-width: 430px) {
  .index-grid { grid-template-columns: 1fr 1fr; }
  .category-name { font-size: 17px; }
}

/* Kiosk / motion safety */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
