/* ==========================================================================
   Стили отдельной серии мультсериала (lily-episode.css)
   ========================================================================== */

.episode-page {
    padding-top: 40px;
    padding-bottom: 60px;
}

.episode-page .card {
    background: #fdfbf7;
    border: 1px solid #e8e2d8;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border-top: 4px solid var(--soft-green);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    overflow: hidden; /* Скрывает все, что вылезает за края */
    min-width: 0; /* Не дает карточке распираться из-за видео */
}

.episode-page h2 {
    margin-top: 0;
    margin-bottom: 15px;
}

/* --- Кнопка назад --- */
.back-link {
    display: inline-block;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.back-link:hover {
    color: var(--soft-green);
}

/* --- Стили для главного блока с видео (Episode Hero) --- */
.hero-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.series-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #7a8c92;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.age-badge-outline {
    border: 1px solid #c2c9cc;
    color: #4a5559;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.main-series-title {
    font-size: 2.2rem;
    color: var(--deep-blue);
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.episode-subtitle {
    font-size: 1.4rem;
    color: #4a5559;
    font-weight: 400;
    margin: 0 0 30px 0;
    line-height: 1.4;
}


.episode-hero .disclaimer-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: left;
    margin-top: 15px;
    margin-bottom: 0;
}

/* --- Видеоплеер (общие настройки) --- */
.episode-page .video-wrapper {
    width: 100% !important;
    text-align: center !important;
    margin-bottom: 20px !important;
    box-sizing: border-box;
}

.episode-page .video-container {
    display: inline-block !important;
    width: 100% !important;
    max-width: 800px !important; /* Принудительно фиксируем размер */
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    vertical-align: top;
}

.episode-page .video-container video {
    width: 100% !important;
    height: auto !important; 
    max-width: 100% !important;
    display: block;
}

/* --- Блок 4. Карточки персонажей --- */
.characters-section {
    margin-bottom: 40px;
}

.characters-section h2 {
    text-align: center;
    margin-bottom: 30px;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Создает ровно 4 колонки */
    gap: 24px;
    width: 100%; 
    max-width: 1000px; /* Ограничивает ширину, чтобы карточки не были гигантскими */
    margin: 0 auto; /* Центрирует весь блок */
}

.character-card {
    background: #fdfbf7;
    border: 1px solid #e8e2d8;
    border-radius: 10px;
    overflow: hidden;
    border-top: 4px solid var(--soft-green);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.character-image {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    display: block;
    background-color: #e8e2d8;
}

.character-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.character-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}

.strategy-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--soft-green);
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
}

.character-quote {
    font-style: italic;
    color: var(--deep-blue);
    margin: 0 0 15px 0;
    padding-left: 10px;
    border-left: 2px solid var(--soft-green);
    font-size: 0.95rem;
}

.character-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-dark);
}

/* --- Блок 5. Схема --- */
.scheme-flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
    background: var(--white);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e8e2d8;
}

.flow-step {
    background: var(--bg-light);
    border: 1px solid var(--soft-green);
    color: var(--deep-blue);
    padding: 12px 20px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}

.flow-arrow {
    color: var(--soft-green);
    font-size: 1.5rem;
    margin: 10px 0;
}

/* --- Блок 7. Кнопка возврата --- */
.secondary-btn {
    background-color: var(--soft-green);
    color: var(--white);
    border: 2px solid var(--soft-green);
    margin-top: 15px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.secondary-btn:hover {
    background-color: var(--deep-blue);
    color: var(--white);
    border-color: var(--deep-blue);
}

/* --- Стили для расписания серий (Блок 7) --- */
.schedule-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 25px 0;
    font-weight: 600;
    color: var(--deep-blue);
    font-size: 1.05rem;
}

.schedule-notice svg {
    color: var(--soft-green); /* Иконка будет в вашем фирменном зеленом цвете */
    flex-shrink: 0;
}

/* --- Блок 8. Контакты (Темный дизайн) --- */
.episode-page .custom-dark-promo {
    background-color: var(--deep-blue);
    border: none;
    border-top: none; /* Убирает зеленую полосу */
}

.episode-page .custom-dark-promo h2,
.episode-page .custom-dark-promo p {
    color: #ffffff;
}

.episode-page .custom-dark-promo p {
    margin-bottom: 25px;
    opacity: 0.9;
}

.promo-main-btn {
    display: block;
    width: 100%;
    background-color: #ffffff;
    color: var(--deep-blue);
    border: 2px solid var(--soft-green);
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 25px;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.promo-main-btn:hover {
    background-color: var(--soft-green);
    color: #ffffff;
}

.promo-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.promo-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.promo-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    transition: opacity 0.2s ease;
}

.promo-links a:hover {
    opacity: 0.7;
}

/* --- Блоки 9 и 10. Примечания --- */
.author-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: left;
    margin-bottom: 30px;
}

.important-info {
    background: #f0f4f2;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
}

.important-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-dark);
    line-height: 1.5;
}

/* ==========================================================================
   Адаптивность (Медиазапросы)
   ========================================================================== */

@media (max-width: 768px) {
    .episode-page .card {
        padding: 20px;
    }
       .scheme-flowchart {
        padding: 15px;
    }
    
    .characters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .main-series-title { 
        font-size: 1.8rem; 
    }
    
    .episode-subtitle { 
        font-size: 1.2rem; 
    }
    
    .characters-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}