/* Dark "leather" theme for the catalog витрина (/catalog/), category pages
   (/catalog/c/<slug>/), and product pages (/catalog/p/<slug>/). Everything
   here is scoped under body.theme-dark, the marker class set by those
   templates' {% block body_class %}, so this file has zero effect on any
   other page (home, lookbook, content) even if it were ever linked there by
   mistake. Palette + component shapes ported from
   docs/superpowers/design/2026-07-23-catalog-dark-mockup.html, originally
   built as the /catalog/preview/ mockup and since promoted; the product-page
   (PDP) section further down was added when the product detail page was
   restyled dark to match.

   Reuses already-compiled Tailwind utilities where possible (.wrap, .eyebrow,
   .scroll-mt-20, .sr-only, focus/skip-link helpers) instead of re-declaring
   them — see apps/core/static/css/site.css. Everything bespoke below uses a
   dark- prefix so it can never collide with catalog.css (the light theme's
   bespoke sheet) or with Tailwind's own generic names (.grid, .card, ...). */

body.theme-dark {
  --bg: #17100a;
  --card: #241a11;
  --line: #3a2a1c;
  --cream: #f1e5d0;
  --muted: #b39c80;
  --cognac: #c86a2c;
  --brass: #d8b073;
  --serif: "Prata", ui-serif, Georgia, serif;
  --sans: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;

  background-color: var(--bg);
  background-image: radial-gradient(120% 90% at 50% -10%, #241606 0%, #17100a 60%);
  color: var(--cream);
}

/* Subtle fixed grain overlay, matching the mockup's ".grain" — pure CSS dot
   field, no image request. */
body.theme-dark .dark-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .05;
  z-index: 1;
  background-image: radial-gradient(var(--brass) .5px, transparent .5px);
  background-size: 4px 4px;
}

body.theme-dark ::selection {
  background: var(--cognac);
  color: #1a0f06;
}

/* A brighter focus ring than the site-wide cognac one — needed for contrast
   against the very dark background (a11y). */
body.theme-dark :focus-visible {
  outline-color: var(--brass);
}

/* ---------- shared header/footer, restyled dark only on this page ---------- */

body.theme-dark header {
  background-color: rgba(23, 16, 10, .85);
  border-color: var(--line);
}
body.theme-dark header .text-espresso {
  color: var(--cream);
}
body.theme-dark header .text-ink {
  color: #d8c8ad;
}
body.theme-dark header a:hover {
  color: var(--brass);
}
body.theme-dark header a.text-cognac,
body.theme-dark header a.font-medium.text-cognac {
  color: var(--cognac);
}
body.theme-dark header img {
  /* the mark is solid black — invert it to read on the dark bar, same trick
     footer.html already uses for its own dark background. */
  filter: brightness(0) invert(1);
}
body.theme-dark .nav-dd-menu {
  background: var(--card);
  border-color: var(--line);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .55);
}
body.theme-dark .nav-dd-menu a {
  color: #e7d8bd;
}
body.theme-dark .nav-dd-menu a:hover,
body.theme-dark .nav-dd-menu a:focus {
  background: #2c2013;
  color: var(--brass);
}
body.theme-dark .nav-dd-menu .dd-eyebrow {
  color: var(--muted);
}
body.theme-dark .nav-dd:hover .nav-dd-toggle,
body.theme-dark .nav-dd:focus-within .nav-dd-toggle,
body.theme-dark .nav-dd.open .nav-dd-toggle {
  color: var(--brass);
}

/* Footer (partials/footer.html) is already bg-espresso/text-canvas — a near
   -black brown with cream text — so it already reads as part of this dark
   page and needs no override. */

/* ---------- intro ---------- */

body.theme-dark .dark-intro {
  padding: 3.2rem 0 1rem;
}
body.theme-dark .dark-intro h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1.02;
  margin: .6rem 0 .5rem;
  color: #f6ecd8;
}
body.theme-dark .dark-manifesto {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 34rem;
  font-style: italic;
}

body.theme-dark .dark-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.6rem;
}
body.theme-dark .dark-chip {
  font-size: .82rem;
  color: #e7d8bd;
  text-decoration: none;
  padding: .4rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #20160d;
  display: inline-block;
}
body.theme-dark .dark-chip.is-on,
body.theme-dark .dark-chip:hover {
  border-color: var(--cognac);
  color: var(--brass);
}

/* ---------- breadcrumb (category pages) ---------- */

body.theme-dark .dark-breadcrumb {
  padding: 1.8rem 0 0;
  font-size: .82rem;
  color: var(--muted);
}
body.theme-dark .dark-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
body.theme-dark .dark-breadcrumb a:hover {
  color: var(--brass);
}
body.theme-dark .dark-breadcrumb span[aria-hidden] {
  padding: 0 .4rem;
  color: var(--line);
}
body.theme-dark .dark-breadcrumb .is-current {
  color: var(--cream);
}

/* ---------- hero — photo bled into the dark ground on every edge ---------- */

body.theme-dark .dark-hero {
  position: relative;
  margin: 2.4rem 0 1rem;
  overflow: hidden;
  min-height: 60vh;
  display: flex;
  align-items: flex-end;
}
body.theme-dark .dark-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.theme-dark .dark-hero__fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 0%, transparent 22%, transparent 78%, var(--bg) 100%),
    linear-gradient(0deg, var(--bg) 2%, rgba(23, 16, 10, .15) 45%, transparent 70%),
    radial-gradient(120% 80% at 50% 40%, transparent 40%, rgba(23, 16, 10, .55) 100%);
}
body.theme-dark .dark-hero__copy {
  position: relative;
  padding: 2.4rem 0;
  max-width: 40rem;
}
body.theme-dark .dark-hero__copy h1,
body.theme-dark .dark-hero__copy h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 4vw, 3rem);
  margin: .3rem 0;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .6);
}
body.theme-dark .dark-hero__copy p {
  color: #e9d9bd;
  margin: .2rem 0 1rem;
  max-width: 26rem;
}
body.theme-dark .dark-hero__copy a {
  color: var(--brass);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--cognac);
  padding-bottom: 2px;
}

/* ---------- product section ---------- */

body.theme-dark .dark-sec__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.7rem;
  color: #f2e6d1;
  margin: 2.2rem 0 1.2rem;
  display: flex;
  align-items: baseline;
  gap: .9rem;
}
body.theme-dark .dark-sec__title span {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  font-family: var(--sans);
}

body.theme-dark .dark-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
  padding-bottom: 2.2rem;
}
@media (min-width: 760px) {
  body.theme-dark .dark-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

body.theme-dark .dark-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: .9rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
body.theme-dark .dark-card:hover,
body.theme-dark .dark-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--cognac);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .4);
}
body.theme-dark .dark-card__ph {
  aspect-ratio: 4 / 5;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}
body.theme-dark .dark-card__ph img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s;
}
body.theme-dark .dark-card:hover .dark-card__ph img,
body.theme-dark .dark-card:focus-within .dark-card__ph img {
  transform: scale(1.05);
}
body.theme-dark .dark-card__noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  color: var(--muted);
  font-size: .82rem;
}
body.theme-dark .dark-card__chip {
  position: absolute;
  top: .6rem;
  left: .6rem;
  font-size: .62rem;
  letter-spacing: .04em;
  background: rgba(23, 16, 10, .7);
  color: #e9d9bd;
  border: 1px solid rgba(216, 176, 115, .35);
  padding: .24rem .55rem;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
body.theme-dark .dark-card__body {
  padding: .8rem .9rem 1rem;
}
body.theme-dark .dark-card__nm {
  color: #f0e3cf;
  font-size: .98rem;
  font-weight: 400;
  margin: 0;
}
body.theme-dark .dark-card__pr {
  color: var(--brass);
  font-size: .85rem;
  margin-top: .2rem;
}
body.theme-dark .dark-card__dots {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-top: .55rem;
}
body.theme-dark .dark-card__dot {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  display: block;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .15);
}
body.theme-dark .dark-card__more {
  font-size: .68rem;
  color: var(--muted);
}

body.theme-dark .dark-empty {
  padding: 2.5rem 0;
  color: var(--muted);
}

/* ---------- lifestyle band — full-bleed, bled edges ---------- */

body.theme-dark .dark-band {
  position: relative;
  margin: 2rem 0;
  min-height: 52vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
body.theme-dark .dark-band img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
body.theme-dark .dark-band__fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(23, 16, 10, .92) 0%, rgba(23, 16, 10, .55) 45%, transparent 80%),
    linear-gradient(0deg, var(--bg), transparent 30%),
    linear-gradient(180deg, var(--bg), transparent 30%);
}
body.theme-dark .dark-band__copy {
  position: relative;
  padding: 2.5rem 0;
  max-width: 34rem;
}
body.theme-dark .dark-band__copy-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.9rem;
  color: #fff;
  margin: .2rem 0 .6rem;
  line-height: 1.1;
}
body.theme-dark .dark-band__copy p {
  color: #e9d9bd;
  margin: 0 0 1.1rem;
}
body.theme-dark .dark-band__copy a {
  display: inline-block;
  background: var(--cognac);
  color: #1a0f06;
  font-weight: 600;
  padding: .7rem 1.3rem;
  border-radius: .5rem;
  text-decoration: none;
}
body.theme-dark .dark-band__copy a:hover {
  background: var(--brass);
}

/* ---------- product page (PDP) ---------- */

/* Gallery frame + variant list share this "dark card" surface: the card
   background with a thin warm line for a border, replacing the light
   theme's bg-white ring-1 ring-line/60. */
body.theme-dark .dark-pdp-frame {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(216, 176, 115, .05);
}
body.theme-dark .dark-pdp-empty {
  color: var(--muted);
  font-size: .85rem;
}

body.theme-dark .dark-pdp-title {
  font-family: var(--serif);
  font-weight: 400;
  color: #f6ecd8;
}

body.theme-dark .dark-pdp-price {
  margin-top: .75rem;
  font-size: 1.5rem;
  color: var(--brass);
}
body.theme-dark .dark-pdp-price__label {
  font-size: 1rem;
  color: var(--muted);
}

/* Product description (rendered via {{ product.description|linebreaks }})
   reuses the site-wide .rich class — override its light colours here,
   scoped to this theme only. */
body.theme-dark .rich {
  color: rgba(241, 229, 208, .88);
}
body.theme-dark .rich h2,
body.theme-dark .rich h3 {
  color: #f2e6d1;
}
body.theme-dark .rich a {
  color: var(--brass);
  text-decoration-color: rgba(216, 176, 115, .4);
}
body.theme-dark .rich a:hover {
  text-decoration-color: var(--brass);
}
body.theme-dark .rich blockquote {
  border-color: var(--brass);
  color: #f2e6d1;
}
body.theme-dark .rich code {
  background: #2c2013;
  color: #e7d8bd;
}
body.theme-dark .rich ul::marker,
body.theme-dark .rich ol::marker,
body.theme-dark .rich ul ::marker,
body.theme-dark .rich ol ::marker {
  color: var(--brass);
}

body.theme-dark .dark-pdp-variants {
  overflow: hidden;
  border-radius: .75rem;
  background: var(--card);
  border: 1px solid var(--line);
}
body.theme-dark .dark-pdp-variants__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1rem;
  font-size: .875rem;
  border-top: 1px solid var(--line);
}
body.theme-dark .dark-pdp-variants__row:first-child {
  border-top: 0;
}
body.theme-dark .dark-pdp-variants__name {
  color: #e7d8bd;
}
body.theme-dark .dark-pdp-variants__price {
  color: var(--muted);
}

/* Order CTA — same cognac-button treatment as .dark-band__copy a, so the
   "Обсудить заказ" button reads consistently with the rest of the dark
   site's calls to action. */
body.theme-dark .dark-pdp-cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border-radius: .5rem;
  background: var(--cognac);
  color: #1a0f06;
  font-weight: 600;
  font-size: .9rem;
  padding: .75rem 1.75rem;
  text-decoration: none;
  transition: background-color .2s;
}
body.theme-dark .dark-pdp-cta:hover,
body.theme-dark .dark-pdp-cta:focus-visible {
  background: var(--brass);
}
body.theme-dark .dark-pdp-meta,
body.theme-dark .dark-pdp-note {
  color: var(--muted);
}

body.theme-dark .dark-pdp-journal {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}
body.theme-dark .dark-pdp-journal__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.7rem;
  color: #f2e6d1;
  margin: 0;
}
body.theme-dark .dark-pdp-journal__grid {
  display: grid;
  gap: 2rem;
  margin-top: 1.5rem;
}
@media (min-width: 640px) {
  body.theme-dark .dark-pdp-journal__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
body.theme-dark .dark-pdp-article__title {
  color: #f0e3cf;
  transition: color .2s;
}
body.theme-dark .dark-pdp-article:hover .dark-pdp-article__title,
body.theme-dark .dark-pdp-article:focus-within .dark-pdp-article__title {
  color: var(--brass);
}
body.theme-dark .dark-pdp-article__excerpt {
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  body.theme-dark .dark-card,
  body.theme-dark .dark-card__ph img,
  body.theme-dark .dark-band__copy a,
  body.theme-dark .dark-chip,
  body.theme-dark .dark-pdp-cta,
  body.theme-dark .dark-pdp-article__title {
    transition: none !important;
  }
}

/* ── Lightbox (product gallery) ── */
.js-lb{ -webkit-appearance:none; appearance:none; padding:0; border:0; margin:0; font:inherit; color:inherit; cursor:zoom-in; display:block; width:100%; }
.lb{ position:fixed; inset:0; z-index:9999; display:none; flex-direction:column;
     background:rgba(18,10,5,.90); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); }
.lb.is-open{ display:flex; }
.lb__stage{ position:relative; flex:1 1 auto; min-height:0; display:flex; align-items:center; justify-content:center; padding:3.5rem 1rem .5rem; }
.lb__img{ max-width:92vw; max-height:100%; object-fit:contain; border-radius:.4rem; box-shadow:0 24px 70px rgba(0,0,0,.55); }
.lb__close, .lb__nav{ width:2.9rem; height:2.9rem; border:0; border-radius:9999px; background:rgba(246,230,204,.14); color:#f6e6cc; cursor:pointer; display:flex; align-items:center; justify-content:center; line-height:1; transition:background .16s ease; }
.lb__close:hover, .lb__nav:hover{ background:rgba(246,230,204,.28); }
.lb__close:focus-visible, .lb__nav:focus-visible, .lb__thumb:focus-visible{ outline:2px solid #c99f5e; outline-offset:2px; }
.lb__close{ position:absolute; top:1rem; right:1.1rem; z-index:2; font-size:1.7rem; }
.lb__nav{ position:absolute; top:50%; transform:translateY(-50%); z-index:2; font-size:2rem; }
.lb__prev{ left:1rem; }
.lb__next{ right:1rem; }
.lb__count{ flex:0 0 auto; text-align:center; color:#c9b79a; font-size:.85rem; letter-spacing:.04em; padding:.3rem 0; }
.lb__strip{ flex:0 0 auto; display:flex; gap:.5rem; overflow-x:auto; padding:.55rem 1rem 1rem; justify-content:center; }
.lb__thumb{ flex:0 0 auto; width:60px; height:60px; padding:0; border:2px solid transparent; border-radius:.4rem; overflow:hidden; background:none; cursor:pointer; opacity:.5; transition:opacity .15s ease, border-color .15s ease; }
.lb__thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.lb__thumb:hover{ opacity:.85; }
.lb__thumb.is-active{ opacity:1; border-color:#c99f5e; }
@media (max-width:640px){ .lb__nav{ width:2.5rem; height:2.5rem; font-size:1.6rem; } .lb__prev{ left:.4rem; } .lb__next{ right:.4rem; } .lb__thumb{ width:48px; height:48px; } .lb__stage{ padding-top:3rem; } }
@media (prefers-reduced-motion:reduce){ .lb__thumb, .lb__close, .lb__nav{ transition:none; } }
