/* Общие стили */
:root {
    --greek-blue: #0D5EAF; /* Классический синий цвет греческого флага */
    --white: #FFFFFF;
    --light-blue-bg: #F0F8FF; /* Очень светлый голубой для фона секций */
    --text-dark: #2c3e50;
    --text-light: #f8f9fa;
    --accent-blue: #3498db; /* Более яркий синий для акцентов */
}

body {
    font-family: 'Lato', 'Arial', sans-serif;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    background-color: var(--light-blue-bg);
    color: var(--text-dark);
    scroll-behavior: smooth;
}

.container {
    width: 85%;
    margin: auto;
    overflow: hidden;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    color: var(--greek-blue);
    font-family: 'Montserrat', sans-serif;
}

h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5em;
    position: relative;
    padding-bottom: 15px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-blue);
    border-radius: 2px;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    /* color: var(--greek-blue); */
}

ul {
    list-style: none;
    padding: 0;
}

section {
    padding: 60px 0;
}

/* Шапка (Header) */
header {
    background: var(--greek-blue);
    color: var(--white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header #logo p {
    margin: 0;
    font-size: 0.85em;
    color: #e0e0e0;
    font-style: italic;
}

header nav ul {
    margin: 0;
}
header nav ul li {
    display: inline;
    padding: 0 12px;
}
header nav a {
    color: var(--white);
    text-transform: uppercase;
    font-weight: 500;
    font-size: 0.9em;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: border-bottom-color 0.3s ease;
}
header nav a:hover, header nav a.active {
    border-bottom-color: var(--white);
}

/* Секция Hero (Главный экран) */
#hero {
    background: url('../images/greek_bg.png') no-repeat center center/cover;
    color: var(--white);
    min-height: 85vh;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
    overflow: hidden; /* Важно для анимации */
}

/* НОВЫЙ БЛОК: Оверлей с вырезанным морем */
#hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* ПРИМЕЧАНИЕ: для этого элемента требуется новое изображение (PNG с прозрачностью), 
       где область моря вырезана, чтобы было видно 3D-воду под ним. */
    background: url('../images/greek_bg_overlay.png') no-repeat center center/cover;
    z-index: 2;
    pointer-events: none; /* Позволяет кликам проходить сквозь оверлей к канвасу */
    display: none; 
}


/* Канвас для 3D сцены в шапке */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Помещаем под оверлей с картинкой */
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to right, /* Направление градиента: слева направо */
        rgba(13, 94, 175, 0.15),      /* 0%: Левый край (прозрачный) */
        rgba(13, 94, 175, 0.6) 35%,   /* 35%: Плавный переход к плотному цвету */
        rgba(13, 94, 175, 0.6) 65%,   /* 65%: Плотный цвет держится до этой точки */
        rgba(13, 94, 175, 0.15) 
    );
    z-index: 3; /* Помещаем над канвасом и оверлеем для тонировки */
    pointer-events: none; /* Градиент не должен блокировать контент */
}
#hero .container {
    position: relative;
    z-index: 4; /* Помещаем текст поверх всего */
}

#hero h2 {
    font-size: 3em;
    margin-bottom: 20px;
    color: var(--white);
    text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
    font-weight: 700;
}
#hero h2::after {
    display: none;
}

#hero p {
    font-size: 1.3em;
    margin-bottom: 35px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.cta-button {
    display: inline-block;
    background: var(--white);
    color: var(--greek-blue);
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    text-transform: uppercase;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.cta-button:hover {
    background-color: var(--accent-blue);
    color: var(--white);
    transform: translateY(-2px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-word-animate {
    opacity: 0; /* Изначально слова невидимы */
    animation: fadeInUp 0.5s ease-out forwards;
}

#menu-toggle {
    display: none; /* Скрыто на десктопах */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001; /* Поверх навигации */
}

#menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--white);
    margin: 5px 0;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#menu-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
#menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
#menu-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Секция "Обо мне" */
#about {
    background: var(--white);
}
.about-content {
    display: flex;
    gap: 40px;
    align-items: center;
}
.tutor-photo {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid var(--greek-blue);
    box-shadow: 0 0 20px rgba(13, 94, 175, 0.3);
    flex-shrink: 0;
}
#about .about-content div p, #about .about-content div ul {
    margin-bottom: 18px;
    font-size: 1.05em;
}
#about .about-content ul {
    list-style: none;
    padding-left: 0;
}
#about .about-content ul li {
    padding-left: 25px;
    position: relative;
    margin-bottom: 8px;
}
#about .about-content ul li::before {
    content: '+';
    position: absolute;
    left: 0;
    color: var(--greek-blue);
    font-weight: bold;
    font-size: 1.2em;
    line-height: 1;
}

/* Секция "Услуги" */
#services {
    background: var(--light-blue-bg);
}
.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.service-card {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    text-align: left;
    border-left: 5px solid var(--greek-blue);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}
.service-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
    color: var(--greek-blue);
}
.service-card p {
    font-size: 1em;
    margin-bottom: 10px;
}
.service-card strong {
    color: var(--greek-blue);
    font-weight: 600;
}

/* Секция "Отзывы" */
#testimonials {
    background: var(--white);
}
.testimonial-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}
.testimonial-card {
    background: var(--light-blue-bg);
    padding: 25px;
    border-radius: 10px;
    border-top: 5px solid var(--greek-blue);
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    position: relative;
}
.testimonial-card::before {
    content: '“';
    font-family: 'Georgia', serif;
    font-size: 4em;
    color: var(--accent-blue);
    opacity: 0.2;
    position: absolute;
    top: 5px;
    left: 15px;
    line-height: 1;
}
.testimonial-card p {
    font-style: italic;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    font-size: 1.05em;
}
.testimonial-card h4 {
    text-align: right;
    color: var(--text-dark);
    margin: 0;
    font-size: 1em;
    font-weight: 600;
}
.testimonial-card h4::before {
    display: none;
}

/* Секция "Контакты" */
#contact {
    background: var(--greek-blue);
    color: var(--text-light);
    text-align: center;
}
#contact h2 {
    color: var(--white);
}
#contact h2::after {
    background-color: var(--white);
}
#contact p {
    font-size: 1.15em;
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.contact-info p {
    margin-bottom: 12px;
    font-size: 1.1em;
}
.contact-info a {
    color: var(--white);
    font-weight: 500;
    border-bottom: 1px dotted var(--white);
    padding-bottom: 2px;
}
.contact-info a:hover {
    color: #e0e0e0;
    border-bottom-style: solid;
}

/* Подвал (Footer) */
footer {
    background: var(--text-dark);
    color: #a0a0a0;
    text-align: center;
    padding: 25px 0;
}
footer p {
    margin: 8px 0;
    font-size: 0.9em;
}

/* Виджет с Платоном */
#plato-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none; /* Не кликабельно, пока невидимо */
}

#plato-widget-container.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; /* Становится кликабельным */
}

#plato-canvas {
    width: 100px !important;
    height: 100px !important;
    cursor: grab;
}

#scroll-to-top {
    width: 50px;
    height: 50px;
    background-color: var(--greek-blue);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#scroll-to-top:hover {
    background-color: var(--accent-blue);
    transform: translateY(-2px);
}


/* Адаптивность (Media Queries) */
@media(max-width: 992px) {
    .container {
        width: 90%;
    }
    #hero h2 {
        font-size: 2.5em;
    }
    #hero p {
        font-size: 1.15em;
    }
}

@media(max-width: 768px) {
    header .container {
        justify-content: space-between;
        flex-direction: row;
    }
    
    #menu-toggle {
        display: block;
    }

    #main-nav {
        position: fixed;
        top: 83px; /* Высота шапки, подберите точно */
        right: 0;
        width: 100%;
        height: calc(100vh - 83px);
        background: rgba(13, 94, 175, 0.98); /* Полупрозрачный фон */
        backdrop-filter: blur(5px);
        display: flex; /* Для корректной работы flex-direction */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%); /* Скрываем за экраном */
        transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    }

    #main-nav.nav-open {
        transform: translateX(0); /* Показываем */
    }

    #main-nav ul {
        flex-direction: column;
        width: 100%;
        text-align: center;
    }

    #main-nav ul li {
        display: block;
        margin: 20px 0;
    }

    #main-nav a {
        font-size: 1.5em; /* Делаем ссылки крупнее */
        padding: 10px;
    }

    header nav a:hover, header nav a.active {
        border-bottom-color: transparent;
        background-color: rgba(255,255,255,0.1);
        border-radius: 4px;
    }

    #hero {
        min-height: 70vh;
    }
    #hero h2 {
        font-size: 2.2em;
    }
    #hero p {
        font-size: 1.1em;
    }
    .cta-button {
        font-size: 1em;
        padding: 12px 25px;
    }

    .about-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .tutor-photo {
        width: 200px;
        height: 200px;
        margin-bottom: 25px;
    }
    #about .about-content ul li {
      padding-left: 20px;
      text-align: left;
    }

    .service-cards, .testimonial-cards {
        grid-template-columns: 1fr;
    }

    h2 {
        font-size: 2em;
    }

    #plato-canvas {
        width: 80px !important;
        height: 80px !important;
    }
    #scroll-to-top {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

@media(max-width: 480px) {
    #hero {
        min-height: 60vh;
    }
    #hero h2 {
        font-size: 1.8em;
    }
    #hero p {
        font-size: 1em;
    }
    .container {
        width: 95%;
        padding: 0 10px;
    }
}

html, body {
    overflow-x: hidden;
}


#hero.hero-interactive {
    /* При наведении убираем основной фон, чтобы был виден канвас */
    background-image: none !important;
}

#hero.hero-interactive #hero-overlay {
    /* При наведении ПОКАЗЫВАЕМ оверлей с вырезом */
    display: block;
}

/* --- Стили для Энциклопедии --- */

/* Контейнер для страниц /pedia и /pedia/:slug */
.pedia-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
}

.pedia-container h1 {
    text-align: center;
    margin-bottom: 30px;
}

/* Ссылка "Назад" */
.pedia-back-link {
    display: inline-block;
    margin-bottom: 30px;
    color: var(--greek-blue);
    text-decoration: none;
    font-weight: 500;
}
.pedia-back-link:hover {
    text-decoration: underline;
}

/* Список постов на /pedia */
.pedia-list {
    list-style: none;
    padding: 0;
}

.pedia-list-item {
    margin-bottom: 20px;
    background-color: #f8f9fa;
    border-radius: 5px;
    transition: box-shadow 0.2s ease-in-out;
}
.pedia-list-item:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.pedia-list-item a {
    display: block;
    padding: 20px;
    text-decoration: none;
}

.pedia-list-item h3 {
    margin: 0;
    color: var(--greek-blue);
}

/* Страница одного поста /pedia/:slug */
.post-meta {
    color: #666;
    font-style: italic;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.post-tags {
    margin-bottom: 20px;
}
.post-tags strong {
    font-weight: 600;
}
.post-tag {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.9em;
    margin-left: 8px;
    white-space: nowrap;
}

.post-main-image {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 5px;
}

.post-content {
    line-height: 1.8; /* Улучшаем читаемость текста */
}

.post-content h1,
.post-content h2,
.post-content h3 {
    margin-top: 1.8em;
    margin-bottom: 0.8em;
}

.post-content p {
    margin-bottom: 1.2em;
}