/* ============================================================
   LUSTHAUS — per-item SEO pages (/m/<id>) and 404
   Self-contained: dark + red, self-hosted Sora. No inline styles
   (the page CSP is style-src 'self').
   ============================================================ */
:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #08080a;
  color: #f4f4f6;
  font-family: "Sora", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.item__head,
.item__foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.item__foot {
  border-bottom: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: #77777f;
  letter-spacing: 0.04em;
}

.item__foot a {
  color: #9a9aa3;
}

.item__foot a:hover {
  color: #f4f4f6;
}

.item__brand img {
  display: block;
}

.item__back {
  font-size: 14px;
  color: #ff3049;
  white-space: nowrap;
}

.item__back:hover {
  color: #ff5d73;
}

.item__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 16px 40px;
  text-align: center;
}

.item__figure {
  margin: 0;
  max-width: min(92vw, 540px);
  width: 100%;
}

.item__media {
  display: block;
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: 14px;
  background: #000;
}

.item__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.item__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: min(92vw, 540px);
}

.item__tags span,
.item__tags a {
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #d9d9de;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 12px;
}

.item__tags a {
  color: #ff8a99;
  border-color: rgba(255, 93, 115, 0.45);
}

.item__tags a:hover {
  color: #fff;
  background: rgba(255, 93, 115, 0.24);
}

.item__meta {
  margin: 0;
  font-size: 13px;
  color: #9a9aa3;
}

.item__actions {
  display: flex;
  gap: 10px;
}

.item__like {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease,
    transform 0.18s ease;
}

.item__like:hover { background: rgba(255, 255, 255, 0.08); }
.item__like:active { transform: scale(0.96); }
.item__like-heart { font-size: 16px; line-height: 1; }
.item__like-word { color: #9a9aa3; font-weight: 500; }

.item__like.is-liked {
  color: #ff5d73;
  border-color: rgba(255, 93, 115, 0.6);
  background: rgba(255, 93, 115, 0.14);
}

/* ============================================================
   Collection pages (/browse, /tag/<slug>)
   ============================================================ */

.coll {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.coll__crumbs {
  font-size: 12px;
  color: #77777f;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}

.coll__crumbs a { color: #9a9aa3; }
.coll__crumbs a:hover { color: #f4f4f6; }

.coll__title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.coll__intro {
  margin: 0 0 22px;
  max-width: 70ch;
  font-size: 14px;
  line-height: 1.6;
  color: #b4b4bc;
}

.coll__h2 {
  margin: 34px 0 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a9aa3;
}

.coll__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.card:hover {
  border-color: rgba(255, 93, 115, 0.5);
  transform: translateY(-2px);
}

.card__img {
  display: block;
  width: 100%;
  /* The <img> carries width/height attributes (layout stability); without this the height
     attribute (2048) beats aspect-ratio and every card became a 2000 px tall sliver. */
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: #000;
}

.card__title {
  padding: 0 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  color: #d9d9de;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.coll__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.coll__tags a {
  font-size: 12px;
  letter-spacing: 0.05em;
  color: #d9d9de;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 13px;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.coll__tags a:hover {
  color: #fff;
  background: rgba(255, 93, 115, 0.22);
  border-color: rgba(255, 93, 115, 0.55);
}

.coll__tags a .n {
  color: #77777f;
  margin-left: 6px;
}

@media (max-width: 480px) {
  /* A phone shows exactly two cards across, each half the column. */
  .coll__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* ---------- catalog maintenance: descriptions, feed link, paging ---------- */
.item__desc {
  margin: 0;
  max-width: 62ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2, #c7c7cc);
  text-align: center;
}
.coll__feed {
  display: inline-block;
  margin: 0 0 18px;
  padding: 9px 16px;
  border-radius: 999px;
  background: linear-gradient(120deg, #ff3049, #b00d20);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.coll__pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 22px 0;
  font-size: 14px;
}
.coll__pager a { color: #fff; }
.coll__pager span { color: var(--text-3, #8a8a92); }

/* ---------- age gate (crawler-safe: the content stays in the DOM) ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(700px 460px at 50% 12%, rgba(255, 48, 73, 0.16), transparent 60%),
    #08080a;
}
html:not(.gated) .gate { display: none; }
.gate__box {
  width: 100%;
  max-width: 380px;
  text-align: center;
  padding: 30px 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: 0 40px 90px -50px #000;
}
.gate__logo { width: 220px; max-width: 70%; height: auto; margin: 0 auto 18px; }
.gate__age {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3, #8a8a92);
  margin-bottom: 18px;
}
.gate__lead { color: var(--text-2, #c7c7cc); font-size: 13.5px; margin: 0 0 22px; line-height: 1.65; }
.gate__actions { display: grid; gap: 10px; }
.gate__tiny { margin-top: 18px; color: var(--text-3, #8a8a92); font-size: 11px; line-height: 1.6; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: #ff3049; color: #fff; box-shadow: 0 14px 34px -16px #ff3049; border: 0; }
.btn--ghost { border: 1px solid rgba(255, 255, 255, 0.14); color: var(--text-2, #c7c7cc); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.05); color: #f4f4f6; }
/* The gate wins until consent, but the content stays in the DOM for crawlers. */
html.gated .item__head,
html.gated .item__main,
html.gated .coll,
html.gated .item__foot { visibility: hidden; }
