/* 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;
}

.next-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #587ca1;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

.next-btn:hover {
    background-color: #3c486b;
}

.story-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    flex-wrap: wrap;
    gap: 10px;
}

.prev-btn,
.next-btn {
    padding: 8px 16px;
    background-color: #2c3e80;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
}

.prev-btn:hover,
.next-btn:hover {
    background-color: #1d2d5a;
}

.spacer {
    flex-grow: 1;
}

.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;
    }
}
/* Кнопки поделиться */
.biography-detail .share-buttons {
    margin-top: 40px; /* больше отступ */
    padding-top: 15px;
    border-top: 1px solid #dce1eb; /* линия цвета breadcrumbs */
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
}

.biography-detail .share-buttons a,
.biography-detail .copy-link-btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 12px;
    background: #e8eadb; /* чуть темнее бежевого */
    color: #003580; /* темно-синий текст */
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.biography-detail .share-buttons a:hover,
.biography-detail .copy-link-btn:hover {
    background: #1ea9b3; /* бирюзовый как в цитатах */
    color: white !important;
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .biography-detail .share-buttons {
        gap: 8px !important;
        flex-wrap: nowrap !important;
    }
    
    .biography-detail .share-buttons a,
    .biography-detail .copy-link-btn {
        padding: 6px 10px !important;
        font-size: 0.8rem !important;
    }
}
.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;
}

/* ====== «Читайте также» ====== */
/* Перебиваем глобальные стили aside из base-layout.css/responsive.css */
.read-also {
    width: 100% !important;
    max-width: 100%;
    margin-top: 40px;
    padding: 24px 0 0;
    background: transparent;
    border: none;
    border-top: 1px solid #dce1eb;
    box-sizing: border-box;
    order: initial;
}

.read-also__title {
    font-size: 22px;
    margin: 0 0 18px;
    color: #3c486b;
}

.read-also__grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.read-also__card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e3e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.read-also__card:hover {
    box-shadow: 0 4px 14px rgba(60, 72, 107, 0.12);
    transform: translateY(-2px);
}

.read-also__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.read-also__thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f3f8;
}

.read-also__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.read-also__card:hover .read-also__thumb img {
    transform: scale(1.04);
}

.read-also__heading {
    font-size: 16px;
    line-height: 1.35;
    margin: 12px 14px 6px;
    color: #1f4b85;
    font-weight: 600;
}

.read-also__meta {
    font-size: 13px;
    color: #667688;
    margin: 0 14px 14px;
}

/* Планшет — 2 колонки */
@media (max-width: 768px) {
    .read-also__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .read-also__title {
        font-size: 20px;
    }
}

/* Мобильный — 1 колонка */
@media (max-width: 480px) {
    .read-also__grid {
        grid-template-columns: 1fr;
    }

    .read-also__heading {
        font-size: 17px;
    }
}

/* ====== Мобильный 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;
    }
}