/* ============================================================
   Журнал — base reset & typographic foundation
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  overflow-x: clip;
  max-width: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--grotesk);
  font-size: var(--t-body);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

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

button { font: inherit; color: inherit; cursor: pointer; }

::selection { background: var(--accent-wash); color: var(--ink); }

/* — Headlines — */
.serif { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}

/* — Mono labels: kickers, metadata, prices (the Slanted-ish system layer) — */
.kicker {
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}
.kicker--accent { color: var(--accent); }

.meta {
  font-family: var(--mono);
  font-size: var(--t-small);
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

/* — Byline: shared across hero, author & venue pages — */
.byline {
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  font-family: var(--mono);
  font-size: var(--t-small);
  color: var(--ink-soft);
  max-width: 100%; min-width: 0;
}
.byline b {
  font-weight: 500; color: var(--ink); cursor: pointer;
  display: block; max-width: 100%; min-width: 0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.byline b:hover { color: var(--accent-deep); }
.byline__kind { color: var(--ink-faint); }
.byline--stack {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
}
.byline__tagline {
  display: block;
  width: 100%;
  min-width: 0;
  font-family: var(--grotesk);
  font-size: var(--t-small);
  line-height: 1.45;
  color: var(--ink-soft);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.byline--stack .byline__kind {
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

/* — Hairline helpers — */
.rule { height: var(--rule); background: var(--line); border: 0; margin: 0; }
.rule--strong { background: var(--line-strong); }

/* — A small terracotta dot used as an editorial marker — */
.dot {
  display: inline-block;
  width: 0.42em; height: 0.42em;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}

/* — Image placeholder: subtle warm diagonal stripes + mono explainer.
     Real photography drops in here. — */
.ph {
  position: relative;
  background-color: var(--paper-sink);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0, transparent 47px,
    oklch(0.90 0.010 78) 47px, oklch(0.90 0.010 78) 48px
  );
  overflow: hidden;
}
.ph::after {
  content: attr(data-label);
  position: absolute;
  left: 0.8rem; bottom: 0.7rem;
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: 0.06em;
  text-transform: capitalize;
  color: var(--ink-faint);
  background: var(--paper);
  padding: 0.2rem 0.45rem;
}

/* — Real-photo drop slot (KIT.photo): the wrapper IS a normal .ph
     (striped paper + label chip) and the <image-slot> sits transparently
     on top — so the original placeholder look is untouched until the user
     drops a real photo. Drag-drop + click-to-browse stay live. — */
.ph-wrap { min-width: 0; }
.ph-slot { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* Paint the striped placeholder on the slot's OWN frame (with !important)
   so it renders identically in every engine (Safari file:// included) —
   not merely "showing through" a transparent frame. The wrapper keeps the
   same stripes too, so html-to-image (which ignores shadow DOM) still shows
   them. When a real photo is dropped, the frame clears so the image shows. */
.ph-slot::part(frame) {
  background-color: var(--paper-sink) !important;
  background-image: repeating-linear-gradient(
    -45deg, transparent 0, transparent 47px,
    oklch(0.90 0.010 78) 47px, oklch(0.90 0.010 78) 48px) !important;
}
.ph-slot[data-filled]::part(frame) { background-image: none !important; background-color: transparent !important; }
.ph-slot::part(ring) { display: none !important; }
.ph-slot::part(empty) { color: transparent !important; }
.ph-wrap:has(image-slot[data-filled])::after { display: none; }
/* minimal slots (avatar, track cover): no label chip at all — just the centered + */
.ph--bare::after { display: none !important; }

/* — Focus — */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* — Page frame — */
.page { width: 100%; }
.bleed { padding-inline: var(--bleed); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Плейсхолдер резолва публичной ссылки на медиа (/m/<mid>) до редиректа. */
.media-resolving { display: grid; place-items: center; min-height: 60vh; padding: 2rem; }
.media-resolving__t { color: var(--ink-soft, #666); font: 500 var(--t-small, 0.9rem)/1.4 var(--grotesk, system-ui); letter-spacing: 0.02em; }
