/* Per-piece detail page (/piece/<slug>). Reuses the site's tokens and .btn
   styles from styles.css; this file only lays out the standalone page. The
   public homepage is a single scroll, so these pages carry their own top bar,
   background, and footer instead of the site chrome. */

body.piece-page {
  min-height: 100vh;
  margin: 0;
  color: var(--cream);
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
}

/* Warm, static backdrop in the site's palette (the homepage uses a JS-driven
   photo background; a detail page stays calm so the work leads). */
.pd-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(200, 168, 105, 0.10), transparent 60%),
    linear-gradient(180deg, #151312 0%, #0d0c0b 100%);
}

.pd-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1.1rem, 4vw, 2.5rem);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}
.pd-brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--cream);
  text-decoration: none;
}
.pd-back {
  font-size: 0.9rem;
  color: var(--cream-dim);
  text-decoration: none;
  padding: 0.4rem 0.2rem;
}
.pd-back:hover { color: var(--gold); }

.pd-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) clamp(1.1rem, 4vw, 2.5rem) 3rem;
}

.pd-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
@media (max-width: 760px) {
  .pd-card { grid-template-columns: 1fr; gap: 1.5rem; }
}

.pd-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-lg);
}
.pd-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  background: #0b0a09;
}
.pd-ribbon {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(13, 12, 11, 0.85);
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--card-border);
}

.pd-info { padding-top: 0.5rem; }
.pd-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}
.pd-meta {
  color: var(--cream-dim);
  font-size: 1rem;
  margin: 0 0 0.9rem;
}
.pd-price {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--gold);
  margin: 0 0 1.4rem;
}
.pd-flag {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream-dim);
  vertical-align: middle;
  margin-left: 0.4rem;
}

.pd-buy { margin: 0 0 1.8rem; }
.pd-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 11rem;
  text-decoration: none;
}
.pd-buy-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.pd-ship {
  color: var(--cream-dim);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: -0.8rem 0 1.8rem;
  max-width: 48ch;
}

.pd-story {
  border-top: 1px solid var(--card-border);
  padding-top: 1.4rem;
  color: var(--cream-dim);
  max-width: 56ch;
}
.pd-story p { margin: 0 0 0.9rem; line-height: 1.75; }
.pd-story p:last-child { margin-bottom: 0; }

.pd-return { margin: 1.8rem 0 0; }
.pd-return a { color: var(--cream-dim); text-decoration: none; font-size: 0.92rem; }
.pd-return a:hover { color: var(--gold); }

.pd-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem;
  color: var(--cream-dim);
  font-size: 0.9rem;
}
.pd-footer a { color: var(--cream-dim); text-decoration: none; }
.pd-footer a:hover { color: var(--gold); }

/* 404 */
.pd-404 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  min-height: 60vh;
}
.pd-404 h1 { font-family: var(--serif); font-weight: 600; font-size: 2rem; margin: 0; }
.pd-404 p { color: var(--cream-dim); margin: 0.2rem 0; }
.pd-404 .btn { margin-top: 1rem; text-decoration: none; }
