/* ===== ПЕРЕМЕННЫЕ И БАЗОВЫЕ СТИЛИ ===== */
:root {
    --primary-color: #f9a4d9;
    --secondary-color: #fcd3ec;
    --accent-color: #fca8dc;
    --text-color: #3d0026;
    --link-color: #a20767;
    --hover-color: #ecb5d7;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    color: var(--text-color);
    background-color: #fdedf7;
    line-height: 1.6;
    overflow-x: hidden;
}

::selection {
    color: #2a1823;
    background-color: #e4a2cb7e;
}

/* ===== ТИПОГРАФИЯ И ФОРМЫ ===== */
h1, h2, h3 {
    margin: 1rem 0;
    line-height: 1.3;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

li {
    margin-bottom: 10px;
}

ul {
    padding-left: 2rem;
    padding-right: 2rem;
}

ul ul {
    padding-left: 2rem;
}

/* ===== ОСНОВНАЯ СЕТКА ===== */
.grid-container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header"
        "main"
        "footer";
    min-height: 100vh;
    gap: 20px;
    max-width: 100%;
}

.main-content {
    grid-area: main;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.content-container {
    grid-area: main;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== ШАПКА И НАВИГАЦИЯ ===== */
.header {
    background: linear-gradient(135deg, #f791d0, #ffc5eb);
    padding: 0.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    margin: 0;
    left: 0;
    right: 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0;
    padding: 0 15px;
    gap: 15px;
}

.header h1 {
    font-size: 1.3rem;
    margin: 0;
    text-align: center;
    flex: 1;
    min-width: 0;
}

.logo-link {
    flex-shrink: 0;
}

.logo-link img {
    width: 60px;
    height: 60px;
    transition: transform 0.3s ease;
}

.logo-link:hover img {
    transform: scale(1.1);
}

.header-nav {
    display: flex;
    gap: 10px;
}

.nav-wrapper {
    flex-shrink: 0;
    position: relative;
}

.nav-link {
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    white-space: nowrap;
    font-size: 0.9rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.5);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    height: 25px;
    justify-content: space-between;
}

.nav-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ===== ПОДВАЛ ===== */
.footer {
    grid-area: footer;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 1.5rem 15px;
    background-color: var(--primary-color);
    color: black;
    width: 100%;
    margin: 0;
    position: relative;
    left: 0;
    right: 0;
}

/* ===== ОБЩИЕ КОМПОНЕНТЫ ===== */
.common-text {
    padding: 1rem 0;
    margin: auto;
    max-width: 650px;
}

.fig {
    text-align: center;
    width: 100%;
    margin: 1rem 0;
}

.fig img {
    max-width: 300px;
    max-height: 300px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 6px;
}

.figdesign {
    display: block;
    margin: 0 auto 1rem;
    max-width: 100%;
    text-align: center;
}

.figdesign img {
    max-width: 250px;
    max-height: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.highlight-box {
    background-color: #fce4f1;
    border-left: 4px solid var(--accent-color);
    padding: 1.2rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 10px;
    display: block;
    margin: 1rem auto;
    border: 2px solid var(--accent-color);
}

/* ===== КОНТЕЙНЕРЫ ДИЗАЙНА ПЕРСОНАЖЕЙ ===== */
.design-container {
    display: block;
    margin: 1.5rem 0;
}

.figdesign-large {
    text-align: center;
    margin: 0 auto 1.5rem;
    max-width: 100%;
}

.figdesign-large img {
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.highlight-box-large {
    background-color: #fce4f1;
    color:#3d00267d;
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.1);
    flex: 1;
}

.highlight-box-large ul {
    margin: 0;
    padding-left: 1.2rem;
}

.highlight-box-large li {
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 1.05rem;
}

article {
    width: 100%;
    max-width: 650px;
    background-color: var(--secondary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    margin: 0 auto 20px;
    padding: 1.5em;
    overflow: hidden;
}

/* ===== СПИСОК ПЕРСОНАЖЕЙ ===== */
.characters-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, 150px);
    justify-content: center;
    gap: 16px;
    margin: 16px;
    padding: 16px;
    box-sizing: border-box;
}

.character-card {
    width: 150px;
    height: 170px;
    background-color: var(--secondary-color);
    padding: 10px;
    border: 3px solid var(--accent-color);
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.3s ease, 
                border-color 0.3s ease, 
                box-shadow 0.3s ease;
    box-sizing: border-box;
    overflow: hidden;
}

.character-card a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    width: 100%;
}

.character-card.ready-for-hover:hover {
    background-color: var(--hover-color);
    border-color: #d38bb7;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.character-card img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.character-card.ready-for-hover:hover img {
    transform: scale(1.1);
}

.character-card figcaption {
    font-size: 14px;
    line-height: 1.2;
    width: 100%;
    margin-top: auto;
    padding-top: 5px;
    overflow: hidden;
    display: block;
}

@media (max-width: 576px) {
    .characters-gallery {
        padding: 8px;
    }
}

@media (max-width: 400px) {
    .characters-gallery {
        grid-template-columns: repeat(2, 150px);
    }
}

 /* Для планшетов и мобильных устройств */
@media (max-width: 768px) {
    .characters-gallery {
        grid-template-columns: repeat(auto-fill, 120px);
        gap: 16px;
    }
    
    .character-card {
        width: 120px;
        height: 140px;
    }
    
    .character-card img {
        width: 80px;
        height: 80px;
    }
    
    .character-card figcaption {
        font-size: 12px;
    }
}

/* Для маленьких мобильных устройств */
@media (max-width: 480px) {
    .characters-gallery {
        grid-template-columns: repeat(2, 120px);
        gap: 16px;
        padding: 0 8px;
    }
}

/* ===== СТРАНИЦА НОВОСТЕЙ ===== */
.news-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.page-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 2rem;
}

.news-post {
    background-color: var(--secondary-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.post-title {
    margin: 0;
    font-size: 1.4rem;
    color: var(--text-color);
    flex: 1;
}

.post-date {
    color: #666;
    font-size: 0.9rem;
    white-space: nowrap;
}

.post-content {
    margin-bottom: 15px;
}

.post-content p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.post-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.post-content li {
    margin-bottom: 5px;
}

.post-image {
    margin: 15px 0;
    text-align: center;
}

.post-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    border: 2px solid var(--accent-color);
}

.post-full-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.4s ease-out;
    opacity: 0;
}

.post-full-content:not(.hidden) {
    max-height: 2000px;
    opacity: 1;
}

.post-full-content p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.post-full-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.read-more-btn {
    background: none;
    color: var(--link-color);
    border: none;
    padding: 5px 0;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 10px;
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.read-more-btn:hover {
    color: var(--primary-color);
    text-decoration-thickness: 2px;
}

.post-actions {
    display: flex;
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* ===== КНОПКА ЛАЙКА ===== */
.feedback-section {
    text-align: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #fce4f1;
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
}

.feedback-question {
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: rgb(255, 242, 253);
    border: 2px solid var(--accent-color);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    color: var(--text-color);
}

.like-btn:hover {
    background-color: var(--hover-color);
    transform: scale(1.05);
}

.like-btn.liked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.like-icon {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.like-btn.liked .like-icon {
    transform: scale(1.2);
}

.like-count {
    font-weight: bold;
    min-width: 20px;
}

/* ===== КНОПКА "ВВЕРХ" ===== */
.fixed-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
  }
  
.fixed-button {
    height: 50px;
    width: 50px;
    text-align: center;
    font: bold;
    font-family: Impact;
    font-size: large;
    justify-content: center;
    background-color: #bf40913a;
    color: rgba(255, 242, 251, 0.822);
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out;
}
  
.fixed-button:hover {
    background-color: #7427583a;
    transform: scale(1.1);
}

/* ===== УНИВЕРСАЛЬНАЯ СИСТЕМА АНИМАЦИЙ ===== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.4s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Фоновые персонажи */
.background-characters {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bg-character {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: all 1.5s ease-in-out;
    filter: drop-shadow(0 0 20px rgba(247, 145, 208, 0.3));
}

.bg-character-left {
    left: -300px;
    transform: translateY(-50%) scale(0.9);
}

.bg-character-right {
    right: -300px;
    transform: translateY(-50%) scale(0.9);
}

.bg-character.visible {
    opacity: 0.15;
}

.bg-character-left.visible {
    left: 5%;
    transform: translateY(-50%) scale(1.4);
}

.bg-character-right.visible {
    right: 5%;
    transform: translateY(-50%) scale(1.4);
}

.bg-character img {
    max-height: 70vh;
    width: auto;
    object-fit: contain;
}

/* ===== ГАЛЕРЕЯ ИЛЛЮСТРАЦИЙ ===== */
.gallery-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 15px;
}

.gallery-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
    font-size: 2.2rem;
}

.gallery-description {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    opacity: 0.8;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 0 auto;
}

.gallery-item {
    background: var(--secondary-color);
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-caption {
    padding: 12px 15px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-color);

}

.gallery-author {
    font-weight: 600;
    color: var(--link-color);
    display: block;
    margin-top: 4px;
}

/* Модальное окно для просмотра */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--secondary-color);
    position: relative;
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

.modal-caption {
    background: var(--secondary-color);
    padding: 15px 20px;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2001;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* ===== АДАПТИВНОСТЬ ===== */

/* Планшеты (768px - 1024px) */
@media (max-width: 1024px) {
    .header h1 {
        font-size: 1.1rem;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .highlight-box-large li {
        font-size: 1rem;
    }

    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
    ul {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .header-container {
        padding: 0 10px;
    }
    
    .logo-link img {
        width: 50px;
        height: 50px;
    }
    
    .header h1 {
        font-size: 1rem;
        text-align: left;
        margin-left: 10px;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: linear-gradient(135deg, #f791d0, #ffc5eb);
        flex-direction: column;
        gap: 8px;
        padding: 15px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
        border-radius: 10px;
        min-width: 180px;
        z-index: 1001;
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
    
    .header-nav.active {
        display: flex;
    }
    
    .nav-link {
        padding: 10px 16px;
        border-radius: 20px;
        text-align: center;
        background-color: rgba(255, 255, 255, 0.4);
    }
    
    .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.6);
        transform: translateY(-2px);
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    .news-page {
        padding: 10px;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .news-post {
        padding: 15px;
    }
    
    .post-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .post-title {
        font-size: 1.2rem;
    }
    
    .post-actions {
        justify-content: center;
    }
    
    .figdesign {
        float: right;
        margin-left: 1rem;
        max-width: 40%;
        margin-bottom: 1rem;
    }
    
    .figdesign img {
        max-width: 200px;
        max-height: 150px;
    }
    
    .fig img {
        max-width: 400px;
        max-height: 250px;
    }
    
    .main-content img {
        max-height: 350px;
    }
    
    article img {
        max-height: 280px;
    }
    
    video {
        max-height: 300px;
        border-radius: 8px;
    }
    
    .footer {
        grid-template-columns: 1fr 1fr;
    }

    .background-characters {
        display: none;
    }
    
    .animate-on-scroll {
        transform: translateY(20px);
    }

    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }
    
    .gallery-image {
        height: 200px;
    }
    
    .gallery-title {
        font-size: 1.8rem;
    }
}

/* Планшеты и десктопы (768px и выше) */
@media (min-width: 768px) {
    .design-container {
        display: flex;
        align-items: flex-start;
        gap: 2rem;
        margin: 2rem 0;
    }
    
    .figdesign-large {
        flex: 0 0 45%;
        margin: 0;
        max-width: 45%;
        text-align: left;
    }
    
    .figdesign-large img {
        max-width: 100%;
        max-height: 600px;
        width: 100%;
        height: auto;
    }
    
    .highlight-box-large {
        margin: 0;
        padding: 2rem;
        flex: 1;
    }
    
    .highlight-box-large li {
        font-size: 1.1rem;
    }
}

/* Большие экраны (1200px и выше) */
@media (min-width: 1200px) {
    .figdesign-large {
        flex: 0 0 40%;
        max-width: 40%;
    }
    
    .figdesign-large img {
        max-height: 700px;
    }
    
    .design-container {
        gap: 3rem;
    }

    .bg-character-left.visible {
        left: 2%;
    }
    
    .bg-character-right.visible {
        right: 2%;
    }
    
    .bg-character img {
        max-height: 60vh;
    }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 767px) {
    
    .design-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .figdesign-large {
        order: -1;
        margin: 0 auto;
        max-width: 100%;
    }
    
    .figdesign-large img {
        max-height: 400px;
        width: auto;
    }
    
    .highlight-box-large {
        margin: 0;
        padding: 1.2rem;
    }
    
    .highlight-box-large li {
        font-size: 1rem;
    }
}

/* Очень маленькие экраны (до 480px) */
@media (max-width: 480px) {
    
    .header h1 {
        font-size: 0.9rem;
    }
    
    .logo-link img {
        width: 45px;
        height: 45px;
    }
    
    .news-post {
        padding: 12px;
    }
    
    .post-title {
        font-size: 1.1rem;
    }
    
    .read-more-btn {
        width: 100%;
        padding: 12px;
    }
    
    .fixed-button {
        width: 45px;
        height: 45px;
        font-size: medium;
    }
    
    .fig img {
        max-width: 250px;
        max-height: 160px;
    }
    
    .figdesign img {
        max-width: 200px;
        max-height: 140px;
    }
    
    .main-content img {
        max-height: 220px;
    }
    
    .highlight-box, .highlight-box-large {
        padding: 0.8rem;
    }
    
    .figdesign-large img {
        max-height: 300px;
    }
    
    .highlight-box-large {
        padding: 1rem;
    }
    
    .highlight-box-large li {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    video {
        max-height: 250px;
        border-radius: 6px;
    }

    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .gallery-image {
        height: 180px;
    }
    
    .gallery-caption {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .modal-content {
        max-width: 95%;
        max-height: 95%;
    }
}

/* Специальные стили для GIF */
.fig img[src*="gif"] {
    max-height: 400px !important;
}

@media (min-width: 768px) {
    .fig img[src*="gif"] {
        max-height: 300px !important;
    }
}
