/* Оформление сайта. Всё взято с обложки подкаста — раскрашенной гравюры
   на состаренной бумаге: цвет её пергамента, тёмно-красная лента с
   золотыми ромбами, двойная рамка, тонкая линейка с орнаментом посередине.
   Чёрное с красным по бумаге — рубрикация старых книг. */

/* Шрифты Alegreya и Alegreya SC (лицензия OFL, см. static/fonts/OFL.txt)
   лежат на своём сервере: тот же шрифт, которым набиралась обложка.
   Каждый файл — одна письменность; браузер берёт только нужные странице. */

@font-face {
  font-family: "Alegreya";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/alegreya-italic-cyrillic-ext.a1ac0ef24296.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Alegreya";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/alegreya-italic-cyrillic.0eec3a493bc4.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Alegreya";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/alegreya-italic-latin-ext.c1a81338a499.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Alegreya";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/alegreya-italic-latin.ad79ee28205c.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Alegreya";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/alegreya-normal-cyrillic-ext.f1d30cea5d0a.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Alegreya";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/alegreya-normal-cyrillic.e8fcc51d4437.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Alegreya";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/alegreya-normal-latin-ext.9ff7b59ea7ab.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Alegreya";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/alegreya-normal-latin.97a4bfd7b3ce.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Alegreya SC";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/alegreya-sc-800-cyrillic-ext.00b35461f7d6.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Alegreya SC";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/alegreya-sc-800-cyrillic.a383f9210885.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Alegreya SC";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/alegreya-sc-800-latin-ext.eadca6ef85d2.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Alegreya SC";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/alegreya-sc-800-latin.730c984717f7.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --c-paper: #f0e2c3;        /* светлые места пергамента */
  --c-paper-deep: #e7d3ac;   /* сам пергамент обложки */
  --c-ink: #2b2017;
  --c-ink-soft: #65543f;
  --c-rule: #cdb78d;
  --c-accent: #8b1a16;       /* лента: ссылки, метки, ромбы */
  --c-ribbon: #7d1512;       /* лента: заливка кнопок */
  --c-ribbon-deep: #5e130f;  /* её хвосты */
  --c-on-ribbon: #f3e7c5;    /* буквы на ленте */
  --c-ochre: #c9962f;        /* золотые ромбы */
  color-scheme: light;

  --font-text: "Alegreya", Georgia, "Times New Roman", serif;
  --font-head: "Alegreya", Georgia, "Times New Roman", serif;
  --font-caps: "Alegreya SC", "Alegreya", Georgia, serif;

  --measure: 44rem;
  --gap: 1.5rem;
}

/* «Ночной архив»: тёмный фон и тёплый светлый текст. Включается сам по
   настройке устройства; кнопка в шапке ставит data-theme и перекрывает её.
   Набор переменных повторён дважды: в CSS нет способа назвать его один раз. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-paper: #1c1512;
    --c-paper-deep: #2a1f19;
    --c-ink: #ecdcb9;
    --c-ink-soft: #b5a384;
    --c-rule: #4a3a2c;
    --c-accent: #e58a75;
    --c-ribbon: #9c2019;
    --c-ribbon-deep: #7d1512;
    --c-ochre: #d9a640;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --c-paper: #1c1512;
  --c-paper-deep: #2a1f19;
  --c-ink: #ecdcb9;
  --c-ink-soft: #b5a384;
  --c-rule: #4a3a2c;
  --c-accent: #e58a75;
  --c-ribbon: #9c2019;
  --c-ribbon-deep: #7d1512;
  --c-ochre: #d9a640;
  color-scheme: dark;
}

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

/* У Alegreya невысокие строчные, поэтому весь масштаб чуть крупнее обычного. */
html {
  font-size: 112.5%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--c-paper);
  color: var(--c-ink);
  font-family: var(--font-text);
  font-size: 1.125rem;
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-color: var(--c-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--c-accent);
}

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}

p {
  margin: 0 0 1em;
}

.skip {
  position: absolute;
  left: -999rem;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--c-paper-deep);
}

/* Двойная рамка, как у обложки: тонкая линия и вторая с отступом. */
.framed {
  border: 1px solid var(--c-ink);
  box-shadow:
    0 0 0 3px var(--c-paper),
    0 0 0 4px var(--c-ink);
}

/* Ромб — тот же, что по краям названия на ленте. Нарисован, а не набран
   знаком: знак в каждом шрифте свой, а на телефоне может стать картинкой. */
.dia {
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  background: currentColor;
  transform: rotate(45deg);
}

/* Линейка с орнаментом посередине — как под лентой на обложке. */
.ornament {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--c-accent);
}

.ornament::before,
.ornament::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--c-ink);
  opacity: 0.55;
}

/* --- шапка и подвал ------------------------------------------------------ */

.top,
.page,
.bottom {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--c-ink);
}

/* Название — одна надпись, как на ленте обложки: капитель Alegreya SC и
   ромбы по краям. Ромбы между словами убраны: с ними название читалось
   как три пункта меню. */
.top__logo {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-caps);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.top__logo .dia {
  flex: none;
  font-size: 0.8em;
  color: var(--c-accent);
}

.top__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
  font-size: 1rem;
}

.theme {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--c-ink);
  border-radius: 50%;
  background: none;
  color: var(--c-ink);
  cursor: pointer;
}

.theme:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
}

/* На телефоне кнопка темы встаёт в строку с названием: в строке со
   ссылками ей не хватает места, а отдельная строка ради неё — лишняя. */
@media (max-width: 719px) {
  .top {
    position: relative;
  }

  /* чуть мельче и плотнее, чтобы название уместилось в одну строку */
  .top__logo {
    margin-right: 2.75rem;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
  }

  .theme {
    position: absolute;
    right: 1.25rem;
    top: 0.6rem;
  }
}

.theme svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.page {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.page__title {
  font-size: clamp(2rem, 7vw, 3rem);
  margin-bottom: 2rem;
}

.bottom {
  padding-bottom: 2.5rem;
  color: var(--c-ink-soft);
  font-size: 0.95rem;
}

.bottom .ornament {
  margin-bottom: 1.5rem;
}

.bottom__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

/* кнопка установки приложения выглядит как соседние ссылки подвала */
.install {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--c-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.install:hover {
  color: var(--c-accent);
}

.install-hint {
  max-width: 32rem;
  margin-top: 0.75rem;
}

/* --- главная ------------------------------------------------------------- */

.hero {
  display: grid;
  gap: 1.75rem;
  margin-bottom: 2rem;
}

.hero__cover {
  width: min(100%, 19rem);
  margin: 0 auto;
}

.hero__cover img {
  width: 100%;
}

/* Видно только без обложки: с ней название уже нарисовано на картинке
   (см. home.html). Крупное название в три строки давало «лесенку», поэтому
   и тогда оно — строка капителью. */
.hero__name {
  margin-bottom: 0.6rem;
  font-family: var(--font-caps);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
}

.hero__tagline {
  max-width: 22rem;
  margin: 0 0 1.5rem;
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 4.6vw, 1.5rem);
  font-weight: 500;
  line-height: 1.25;
  text-wrap: balance;
}

/* логлайн длиннее фразы о проекте — шрифт меньше, строки свободнее */
.hero__logline {
  max-width: 27rem;
  margin: 0 0 1.5rem;
  font-family: var(--font-head);
  font-size: clamp(1.15rem, 3.8vw, 1.3rem);
  font-weight: 500;
  line-height: 1.4;
  text-wrap: pretty;
}

.hero__announcement {
  margin: -0.5rem 0 1.5rem;
  font-family: var(--font-caps);
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--c-accent);
}

.hero + .ornament {
  margin-bottom: 3rem;
}

@media (min-width: 720px) {
  .hero {
    grid-template-columns: 18rem 1fr;
    align-items: center;
    gap: 2.5rem;
  }

  .hero__cover {
    width: 100%;
  }

  /* пока обложка не загружена, текст занимает всю ширину, а не узкую
     колонку, отведённую под неё */
  .hero__text:first-child {
    grid-column: 1 / -1;
  }
}

/* кнопка — кусок ленты с обложки: тёмно-красная, с золотыми ромбами */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.7rem 1.3rem;
  background: var(--c-ribbon);
  color: var(--c-on-ribbon);
  font-size: 1rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  /* надпись на ленте не переносится: на телефоне кнопка иначе растягивалась на две строки */
  white-space: nowrap;
}

.button::before,
.button::after {
  content: "";
  width: 0.36em;
  height: 0.36em;
  background: var(--c-ochre);
  transform: rotate(45deg);
}

.button:hover {
  background: var(--c-ribbon-deep);
  color: var(--c-on-ribbon);
}

.button--quiet {
  background: none;
  color: var(--c-ink);
  border: 1px solid var(--c-ink);
}

.button--quiet::before,
.button--quiet::after {
  content: none;
}

.button--quiet:hover {
  background: none;
  border-color: var(--c-accent);
  color: var(--c-accent);
}

.quote {
  margin: 0 0 3rem;
  text-align: center;
}

.quote__text {
  margin: 0 0 0.75rem;
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.35;
  /* стихи: перенос строки, набранный в админке, остаётся переносом */
  white-space: pre-line;
}

.quote__source {
  color: var(--c-ink-soft);
  font-size: 0.95rem;
}

.block {
  margin-bottom: 3rem;
}

/* подзаголовок блока — как строка на ленте: прописные и ромб перед ними */
.block__title {
  margin-bottom: 1.25rem;
  font-family: var(--font-caps);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}

.block__title::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.75em;
  background: var(--c-accent);
  transform: rotate(45deg) translateY(-0.08em);
}

.block--note {
  margin-left: 4px;
  margin-right: 4px;
  padding: 1.5rem;
}

/* кнопки в ряд; на узком экране вторая уходит под первую */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.more {
  font-size: 1rem;
}

.empty {
  color: var(--c-ink-soft);
}

.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.platforms__link {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  min-height: 2.4rem;
  padding: 0.2rem 0.9rem 0.2rem 0.7rem;
  border: 1px solid var(--c-ink);
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
}

.platforms__link:hover {
  border-color: var(--c-accent);
}

.platforms__icon {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

/* --- карточка выпуска ---------------------------------------------------- */

.card {
  display: grid;
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--c-rule);
}

.card__cover img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.card__label,
.card__meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--c-ink-soft);
}

.card__era::before {
  content: "· ";
}

.card__title {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.7rem;
}

.card__title a {
  text-decoration: none;
}

.card__subtitle,
.episode__subtitle {
  display: block;
  margin-top: 0.2em;
  font-size: 0.68em;
  font-weight: 400;
  font-style: italic;
}

/* Запятая перед «или» нужна тем, кто слушает страницу или копирует
   заголовок; на экране подзаголовок стоит отдельной строкой, и запятая
   повисла бы в конце первой. */
.hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.card__summary {
  margin: 0 0 0.5rem;
}

.badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0 0.5rem;
  border: 1px solid currentColor;
  font-size: 0.8rem;
  color: var(--c-accent);
}

@media (min-width: 720px) {
  .card {
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
  }

  /* у карточки без обложки текст занимает всю ширину, а не узкую колонку */
  .card__body:first-child {
    grid-column: 1 / -1;
  }
}

/* --- страница выпуска ---------------------------------------------------- */

.episode__label,
.episode__meta {
  font-size: 0.95rem;
  color: var(--c-ink-soft);
}

/* «12 просмотров» после даты материала (views.js) */
.episode__views::before {
  content: "· ";
}

/* «Добавьте в любимые источники Google» (_google_source.html): тонкая
   плашка в цветах сайта; гугловская только сама буква G */
.google-source {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 2rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--c-rule);
  background: var(--c-paper-deep);
  color: var(--c-ink);
  font-size: 0.95rem;
  line-height: 1.35;
  text-decoration: none;
}

.google-source:hover {
  border-color: var(--c-accent);
  color: var(--c-ink);
}

.google-source__g {
  flex: none;
  width: 22px;
  height: 22px;
}

.google-source__text {
  flex: 1;
}

.google-source__cta {
  flex: none;
  padding: 0.3rem 0.9rem;
  background: var(--c-ribbon);
  color: var(--c-on-ribbon);
  font-size: 0.9rem;
  white-space: nowrap;
}

.google-source:hover .google-source__cta {
  background: var(--c-ribbon-deep);
}

/* на телефоне хватает самой плашки: она вся — ссылка */
@media (max-width: 480px) {
  .google-source__cta {
    display: none;
  }
}

.episode__title {
  margin: 0.5rem 0 1rem;
  font-size: clamp(2.2rem, 9vw, 3.6rem);
}

.episode__edit {
  margin-left: 0.75rem;
}

.page__kicker {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}

/* Фильтр по типу в разделе материалов. */
.filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: -1rem 0 2rem;
  font-size: 1rem;
}

/* открытый сейчас пункт — не ссылка на вид: идти по нему некуда */
.filter__link[aria-current="page"] {
  text-decoration: none;
  color: var(--c-ink-soft);
}

/* Уведомление о cookie: появляется вместе со счётчиком Метрики. */
.cookie {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--c-rule);
  background: var(--c-paper-deep);
  font-size: 0.9rem;
}

.cookie[hidden] {
  display: none;
}

.cookie__text {
  margin: 0;
}

.cookie__ok {
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--c-ink);
  background: none;
  color: var(--c-ink);
  font: inherit;
  cursor: pointer;
}

/* Пометки, которые видит только автор, вошедший в админку. */
.warning {
  padding: 0.75rem 1rem;
  border: 1px dashed var(--c-accent);
  font-size: 0.95rem;
  color: var(--c-accent);
}

/* --- иллюстрации --------------------------------------------------------- */

.figure {
  margin: 2rem 0;
}

.figure__zoom {
  display: block;
  cursor: zoom-in;
}

.figure__caption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--c-ink-soft);
}

.figure__credit {
  font-size: 0.85rem;
  font-style: italic;
}

.gallery {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.gallery .figure {
  margin: 0;
}

@media (min-width: 720px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- «Слушать на платформах» и плеер ------------------------------------- */

.listen {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  margin: 2rem 0 1rem;
  font-size: 1rem;
}

.listen__title {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}

.player {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem 1rem;
  align-items: start;
  margin: 0 4px 2.5rem;
  padding: 1rem;
}

.player__cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.player__info {
  min-width: 0;
}

/* На телефоне кнопки идут под обложкой во всю ширину карточки: в узкой
   колонке справа от неё они не помещаются в одну строку. */
.player__info:first-child,
.player__audio,
.player__ui {
  grid-column: 1 / -1;
}

@media (min-width: 720px) {
  .player {
    grid-template-columns: 8rem 1fr;
  }

  .player__cover {
    grid-row: 1 / span 2;
  }

  .player__cover ~ .player__audio,
  .player__cover ~ .player__ui {
    grid-column: 2;
  }
}

.player__date,
.player__show {
  margin: 0;
  font-size: 0.85rem;
  color: var(--c-ink-soft);
}

/* Неразрывные пробелы типографа делают название из длинных кусков; в узкой
   колонке рядом с обложкой кусок может не поместиться — тогда его можно
   перенести где угодно, лишь бы не вылез за рамку. */
.player__title {
  margin: 0.1rem 0;
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

@media (min-width: 720px) {
  .player__title {
    font-size: 1.3rem;
  }
}

.player__audio {
  display: block;
  width: 100%;
}

/* скрипт включился: встроенный плеер браузера больше не нужен */
.player--ready .player__audio {
  display: none;
}

.player__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.player button {
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--c-ink);
  border-radius: 999px;
  background: none;
  color: var(--c-ink);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.player button:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
}

.player .player__play {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-color: var(--c-ribbon);
  background: var(--c-ribbon);
  color: var(--c-on-ribbon);
}

.player .player__play:hover {
  border-color: var(--c-ribbon-deep);
  background: var(--c-ribbon-deep);
  color: var(--c-on-ribbon);
}

.player__icon {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.player__icon--pause,
.player--playing .player__icon--play {
  display: none;
}

.player--playing .player__icon--pause {
  display: block;
}

/* до первого нажатия — одна кнопка «Слушать»; остальное появляется потом */
.player:not(.player--started) .player__skip,
.player:not(.player--started) .player__rate,
.player:not(.player--started) .player__bar,
.player--started .player__play-label {
  display: none;
}

.player--started .player__play {
  justify-content: center;
  width: 2.75rem;
  padding: 0;
}

.player__rate {
  margin-left: auto;
}

.player__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  margin-top: 0.75rem;
}

.player__progress {
  flex: 1 1 12rem;
  min-width: 0;
  height: 1.75rem;
  margin: 0;
  accent-color: var(--c-accent);
}

.player__time {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--c-ink-soft);
}

.player__error {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--c-accent);
}

/* --- плеер для вставки на другие сайты (embed.html) ---------------------- */

/* на чужой странице плеер — вставка, а не главный текст: мельче, чем у нас */
.embed-page {
  font-size: 100%;
}

/* Вокруг карточки прозрачно — на чужой странице видна только она сама;
   отступ оставляет место для внешнего кольца двойной рамки. */
.embed {
  padding: 4px;
  background: transparent;
}

.embed .player {
  margin: 0;
  background: var(--c-paper);
}

/* Высоту окна задаёт код вставки, поэтому кнопки и полоса видны сразу:
   иначе после первого нажатия карточка выросла бы и перестала помещаться. */
.embed .player:not(.player--started) .player__skip,
.embed .player:not(.player--started) .player__rate {
  display: inline-block;
}

.embed .player:not(.player--started) .player__bar {
  display: flex;
}

/* Одна раскладка на любой ширине — та, что у нас на телефоне: тогда и высота
   одна, и её можно задать в коде вставки (EMBED_HEIGHT в views.py). */
.embed .player {
  grid-template-columns: 5.5rem 1fr;
}

.embed .player__cover {
  grid-row: auto;
}

.embed .player__cover ~ .player__audio,
.embed .player__cover ~ .player__ui {
  grid-column: 1 / -1;
}

/* длинное название не должно раздуть карточку: две строки, дальше многоточие */
.embed .player__title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 1.1rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.embed .player__show {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* в узком окне (статья на телефоне) все кнопки должны встать в одну строку */
@media (max-width: 479px) {
  .embed .player button {
    padding: 0 0.7rem;
  }

  .embed .player__row {
    gap: 0.35rem;
  }
}

.embed .player__title a,
.embed .player__show a {
  color: inherit;
  text-decoration: none;
}

.embed .player__title a:hover,
.embed .player__show a:hover {
  color: var(--c-accent);
  text-decoration: underline;
}

/* --- блоки страницы выпуска ---------------------------------------------- */

.timecodes,
.sources,
.points,
.credits,
.tags {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timecodes__link {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--c-rule);
  text-decoration: none;
}

.timecodes__time {
  flex: none;
  width: 3.5rem;
  font-variant-numeric: tabular-nums;
  color: var(--c-accent);
}

.points li {
  position: relative;
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 0.75rem;
  border-top: 1px solid var(--c-accent);
}

.sources {
  padding-left: 1.5rem;
  list-style: decimal;
  font-size: 1rem;
}

/* на сводной странице источников: к какому выпуску относится список */
.sources__of {
  margin: -0.5rem 0 0.75rem;
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.sources__of a {
  text-decoration: none;
}

.sources li {
  margin-bottom: 0.4rem;
  overflow-wrap: anywhere;
}

/* длинный список источников свёрнут (_sources.html); надпись на кнопке
   меняется, когда список раскрыт */
.sources-more summary {
  width: fit-content;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  text-decoration: underline;
  text-decoration-color: var(--c-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.sources-more summary:hover {
  color: var(--c-accent);
}

.sources-more__hide,
.sources-more[open] .sources-more__show {
  display: none;
}

.sources-more[open] .sources-more__hide {
  display: inline;
}

.credits {
  font-size: 1rem;
}

.credits__role {
  color: var(--c-ink-soft);
}

.credits__role::after {
  content: " —";
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 3rem;
  font-size: 1rem;
}

.tags__link {
  letter-spacing: 0.06em;
}

/* --- текст выпуска ------------------------------------------------------- */

.prose {
  margin-bottom: 2rem;
}

.prose--announce {
  font-size: 1.2rem;
}

.prose--body {
  margin-bottom: 3rem;
}

.prose h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.9rem;
}

.prose h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.45rem;
}

/* цитата в тексте — выписка на пергаменте: крупный курсив, слева лента
   с золотым ромбом, как на обложке */
.prose blockquote {
  position: relative;
  margin: 2rem 0;
  padding: 1.1rem 1.5rem 1.1rem 1.75rem;
  border-left: 3px solid var(--c-accent);
  background: var(--c-paper-deep);
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.45;
}

.prose blockquote::before {
  content: "";
  position: absolute;
  top: 1.35rem;
  /* ромб сидит посередине ленты */
  left: calc(-1.5px - 0.3rem);
  width: 0.6rem;
  height: 0.6rem;
  background: var(--c-ochre);
  transform: rotate(45deg);
}

.prose blockquote p {
  margin: 0 0 0.6rem;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

/* подпись под цитатой: её последний абзац, начатый с тире (podcast/richtext.py) */
.prose .quote-source {
  margin-top: 0.75rem;
  font-family: var(--font-text);
  font-size: 0.95rem;
  font-style: normal;
  color: var(--c-ink-soft);
}

.prose ul,
.prose ol {
  padding-left: 1.5rem;
}

.prose .figure--inline {
  margin: 2rem 0;
}

/* «слушать с этого места» у подзаголовка */
.seek {
  display: inline-block;
  margin-left: 0.4em;
  padding: 0 0.5em;
  border: 1px solid var(--c-accent);
  border-radius: 999px;
  font-family: var(--font-text);
  font-size: 0.85rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
  vertical-align: middle;
  text-decoration: none;
  color: var(--c-accent);
}

.seek::before {
  content: "▸ ";
}

/* --- соседние выпуски и «поделиться» -------------------------------------- */

.neighbours {
  display: grid;
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--c-rule);
  border-bottom: 1px solid var(--c-rule);
}

.neighbours__link {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}

.neighbours__label {
  display: block;
  font-family: var(--font-text);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--c-ink-soft);
}

.neighbours__all {
  font-size: 1rem;
}

@media (min-width: 720px) {
  .neighbours {
    grid-template-columns: 1fr 1fr;
  }

  .neighbours__link--next {
    grid-column: 2;
    text-align: right;
  }

  .neighbours__all {
    grid-column: 1 / -1;
  }
}

.share {
  padding-top: 2rem;
}

.share__links,
.share__follow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  font-size: 1rem;
}

.share__copy {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--c-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.share__copy:hover {
  color: var(--c-accent);
}

/* «Встроить плеер»: раскрывается по нажатию, код можно выделить или скопировать */
.share__embed {
  margin: 0.75rem 0 1.25rem;
  font-size: 1rem;
}

.share__embed summary {
  width: fit-content;
  text-decoration: underline;
  text-decoration-color: var(--c-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.share__embed summary:hover {
  color: var(--c-accent);
}

.share__embed p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  color: var(--c-ink-soft);
}

.share__code {
  display: block;
  width: 100%;
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--c-rule);
  background: var(--c-paper-deep);
  color: var(--c-ink);
  font: 0.8rem/1.45 ui-monospace, Consolas, monospace;
  resize: none;
}

/* --- лайтбокс ------------------------------------------------------------ */

.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(20, 18, 15, 0.96);
  color: #ebe3d3;
}

.lightbox::backdrop {
  background: rgba(20, 18, 15, 0.96);
}

.lightbox__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: 100%;
  padding: 3.5rem 1rem 2.5rem;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100% - 4rem);
  width: auto;
  object-fit: contain;
}

.lightbox__text {
  max-width: 44rem;
  margin: 0;
  font-size: 0.95rem;
  text-align: center;
}

.lightbox__credit {
  font-style: italic;
  opacity: 0.75;
}

.lightbox__counter {
  position: absolute;
  top: 1rem;
  left: 1rem;
  margin: 0;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

.lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(235, 227, 211, 0.12);
  color: inherit;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox button:hover {
  background: rgba(235, 227, 211, 0.25);
}

.lightbox__close {
  top: 0.5rem;
  right: 0.5rem;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav--prev {
  left: 0.5rem;
}

.lightbox__nav--next {
  right: 0.5rem;
}

.lightbox__nav svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.lightbox--single .lightbox__nav,
.lightbox--single .lightbox__counter {
  display: none;
}

/* --- лёгкая тонировка иллюстраций ----------------------------------------
   Сканы из разных музеев сняты при разном свете; общий тёплый тон собирает
   их в один ряд. В лайтбоксе картинка открывается как есть. */

.card__cover img,
.figure img,
.player__cover {
  filter: sepia(0.14) saturate(0.94);
}

/* --- лента времени на странице выпусков ----------------------------------
   Выпуски идут по эпохам, от древних к новым: подкаст — путешествие во
   времени, и здесь это видно. */

.timeline {
  margin: 0 0 0 0.3rem;
  padding: 0 0 0 1.5rem;
  border-left: 1px solid var(--c-ink);
  list-style: none;
}

.timeline__item {
  position: relative;
  padding-bottom: 2rem;
}

/* ромб на оси — тот же, что на ленте обложки */
.timeline__item::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 5px);
  top: 0.45rem;
  width: 9px;
  height: 9px;
  background: var(--c-accent);
  transform: rotate(45deg);
}

.timeline__era {
  margin: 0 0 0.75rem;
  font-family: var(--font-caps);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-accent);
}

.timeline .card {
  padding-top: 0;
  border-top: 0;
}

/* --- мини-плеер ----------------------------------------------------------
   Появляется внизу экрана, когда выпуск играет, а основной плеер ушёл из
   виду: пауза и возврат к плееру остаются под пальцем. */

.miniplayer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem calc(0.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--c-ink);
  background: var(--c-paper-deep);
}

.miniplayer[hidden] {
  display: none;
}

/* полоса прогресса по верхней кромке панели */
.miniplayer__progress {
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 3px;
  background: var(--c-accent);
  transform-origin: left;
  transform: scaleX(0);
}

.miniplayer button {
  border: 0;
  background: none;
  color: var(--c-ink);
  font: inherit;
  cursor: pointer;
}

.miniplayer .miniplayer__play {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--c-ribbon);
  color: var(--c-on-ribbon);
}

.miniplayer__play svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.miniplayer__play .player__icon--pause,
.player--playing ~ .miniplayer .player__icon--play {
  display: none;
}

.player--playing ~ .miniplayer .player__icon--pause {
  display: block;
}

.miniplayer__title {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0;
  overflow: hidden;
  font-size: 0.95rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.miniplayer__time {
  flex: none;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--c-ink-soft);
}

/* пока панель на экране, подвал и уведомление о cookie не должны под неё уйти */
.has-miniplayer body {
  padding-bottom: 4.5rem;
}

.has-miniplayer .cookie {
  bottom: 3.8rem;
}
