/* ===========================
   STORY DETAIL LAYOUT
=========================== */
.story-detail-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
}

/* Обложка истории */
.story-cover-top {
    width: 100%;
    max-width: 1400px;
    margin-bottom: 20px;
}

.story-cover-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    object-fit: cover;
}

/* STORY LAYOUT */
.story-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap; /* чтобы на мобильных не уходило за пределы */
}

/* Основной контент */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 700px;
    box-sizing: border-box;
}

/* Текст статьи */
.story-content-text {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.6;
}

.story-content-text p {
    margin: 0 0 1em 0;
    padding: 0;
}

.story-content-text img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em 0;
    border-radius: 12px;
}

/* Метаданные */
.bio-meta-wrapper {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    background-color: #f7f7f7;
    color: #555;
    font-size: 0.9em;
    padding: 6px 12px;
    border-radius: 6px;
    margin: 10px 0;
}

.reading-time {
    font-style: italic;
    color: #666;
}

/* Навигация */
.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: 6px;
    text-decoration: none;
    font-size: 14px;
}

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

.spacer {
    flex-grow: 1;
}

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

.toc h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: #1f4b85;
}

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

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

.toc li a {
    color: #1f4b85;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.2s, font-weight 0.2s;
}

.toc li a:hover,
.toc li a:focus {
    color: #003580;
    font-weight: 600;
}

/* ===========================
   Адаптив
=========================== */
@media (max-width: 1024px) {
    .story-layout {
        gap: 20px;
    }

    .toc {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .story-layout {
        flex-direction: column-reverse; /* TOC под контентом */
    }

    .toc {
        width: 100%;
        margin-top: 20px;
        position: relative;
        top: auto;
    }
}

@media (max-width: 480px) {
    .bio-meta-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        font-size: 0.85em;
        padding: 5px 10px;
    }

    .prev-btn,
    .next-btn {
        width: 100%;
        text-align: center;
    }
}
/* story-detail.css */

/* Основные стили для статьи */
.story-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-size: 18px;
    line-height: 1.6;
    text-align: left;
}

/* Заголовок */
.story-detail h1 {
    font-size: 28px;
    margin-bottom: 20px;
}

/* Подзаголовки */
.story-detail h2 {
    font-size: 22px;
    margin-top: 20px;
    margin-bottom: 10px;
}

/* === Увеличить только текст статьи на маленьких экранах === */
@media (max-width: 768px) {
  .story-content-text p,
  .story-content-text li,
  .story-content-text blockquote,
  .story-content-text a {
    font-size: 1.05em;   /* чуть крупнее */
    line-height: 1.7;
  }
}

@media (max-width: 480px) {
  .story-content-text p,
  .story-content-text li,
  .story-content-text blockquote,
  .story-content-text a {
    font-size: 1.15em;   /* ещё немного крупнее */
    line-height: 1.75;
  }
}
