/* ==========================================================================
   Rich Tramp — edit.css
   Layout for the individual Edit pages: hero, world intro, product grid,
   product detail dialog, next-edit teaser. Colours come from the theme
   variables set in themes/*.css.
   ========================================================================== */

.page-edit { background: var(--bg); color: var(--fg); }
.page-edit .site-header.is-scrolled { background: var(--header-bg); }
.page-edit .lockup .slab { color: var(--fg); }

/* ---------- Hero ----------------------------------------------------------- */
.edit-hero {
  position: relative; min-height: min(92svh, 900px); display: grid; align-items: end; color: #fff; isolation: isolate;
}
.edit-hero .media { position: absolute; inset: 0; z-index: -2; }
.edit-hero .media img { object-position: var(--hero-focus, 50% 50%); animation: hero-zoom 14s var(--ease) forwards; }
@keyframes hero-zoom { from { transform: scale(1.08); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .edit-hero .media img { animation: none; } }
.edit-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 28%, rgba(0, 0, 0, .05) 62%, rgba(0, 0, 0, .25) 100%),
    linear-gradient(to right, rgba(0, 0, 0, .4), rgba(0, 0, 0, 0) 60%);
}
.edit-hero__content { padding-block: clamp(140px, 18vw, 200px) clamp(56px, 7vw, 96px); max-width: 820px; }
.edit-hero .eyebrow { color: var(--accent-2); }
.edit-hero .lockup { margin-top: 20px; }
.edit-hero .lockup .slab { color: #fff; }
.edit-hero__tag { margin-top: 22px; font-size: clamp(17px, 1.6vw, 22px); line-height: 1.5; color: rgba(255, 255, 255, .88); max-width: 52ch; }
.edit-hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.edit-hero__count {
  position: absolute; right: var(--gutter); bottom: clamp(56px, 7vw, 96px);
  text-align: right; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: rgba(255, 255, 255, .6);
}
.edit-hero__count b { display: block; font-family: var(--font-slab); font-size: 56px; line-height: 1; color: #fff; letter-spacing: .04em; margin-bottom: 4px; }
@media (max-width: 760px) { .edit-hero__count { display: none; } }

/* ---------- World / intro ---------------------------------------------------- */
.world { padding-block: clamp(40px, 6vw, 88px) clamp(24px, 4vw, 48px); }
.world__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.world__quote { font-family: var(--font-script); color: var(--gold); font-size: clamp(34px, 4vw, 54px); line-height: 1.12; }
.world__copy { margin-top: 22px; color: var(--fg-muted); font-size: 16.5px; max-width: 58ch; }
.world__copy p + p { margin-top: 1em; }
.world__facts { border-top: 1px solid var(--line); }
.world__facts > div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.world__facts dt { font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); font-weight: 700; padding-top: 4px; }
.world__facts dd { margin: 0; color: var(--fg); font-size: 15px; line-height: 1.5; }
.palette { display: flex; gap: 8px; margin-top: 6px; }
.palette i { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); display: block; }
@media (max-width: 860px) { .world__grid { grid-template-columns: 1fr; } }

/* ---------- Product grid ------------------------------------------------------ */
.products { padding-block: clamp(24px, 4vw, 48px) clamp(72px, 10vw, 128px); }
.products__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: clamp(28px, 4vw, 44px); }
.products__head .lockup { margin-top: 14px; }
.products__head p { margin-top: 10px; color: var(--fg-muted); max-width: 48ch; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 9px 16px; border-radius: var(--radius-btn); border: 1px solid var(--line); color: var(--fg-muted);
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.chip:hover { color: var(--fg); border-color: var(--fg-muted); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); }
@media (max-width: 1100px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

.product-card {
  position: relative; text-align: left; display: block; width: 100%; padding: 0; border: 0; font: inherit; cursor: pointer;
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface); color: var(--fg); transition: transform .5s var(--ease), box-shadow .5s var(--ease), opacity .35s var(--ease);
  box-shadow: 0 1px 0 var(--line);
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.product-card.is-hidden { display: none; }
/* The card's inner parts are <span>s (they sit inside a <button>), so they must be told to be blocks.
   Otherwise the image box is inline: it shrinks, drifts off-centre and its zoom isn't clipped. */
.product-card__media { display: block; aspect-ratio: 3 / 4; position: relative; overflow: hidden; background: var(--surface-2); isolation: isolate; }
.product-card__media picture { display: contents; }
.product-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; transition: transform 1s var(--ease); }
.product-card:hover .product-card__media img { transform: scale(1.05); }
.product-card__fit {
  position: absolute; left: 12px; top: 12px; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; font-weight: 700;
  background: rgba(14, 17, 17, .6); color: #fff; backdrop-filter: blur(6px); padding: 6px 10px; border-radius: var(--radius-btn);
}
.product-card__view {
  position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); color: var(--accent-contrast); display: grid; place-items: center;
  opacity: 0; transform: translateY(8px); transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.product-card__view svg { width: 18px; height: 18px; }
.product-card:hover .product-card__view, .product-card:focus-visible .product-card__view { opacity: 1; transform: none; }
.product-card__body { display: block; position: relative; z-index: 1; background: var(--surface); padding: 16px 16px 18px; }
.product-card__name { display: block; font-family: var(--font-slab); font-weight: 400; font-size: 17px; letter-spacing: .03em; text-transform: uppercase; line-height: 1.15; }
.product-card__style { margin-top: 6px; font-size: 13px; color: var(--fg-muted); display: flex; align-items: center; gap: 8px; }
.product-card__style i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line); background: var(--swatch, #fff); display: inline-block; flex: none; }
@media (max-width: 720px) {
  .product-card__body { padding: 12px 12px 14px; }
  .product-card__name { font-size: 14.5px; }
  .product-card__style { font-size: 12px; }
}
@media (max-width: 460px) {
  .product-card__body { padding: 11px 10px 13px; }
  .product-card__name { font-size: 12.5px; letter-spacing: .01em; }
}

.products__empty { text-align: center; color: var(--fg-muted); padding: 60px 0; display: none; }
.products__empty.is-visible { display: block; }

.products__shop { margin-top: clamp(40px, 5vw, 64px); text-align: center; }
.products__shop p { color: var(--fg-muted); margin-bottom: 18px; }

/* ---------- Product dialog ---------------------------------------------------- */
.product-modal {
  border: 0; padding: 0; background: transparent; color: var(--fg); max-width: none; max-height: none;
  width: 100vw; height: 100dvh; margin: 0; inset: 0; position: fixed;
}
.product-modal::backdrop { background: rgba(5, 6, 7, .72); backdrop-filter: blur(8px); }
.product-modal[open] { display: grid; place-items: center; animation: modal-in .35s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.product-modal__panel {
  position: relative; width: min(1120px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.product-modal__media { position: relative; background: var(--surface-2); min-height: 420px; }
.product-modal__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.product-modal__nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  background: rgba(14, 17, 17, .55); color: #fff; backdrop-filter: blur(6px); display: grid; place-items: center;
  transition: background .25s var(--ease);
}
.product-modal__nav:hover { background: var(--accent); color: var(--accent-contrast); }
.product-modal__nav svg { width: 18px; height: 18px; }
.product-modal__nav--prev { left: 14px; }
.product-modal__nav--next { right: 14px; }
.product-modal__close {
  position: absolute; right: 14px; top: 14px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(14, 17, 17, .55); color: #fff; backdrop-filter: blur(6px); display: grid; place-items: center;
  transition: background .25s var(--ease), transform .25s var(--ease);
}
.product-modal__close:hover { background: var(--accent); color: var(--accent-contrast); transform: rotate(90deg); }
.product-modal__close svg { width: 18px; height: 18px; }
.product-modal__body { padding: clamp(24px, 3.4vw, 44px); overflow-y: auto; display: flex; flex-direction: column; gap: 0; }
.product-modal__body .eyebrow { color: var(--accent); }
.product-modal__name { font-family: var(--font-slab); font-weight: 400; font-size: clamp(26px, 2.8vw, 38px); letter-spacing: .02em; text-transform: uppercase; line-height: 1.05; margin-top: 14px; }
.product-modal__sub { margin-top: 8px; color: var(--fg-muted); font-size: 15px; }
.product-modal__desc { margin-top: 20px; color: var(--fg-muted); font-size: 15.5px; line-height: 1.65; }
.product-modal__desc p + p { margin-top: .8em; }
.spec { margin-top: 22px; border-top: 1px solid var(--line); }
.spec > div { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec dt { font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); font-weight: 700; padding-top: 3px; }
.spec dd { margin: 0; color: var(--fg); }
.spec .colour { display: inline-flex; align-items: center; gap: 8px; }
.spec .colour i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); display: inline-block; }
.styles { display: flex; flex-wrap: wrap; gap: 6px; }
.styles span { font-size: 12px; padding: 4px 10px; border-radius: var(--radius-btn); border: 1px solid var(--line); color: var(--fg-muted); }
.styles span.is-main { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); font-weight: 700; }

.artwork { margin-top: 22px; }
.artwork__label { font-size: 10.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.artwork__frame {
  border-radius: var(--radius-sm); border: 1px solid var(--line); padding: 18px; display: grid; place-items: center;
  background: var(--artwork-bg, #fff); min-height: 96px;
}
.artwork__frame img { max-height: 180px; width: auto; max-width: 100%; object-fit: contain; }
.artwork__frame--dark { background: var(--black); }

.product-modal__actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }
.product-modal__note { margin-top: 14px; font-size: 12.5px; color: var(--fg-muted); }
.product-modal__note a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 860px) {
  .product-modal__panel { grid-template-columns: 1fr; overflow-y: auto; max-height: calc(100dvh - 24px); width: calc(100vw - 24px); }
  .product-modal__media { aspect-ratio: 4 / 4.2; min-height: 0; align-self: start; height: auto; }
  .product-modal__body { overflow: visible; }
  /* The panel scrolls on phones, so keep the close button floating on screen instead of scrolling away with the photo. */
  .product-modal__close {
    position: fixed; top: 22px; right: 22px; z-index: 5; width: 46px; height: 46px;
    background: rgba(14, 17, 17, .88); border: 1px solid rgba(255, 255, 255, .28);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  }
}

/* ---------- Next edit --------------------------------------------------------- */
.next-edit {
  position: relative; display: grid; align-items: center; min-height: 420px; color: #fff; isolation: isolate; overflow: hidden;
}
.next-edit .media { position: absolute; inset: 0; z-index: -2; }
.next-edit .media img { transition: transform 1.4s var(--ease); object-position: 50% 35%; }
.next-edit:hover .media img { transform: scale(1.05); }
.next-edit::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to right, rgba(14, 17, 17, .88), rgba(14, 17, 17, .45) 60%, rgba(14, 17, 17, .3)); }
.next-edit__inner { padding-block: clamp(56px, 8vw, 96px); }
.next-edit .eyebrow { color: var(--gold-light); }
.next-edit .lockup { margin-top: 14px; }
.next-edit .lockup .slab { color: #fff; }
.next-edit p { margin-top: 14px; color: rgba(255, 255, 255, .82); max-width: 46ch; }
.next-edit .btn { margin-top: 26px; }
