/* =========================================================
   ЖУРНАЛ (список + детальная) — дополняет styles.css
   Листы на светлом фоне, карточки как у «Проектов» на главной,
   типографские обложки для публикаций в СМИ.
   ========================================================= */
:root {
  --sky: #5aaef6;
  --lilac: #b7a6ff;
}

/* ---------- HERO СПИСКА ---------- */
.j-hero {
  container-type: inline-size;
  margin-top: 5px;
  display: flex; flex-direction: column; gap: 32px;
  padding: 32px 32px 36px; border-radius: var(--r-xl); background: var(--surface);
}
.j-hero__top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.j-hero__issue { font-family: var(--f-mono); font-size: 13px; text-transform: uppercase; letter-spacing: -.02em; color: var(--muted); }
.j-hero__title {
  font-family: var(--f-display); font-weight: 500;
  font-size: 22cqw; line-height: .8; letter-spacing: -.08em; margin-left: -.05em;
  padding-bottom: .16em;
  color: var(--black);
}
.j-hero__bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; }
.j-hero__lead { max-width: 560px; }
.j-hero__lead span { color: var(--ink-3); }

.filters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.filter {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 30px; background: var(--tile); color: var(--ink);
  font-weight: 600; font-size: 15px; letter-spacing: -.03em;
  transition: background-color .25s, color .25s;
}
.filter:hover { background: #e9e9e9; }
.filter__n { font-family: var(--f-mono); font-weight: 500; font-size: 12px; color: var(--muted); }
.filter.is-active { background: var(--black); color: #fff; }
.filter.is-active .filter__n { color: var(--lime); }

/* ---------- ГЛАВНЫЙ МАТЕРИАЛ ---------- */
.j-feat-wrap { margin-top: 4px; }
.feat {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 4px;
}
.feat__visual {
  position: relative; min-height: 440px; border-radius: var(--r-lg); background: var(--night); overflow: hidden;
  display: grid; place-items: center;
}
.feat__visual-cap {
  position: absolute; left: 24px; bottom: 20px;
  font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: -.02em; color: rgba(255, 255, 255, .7);
}
.mini-tower { display: flex; flex-direction: column; gap: 6px; width: min(60%, 340px); transition: transform .6s var(--ease); }
.mini-tower span {
  height: 44px; border-radius: 10px; background: var(--c);
  transform: skewX(-12deg); transition: transform .5s var(--ease);
}
.mini-tower span:nth-child(odd) { margin-left: 8%; }
.feat:hover .mini-tower span:nth-child(1) { transform: skewX(-12deg) translateX(-14px); }
.feat:hover .mini-tower span:nth-child(3) { transform: skewX(-12deg) translateX(12px); }
.feat:hover .mini-tower span:nth-child(5) { transform: skewX(-12deg) translateX(-8px); }
.feat__body {
  display: flex; flex-direction: column; gap: 20px; justify-content: flex-end;
  padding: 40px; border-radius: var(--r-lg); background: var(--surface);
}
.feat__title { font-family: var(--f-display); font-weight: 600; font-size: clamp(30px, 3.3vw, 48px); line-height: 1.05; letter-spacing: -.04em; text-wrap: balance; }
.feat__excerpt { font-size: 17px; line-height: 1.45; letter-spacing: -.03em; color: var(--ink-2); max-width: 520px; }
.feat__btn { align-self: flex-start; margin-top: 8px; }

/* ---------- КАРТОЧКИ ---------- */
.j-list { margin-top: 4px; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.post { display: flex; flex-direction: column; gap: 4px; }
.post[hidden] { display: none; }
.post__media {
  aspect-ratio: 4 / 3; padding: 4px; border-radius: var(--r-md); background: var(--surface); overflow: hidden;
}
.post__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; transition: transform .9s var(--ease); }
.post:hover .post__media img { transform: scale(1.04); }
.post__media--type { display: flex; align-items: flex-end; padding: 24px; }
.post__media--type span {
  font-family: var(--f-display); font-weight: 600; font-size: clamp(48px, 5.5vw, 80px); line-height: .9; letter-spacing: -.06em;
  transition: transform .6s var(--ease);
}
.post:hover .post__media--type span { transform: translateY(-6px); }
.post__media--lime { background: var(--lime); color: #000; }
.post__media--pink { background: var(--pink); color: #000; }
.post__media--night { background: var(--night); color: #fff; }

.post__body {
  flex: 1; display: flex; flex-direction: column; gap: 12px;
  padding: 22px 24px 20px; border-radius: var(--r-md); background: var(--surface);
}
.post__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.post__type {
  height: 26px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 20px;
  font-weight: 600; font-size: 12px; letter-spacing: -.03em;
}
.post__type--blog { background: var(--tile); color: var(--ink); }
.post__type--interview { background: var(--pink); color: #000; }
.post__type--case { background: var(--lime); color: #000; }
.post__date { font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: -.02em; color: var(--muted); }
.post__title { margin: 0; font-family: var(--f-ui); font-weight: 600; font-size: 21px; line-height: 1.15; letter-spacing: -.045em; text-wrap: balance; }
.post__excerpt { font-size: 14.5px; line-height: 1.45; letter-spacing: -.025em; color: var(--ink-2); }
.post__foot {
  margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; gap: 12px;
  border-top: 1px solid #efefef;
  font-weight: 600; font-size: 13px; letter-spacing: -.03em;
}
.post__read { font-family: var(--f-mono); font-weight: 500; font-size: 12px; color: var(--muted); }
.post:hover .post__foot span:first-child { color: #c2188a; }
.j-empty { padding: 48px; text-align: center; color: var(--muted); border-radius: var(--r-md); background: var(--surface); }

/* ---------- TELEGRAM ---------- */
.tg {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: end;
  padding: 50px 45px 45px; border-radius: var(--r-lg); background: #000; color: #fff;
}
.tg__title { margin-top: 24px; }
.tg__lead { margin-top: 24px; max-width: 560px; font-size: 18px; line-height: 1.4; letter-spacing: -.03em; color: rgba(255, 255, 255, .6); }
.tg__card { padding: 24px; border-radius: 16px; background: var(--surface); color: var(--ink); }
.tg__handle { margin-top: 6px; font-weight: 600; font-size: clamp(24px, 2.3vw, 32px); letter-spacing: -.05em; }
.tg__btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 20px; }
.tg__btns .mailcard__copy { margin-top: 0; }

/* =========================================================
   ДЕТАЛЬНАЯ
   ========================================================= */
.readbar { position: fixed; top: 0; left: 0; right: 0; z-index: 70; height: 3px; padding-top: env(safe-area-inset-top, 0px); pointer-events: none; }
.readbar span { display: block; height: 3px; background: var(--pink); transform: scaleX(0); transform-origin: left; }

.a-head { margin-top: 5px; padding: 32px 32px 44px; border-radius: var(--r-xl); background: var(--surface); }
.a-head__grid { margin-top: 64px; display: grid; grid-template-columns: 325fr 977fr; gap: 24px; }
.a-head__meta { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 14px; }
.a-head__title {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(40px, 5.8vw, 84px); line-height: 1; letter-spacing: -.05em; text-wrap: balance;
}
.a-head__lead { margin-top: 28px; max-width: 760px; }
.a-head__lead span { color: var(--ink-3); }

/* обложка-схема */
.a-cover-wrap { margin-top: 4px; }
.a-cover {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 40px; align-items: center;
  padding: 56px 48px; border-radius: var(--r-lg); background: var(--night); color: #fff;
}
.tower { display: flex; flex-direction: column; gap: 10px; padding: 12px 0 12px 6%; }
.tower__floor {
  position: relative; height: clamp(54px, 5.6vw, 80px); width: 86%;
  border-radius: 14px; background: var(--c); color: #000;
  transform: skewX(-14deg) translateX(0); opacity: .5;
  transition: opacity .35s, transform .5s var(--ease), box-shadow .35s;
  cursor: pointer; outline: none;
}
.tower__floor:nth-child(even) { margin-left: 8%; }
.tower__floor span {
  position: absolute; left: 22px; top: 50%; transform: translateY(-50%) skewX(14deg);
  font-family: var(--f-display); font-weight: 600; font-size: clamp(18px, 2vw, 28px); letter-spacing: -.04em;
}
.tower__floor.is-lit, .tower__floor:focus-visible { opacity: 1; transform: skewX(-14deg) translateX(18px); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.tower__side { display: flex; flex-direction: column; gap: 24px; }
.tower__legend { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.tower__legend li {
  display: flex; justify-content: space-between; gap: 16px; padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .15); cursor: pointer;
  color: rgba(255, 255, 255, .5); transition: color .3s;
}
.tower__legend li b { font-weight: 600; font-size: 18px; letter-spacing: -.04em; }
.tower__legend li span { font-size: 13px; letter-spacing: -.02em; text-align: right; }
.tower__legend li.is-lit { color: #fff; }
.tower__note { font-family: var(--f-mono); font-size: 11.2px; text-transform: uppercase; color: rgba(255, 255, 255, .45); }

/* тело статьи */
.a-body-wrap { margin-top: 4px; }
.a-body {
  display: grid; grid-template-columns: 325fr 977fr; gap: 24px;
  padding: 56px 32px 64px; border-radius: var(--r-lg); background: var(--surface);
}
.a-aside { position: sticky; top: calc(100px + env(safe-area-inset-top, 0px)); align-self: start; display: flex; flex-direction: column; gap: 24px; max-width: 280px; }
.facts { padding: 20px; border-radius: var(--r-md); background: var(--tile); }
.facts dl { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.facts dt { font-family: var(--f-mono); font-size: 11.2px; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 15px; letter-spacing: -.03em; }
.toc__label { font-family: var(--f-mono); font-size: 11.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.toc a { display: block; padding: 7px 0 7px 14px; border-left: 2px solid #e7e7e7; font-size: 14px; letter-spacing: -.03em; color: var(--muted); transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left-color: var(--pink); }
.a-share { align-self: flex-start; margin-top: 0; }

.prose { max-width: 680px; font-size: 18px; line-height: 1.6; letter-spacing: -.02em; color: #1a1a1d; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 {
  margin-top: 2.2em; scroll-margin-top: 110px;
  font-family: var(--f-display); font-weight: 600; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.1; letter-spacing: -.035em; color: var(--black);
}
.prose h2:first-child { margin-top: 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--pink); }
.callout {
  margin-block: 1.6em !important; padding: 28px 30px; border-radius: var(--r-md); background: var(--lime); color: #000;
  font-family: var(--f-display); font-weight: 600; font-size: clamp(26px, 2.8vw, 40px); line-height: 1.05; letter-spacing: -.045em;
}
.feature-list { margin-left: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.feature-list li { padding: 18px 20px; border-radius: 14px; background: var(--tile); font-size: 16px; line-height: 1.5; }
.feature-list b { font-weight: 600; }

.board { padding: 20px; border-radius: var(--r-md); background: var(--black); color: #fff; }
.board__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.board__label { font-family: var(--f-mono); font-size: 11.2px; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.board .mailcard__copy { margin-top: 0; background: #fff; color: #000; }
.board .mailcard__copy:hover { background: var(--lime); }
.board__chain { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.board__chain li {
  position: relative; height: 40px; padding: 0 16px; display: inline-flex; align-items: center;
  border-radius: 40px; background: #1b1a22; font-weight: 600; font-size: 14px; letter-spacing: -.03em;
  animation: fade .4s var(--ease);
}
.board__chain li:nth-child(3n+1) { background: var(--pink); color: #000; }
.board__chain li:nth-child(3n+2) { background: var(--lime); color: #000; }
.board__chain li:not(:last-child)::after {
  content: "→"; position: absolute; right: -17px; color: rgba(255, 255, 255, .5); font-weight: 500;
}
.source { margin-top: 2.4em !important; padding-top: 18px; border-top: 1px solid #eee; font-size: 14px; color: var(--muted); }

.related-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }

/* ---------- АДАПТИВ ---------- */
@media (max-width: 1100px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .j-hero__bottom { grid-template-columns: 1fr; }
  .filters { justify-content: flex-start; }
  .feat { grid-template-columns: 1fr; }
  .feat__visual { min-height: 300px; }
  .tg { grid-template-columns: 1fr; padding: 40px 24px 24px; }
  .a-head__grid { grid-template-columns: 1fr; margin-top: 40px; }
  .a-head__meta { flex-direction: row; flex-wrap: wrap; align-items: center; padding-top: 0; }
  .a-cover { grid-template-columns: 1fr; padding: 40px 24px; }
  .a-body { grid-template-columns: 1fr; padding: 40px 24px 48px; }
  .a-aside { position: static; max-width: none; }
  .toc-wrap { display: none; }
}
@media (max-width: 720px) {
  .j-hero, .a-head { padding: 20px 20px 24px; }
  .j-hero__title { font-size: 25cqw; }
  .post-grid { grid-template-columns: 1fr; }
  .feat__body { padding: 28px 20px; }
  .tg { padding: 32px 20px 20px; }
  .tower__floor { width: 90%; }
  .prose { font-size: 17px; }
  .a-body { padding: 32px 18px 40px; }
}

/* =========================================================
   РУБРИКИ ЖУРНАЛА + ДЕТАЛЬНАЯ post.html
   ========================================================= */
.post__type--projects { background: var(--lime); color: #000; }
.post__type--ideas { background: var(--pink); color: #000; }
.post__type--team { background: var(--tile); color: var(--ink); }
.post__type--media { background: var(--black); color: #fff; }
.post__type--community { background: #e6d6ff; color: #000; }

/* типографская обложка публикации в СМИ */
.post__media--type { position: relative; }
.post__media--type em, .p-cover--type em {
  position: absolute; top: 20px; left: 24px;
  font-style: normal; font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: -.02em; opacity: .7;
}

/* главный материал с фото */
.feat__visual--img { display: block; padding: 4px; background: var(--surface); }
.feat__visual--img img { width: 100%; height: 100%; min-height: 432px; object-fit: cover; border-radius: calc(var(--r-lg) - 4px); transition: transform .9s var(--ease); }
.feat:hover .feat__visual--img img { transform: scale(1.03); }
.feat__visual--img { overflow: hidden; }
.feat__sticker {
  position: absolute; top: 20px; left: 20px; z-index: 1;
  height: 32px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 32px;
  background: var(--lime); color: #000; font-weight: 600; font-size: 13px; letter-spacing: -.03em;
}

/* обложка детальной */
.p-cover-wrap { margin-top: 4px; }
.p-cover {
  position: relative; display: block; width: 100%; padding: 4px; border: 0; border-radius: var(--r-lg);
  background: var(--surface); cursor: zoom-in; overflow: hidden;
}
.p-cover img { display: block; width: 100%; height: clamp(320px, 52vw, 720px); object-fit: cover; border-radius: calc(var(--r-lg) - 4px); }
.p-cover__hint {
  position: absolute; right: 20px; bottom: 20px; height: 36px; padding: 0 16px; display: inline-flex; align-items: center;
  border-radius: 36px; background: rgba(255, 255, 255, .92); color: #000; font-weight: 600; font-size: 13px; letter-spacing: -.03em;
  transition: background .3s var(--ease);
}
.p-cover:hover .p-cover__hint { background: var(--lime); }
.p-cover--type {
  cursor: default; height: clamp(260px, 32vw, 420px); padding: 40px; display: flex; align-items: flex-end;
}
.p-cover--type span { font-family: var(--f-display); font-weight: 600; font-size: clamp(80px, 14vw, 220px); line-height: .85; letter-spacing: -.06em; }
.p-cover--type em { top: 32px; left: 40px; }

/* текст детальной */
.p-intro { padding: 16px 20px; border-radius: 14px; background: var(--tile); font-size: 15px !important; color: var(--ink-2); }
.p-note {
  display: flex; gap: 14px; align-items: flex-start;
  margin-block: 1.8em !important; padding: 24px 26px; border-radius: var(--r-md); background: var(--lime); color: #000;
  font-family: var(--f-display); font-weight: 600; font-size: clamp(20px, 1.9vw, 26px); line-height: 1.15; letter-spacing: -.035em;
}
.p-note span { flex: none; font-size: 1.1em; line-height: 1; }
.p-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.p-gallery figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.p-gallery figure:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.p-shot { display: block; width: 100%; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: var(--tile); cursor: zoom-in; }
.p-shot img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .8s var(--ease); }
.p-gallery figure:first-child:nth-last-child(odd) .p-shot img { aspect-ratio: 16 / 9; }
/* вертикальные кадры: 3 колонки, без кадрирования в горизонталь */
.p-gallery--portrait { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.p-gallery--portrait figure:first-child:nth-last-child(odd) { grid-column: auto; }
.p-gallery--portrait .p-shot img, .p-gallery--portrait figure:first-child:nth-last-child(odd) .p-shot img { aspect-ratio: 9 / 16; }
/* высокие кадры: 2 колонки 4:5 */
.p-gallery--tall figure:first-child:nth-last-child(odd) { grid-column: auto; }
.p-gallery--tall .p-shot img, .p-gallery--tall figure:first-child:nth-last-child(odd) .p-shot img { aspect-ratio: 4 / 5; }
/* натуральные пропорции: колонки-кирпичики */
.p-gallery--natural { display: block; columns: 2; column-gap: 4px; }
.p-gallery--natural figure { break-inside: avoid; margin-bottom: 12px; }
.p-gallery--natural .p-shot img, .p-gallery--natural figure:first-child:nth-last-child(odd) .p-shot img { aspect-ratio: auto; }
@media (max-width: 720px) { .p-gallery--portrait { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.p-shot:hover img { transform: scale(1.04); }
.p-gallery figcaption { font-size: 14px; line-height: 1.4; color: var(--muted); }
.p-source {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 24px 26px; border-radius: var(--r-md); background: var(--black); color: #fff;
}
.p-source__label { font-family: var(--f-mono); font-size: 11.2px; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.p-source__title { margin-top: 6px; font-family: var(--f-display); font-weight: 600; font-size: 24px; letter-spacing: -.035em; }
.a-back { display: inline-block; margin-top: 18px; font-weight: 600; font-size: 14px; letter-spacing: -.03em; color: var(--muted); transition: color .3s var(--ease); }
.a-back:hover { color: var(--black); }

@media (max-width: 960px) {
  .feat__visual--img img { min-height: 300px; }
}
@media (max-width: 720px) {
  .p-gallery { grid-template-columns: 1fr; }
  .p-cover--type { padding: 24px; }
  .p-cover--type em { left: 24px; top: 22px; }
  .feat__sticker { top: 14px; left: 14px; }
}
.p-cover--type.post__media--lime { background: var(--lime); color: #000; }
.p-cover--type.post__media--pink { background: var(--pink); color: #000; }
.p-cover--type.post__media--night { background: var(--night); color: #fff; }
@media (max-width: 720px) { .p-cover--type { height: 220px; } }

.post__media--sky { background: #b8d4ff; color: #000; }
.p-cover--type.post__media--sky { background: #b8d4ff; color: #000; }
