/* BIOGRAPHY.CSS - Биографии из вашего оригинального файла */

.biography-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.biography-layout aside.toc {
    flex: 0 0 250px;
    position: sticky;
    top: 20px;
    background: #edf2f7;
    padding: 15px;
    border: 1px solid #cfd9e3;
    border-radius: 8px;
    height: fit-content;
}

.main-content {
    flex: 1;
    max-width: 700px;
}

.biography-detail h1 {
    font-size: 28px;
    margin-top: 5px;  
    margin-bottom: 10px;
}

.biography-detail .bio-meta {
    font-size: 14px;
    color: #667688;
    margin-bottom: 20px;
}

.bio-image {
    width: 100%;
    max-width: 1400px; /* ограничение ширины */
    max-height: 780px; /* по желанию */
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 20px; /* только отступ снизу */
    display: block;      /* всё ещё нужно для корректного поведения блока */
}

.bio-content {
    font-size: 17px;
    line-height: 1.7;
    color: #3c486b;
}

.bio-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
    object-fit: contain;
    aspect-ratio: attr(width) / attr(height);
}

.toc {
    width: 250px;
    position: sticky;
    top: 20px;
    background: #edf2f7;
    padding: 15px;
    border: 1px solid #cfd9e3;
    border-radius: 8px;
    height: fit-content;
}

.toc h3 {
    margin-top: 0;
    font-size: 16px;
}

.toc ul {
    list-style: none;
    padding-left: 0;
}

.toc li {
    margin-bottom: 0px;
}

.toc a {
    font-size: 16px !important;
    line-height: 2;
    color: #1f4b85;
}

.next-story {
    margin-top: 40px;
    text-align: right;
}

/* Навигация prev/next — общий компонент, стили в base-layout.css */

.author-detail {
    max-width: 900px;
    margin: 0 auto;
}

.author-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 40px;
}

.author-photo {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.author-info h2 {
    margin-top: 0;
    font-size: 26px;
}

.author-bio {
    font-size: 16px;
    line-height: 1.6;
    color: #4a5a6a;
}

.featured-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #dbe3ec;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    gap: 16px;
}

.featured-banner .featured-image img {
    width: 900px;
    max-width: 100%;
    height: 350px;
    object-fit: cover;
    object-position: center center;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.featured-banner .featured-text {
    max-width: 500px;
    flex: 1;
}

.featured-banner .featured-title {
    font-size: 2rem;
    margin-bottom: 12px;
}

.featured-banner .featured-title a {
    color: #3c486b;
    text-decoration: none;
}

.featured-banner .featured-author {
    font-weight: bold;
    color: #587ca1;
    margin-bottom: 16px;
}
.bio-meta-wrapper {
    display: inline-block;
    align-items: baseline;     /* выравнивание по линии текста */
    gap: 8px;                  /* равный промежуток между блоками */
    background-color: #f7f7f7;
    color: #555;
    font-size: 0.9em;
    padding: 6px 12px;
    border-radius: 6px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.bio-meta-wrapper a {
    color: #333;
    text-decoration: underline;
}
.reading-time {
    font-style: italic;
    color: #666;
}
/* Адаптив для мобильных */
@media (max-width: 480px) {
    .bio-meta-wrapper {
        flex-direction: column; /* вертикальный стек */
        align-items: center;    /* центрируем по центру */
        gap: 4px;               /* промежуток между строками */
        font-size: 0.85em;
        padding: 5px 10px;
    }
}

.bio-birth-gradient,
.bio-death-gradient {
    display: inline-block;
    background: linear-gradient(to right, #f8f9fa, #e2e6ea); /* мягкий градиент */
    color: #333;                /* текст чуть темнее для контраста */
    font-size: 0.95em;
    padding: 4px 12px;
    border-radius: 6px;
    margin-top: 8px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* лёгкая тень */
}

/* Адаптив для мобильных */
@media (max-width: 480px) {
    .bio-birth-gradient,
    .bio-death-gradient {
        display: block;
        text-align: center;
        font-size: 0.9em;
        padding: 3px 8px;
    }
}
/* Кнопки поделиться: стили вынесены в base-layout.css (глобальный компонент,
   используется и в story_detail) — здесь больше не дублируются. */
.end-of-text {
  display: inline-block;
  width: 28px;
  height: 28px;
  background-image: url("/static/img/logo-biographiesmedia-up.51a6c31f0017.webp");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  vertical-align: middle;
  margin-left: 4px;
}
.bio-content figure.image {
    margin: 1em 0;
}

.bio-content figcaption {
    font-size: 0.85em;
    color: #667688;
    text-align: center;
    margin-top: 2px;
}

/* ====== «Читайте также» / «Истории с участием» ======
 * Стили .read-also* вынесены в общий static/css/related-cards.css
 * (переиспользуются на странице истории). Здесь больше не дублируются.
 */

/* ====== Мобильный TOC (сворачиваемый <details>) ====== */
/* По умолчанию (десктоп) скрыт — десктоп показывает .toc.toc-desktop в сайдбаре */
.toc-mobile {
    display: none;
}

@media (max-width: 1024px) {
    /* Скрываем десктопный TOC на мобильном — его роль берёт на себя .toc-mobile */
    .biography-layout .toc.toc-desktop {
        display: none !important;
    }

    /* Показываем мобильный TOC */
    .toc-mobile {
        display: block;
        background: #edf2f7;
        border: 1px solid #cfd9e3;
        border-radius: 8px;
        padding: 10px 15px;
        margin: 10px 0 24px;
    }

    .toc-mobile__summary {
        font-weight: 600;
        font-size: 16px;
        color: #3c486b;
        cursor: pointer;
        list-style: none;          /* убираем дефолтный треугольник Firefox */
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 0;
        user-select: none;
    }
    /* убираем дефолтный маркер в WebKit */
    .toc-mobile__summary::-webkit-details-marker {
        display: none;
    }
    /* свой шеврон */
    .toc-mobile__summary::after {
        content: "▾";
        font-size: 14px;
        color: #587ca1;
        margin-left: 10px;
        transition: transform 0.2s ease;
    }
    .toc-mobile[open] .toc-mobile__summary::after {
        transform: rotate(180deg);
    }

    .toc-mobile__list {
        list-style: none;
        padding: 12px 0 4px;
        margin: 8px 0 0;
        border-top: 1px solid #cfd9e3;
    }
    .toc-mobile__list li {
        margin: 0;
    }
    .toc-mobile__list a {
        display: block;
        font-size: 15px;
        line-height: 2;
        color: #1f4b85;
        text-decoration: none;
    }
    .toc-mobile__list a:hover {
        text-decoration: underline;
    }
}
/* ─────────────────────────────────────────────────────────────────────
   Библиографический блок (core/includes/_bibliography.html).
   Только на странице персоны, поэтому живёт здесь, а не в base-layout.css.

   Две вещи сделаны намеренно, и их не надо «приводить к единому виду»:

   1. Белая карточка с рамкой и БЕЗ левого акцента. Библиография не
      продолжение текста, а справочный аппарат: его сканируют, а не читают,
      поэтому он вынесен в отдельный контейнер. Но приём «серая заливка +
      цветная полоса слева» на этой же странице уже занят дважды —
      .fact-check и .bio-quiz-cta, — и третий такой блок подряд читался бы
      как один длинный подвал. Здесь ровно наоборот: белый фон и тонкая
      рамка. Отличает не добавленный акцент, а его отсутствие.
      Не «унифицировать» обратно.

   2. Гротеск на служебных строках (выходные данные, счётчик, ссылка).
      Весь сайт набран Georgia / Times, поэтому выделить книги серифом
      невозможно — они и так серифом. Работает обратный ход: автор,
      название и аннотация редактора остаются Georgia (это содержание),
      а всё окололкнижное — гротеском. Шрифт системный, ничего не грузится.
   ───────────────────────────────────────────────────────────────────── */
.biblio {
    --biblio-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                   "Helvetica Neue", Arial, sans-serif;
    /* Цвет служебных строк. Светлее не делать: это уже контраст 5.06 на фоне
       панели при норме WCAG AA 4.5 для мелкого текста. Прежние #7b8794 и
       #8b97a5 давали 3.56 и 2.89 — выходные данные и пометка «Реклама»
       читались хуже, чем должны. */
    --biblio-muted: #626e7c;
    margin: 2.5rem 0 0;
    padding: 0.35rem 1.25rem 1rem;
    background: #ffffff;
    border: 1px solid #dfe6ee;
    border-radius: 12px;
}
.biblio__section { padding-top: 1rem; }
.biblio__section + .biblio__section {
    margin-top: 1.25rem;
    border-top: 1px solid #e6ebf1;
}
/* Свёрнутый подраздел не должен выглядеть мёртвым заголовком. Одной
   повёрнутой стрелки для этого мало — она мелкая и её замечают, только
   когда уже знают, что искать. Поэтому строка ведёт себя как элемент
   управления целиком: подсветка по наведению, видимый фокус с клавиатуры
   и подсказка «показать» у счётчика, пока раздел закрыт. */
/* Грид, а не флекс: колонки заданы явно — стрелка, заголовок, счётчик.
   На флексе с flex-wrap длинный заголовок не ужимался, а целиком уезжал
   на вторую строку, оставляя стрелку одну. */
.biblio__summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
    column-gap: 0.55rem;
    padding: 0.35rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 8px;
    transition: background 0.15s ease;
}
.biblio__summary:hover { background: #eef2f7; }
.biblio__summary:focus-visible {
    outline: 2px solid #4c5c6d;
    outline-offset: 1px;
    background: #eef2f7;
}
.biblio__summary::-webkit-details-marker { display: none; }
.biblio__summary::before {
    content: "▸";
    font-size: 1em;
    color: #4c5c6d;
    transition: transform 0.15s ease;
    flex: 0 0 auto;
}
.biblio__section[open] .biblio__summary::before { transform: rotate(90deg); }
/* Подсказка только у закрытого раздела: у открытого стрелка вниз и список
   под ней говорят сами за себя, а «свернуть» было бы лишним шумом. */
.biblio__section:not([open]) .biblio__count::after {
    content: " · показать";
    color: #4c5c6d;
}
/* h2 лежит внутри summary — гасим его собственные отступы, иначе стрелка
   и заголовок разъезжаются по вертикали.

   18px против 17px основного текста — намеренно тихо. Семантически это <h2>
   (в микроразметке и в структуре страницы он нужен именно таким), но по
   кеглю библиография подчинена статье: она идёт сразу за её текстом, и
   заголовок в 22px, как у «Читайте также», читался бы как новый раздел
   материала. У рекомендательных блоков внизу страницы такой размер уместен —
   здесь нет. */
.biblio__title {
    min-width: 0;   /* переносится по словам, а не распирает колонку */
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
    color: #3c486b;
}
.biblio__count {
    justify-self: end;
    font-family: var(--biblio-sans);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--biblio-muted);
    white-space: nowrap;
}

.biblio-list {
    list-style: none;
    margin: 0.9rem 0 0;
    padding: 0;
}
.biblio-card {
    padding: 0.8rem 0;
    border-bottom: 1px solid #e9edf2;
}
.biblio-card:last-child { border-bottom: none; }
.biblio-card__ref {
    margin: 0;
    line-height: 1.5;
    color: #1f2937;
}
.biblio-card__authors { font-weight: 600; }
.biblio-card__title { font-style: italic; }
.biblio-card__meta {
    margin: 0.3rem 0 0;
    font-family: var(--biblio-sans);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--biblio-muted);
}
.biblio-card__partial { font-style: normal; }

/* Аннотация редактора — единственное, чего нет в Википедии. Карточка с ней
   выделена заливкой, а не белым: сама панель теперь белая, и белое на белом
   не читалось бы. Текст остаётся Georgia — это авторская фраза, а не
   служебная подпись. */
.biblio-card--noted {
    background: #f4f7fa;
    border-radius: 8px;
    padding: 0.85rem 0.95rem;
    margin: 0.35rem 0;
}
.biblio-card__note {
    margin: 0.5rem 0 0;
    padding-left: 0.75rem;
    border-left: 3px solid #4c5c6d;
    line-height: 1.55;
    color: #374151;
}

.biblio-card__link {
    margin: 0.45rem 0 0;
    font-family: var(--biblio-sans);
    font-size: 0.8rem;
}
.biblio-card__link a {
    color: #1f4b85;
    text-decoration: none;
    border-bottom: 1px solid #c3d3e6;
}
.biblio-card__link a:hover { border-bottom-color: #1f4b85; }

/* Пометка рекламы. Тише выходных данных по размеру, но не по контрасту:
   прятать её нельзя ни цветом, ни кеглем — это требование к раскрытию,
   а не сноска. Поэтому цвет тот же, что у остальных служебных строк. */
.biblio-card__ad {
    margin: 0.3rem 0 0;
    font-family: var(--biblio-sans);
    font-size: 0.78rem;
    line-height: 1.45;
    color: var(--biblio-muted);
}

.biblio__more { margin-top: 0.5rem; }
.biblio__more-summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
    display: inline-block;
    font-family: var(--biblio-sans);
    font-size: 0.82rem;
    font-weight: 600;
    color: #1f4b85;
}
.biblio__more-summary::-webkit-details-marker { display: none; }
.biblio__more-summary:hover { text-decoration: underline; }
.biblio__more[open] .biblio__more-summary { margin-bottom: 0.25rem; }

@media (max-width: 600px) {
    .biblio { padding: 0.35rem 0.9rem 0.9rem; }
    .biblio__title { font-size: 17px; }
    /* Счётчик уезжает на вторую строку грида, а не прячется: у закрытого
       раздела на нём висит подсказка «показать», и без неё на мобильном
       свёрнутый подраздел снова выглядел бы нерабочим заголовком.
       Вторая колонка — чтобы он встал под текстом заголовка, а не под стрелкой. */
    .biblio__summary { grid-template-columns: auto 1fr; }
    .biblio__count {
        grid-column: 2;
        justify-self: start;
        margin-top: 0.15rem;
    }
}
