/* CSS Variables */
:root {
    --primary-bg: #FFF9E5; /* Теплый бежевый/кремовый */
    --primary-text: #333333; /* Темно-серый */
    --brand-green: #2C5F2D; /* Глубокий лесной зеленый */
    --accent-color: #FF8C61; /* Яркий коралловый/манговый */
    --font-headings: 'Nunito', sans-serif;
    --font-body: 'Roboto Flex', sans-serif;
}

/* General Styles */
body {
    font-family: var(--font-body);
    color: var(--primary-text);
    /* background-color: var(--primary-bg); -- Will be handled by sections */
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Background Changer */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* Behind everything */
    background-color: var(--brand-green); /* Fallback color */
}

.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 2.5s ease-in-out; /* Slower transition */
}

.bg-image.active {
    opacity: 0.7; /* Dimmed effect */
}

h1, h2, h3, h4 {
    font-family: var(--font-headings);
    color: var(--brand-green);
    font-weight: 800;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--brand-green);
}

/* Header */
.main-header {
    background: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 70px;
    width: auto;
    display: block;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--primary-text);
    font-weight: 500;
}

/* CTA Button */
.cta-button {
    background-color: var(--accent-color);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-family: var(--font-headings);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #e6734e;
    transform: translateY(-2px);
    color: #fff;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 120px 0; /* Increased padding */
    position: relative;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5); /* Add text shadow for readability */
}

.hero::after {
   display: none; /* remove the dark overlay */
}

.hero .container {
    position: relative;
    z-index: 2;
}


.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 0.25rem;
    color: #fff;
}

.hero p {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.hero .hero-subtitle {
    font-size: 2rem;
    font-family: var(--font-headings);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Sections */
section:not(.hero):not(.page-header) {
    padding: 40px;
    background-color: rgba(255, 249, 229, 0.9); /* var(--primary-bg) with transparency */
    border-radius: 20px;
    margin: 40px auto;
    max-width: 960px;
    will-change: transform; /* Optimization for parallax */
}

section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
}

/* Event Cards */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.event-card {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(44, 95, 45, 0.15);
}

.event-card h3 {
    margin-top: 0;
    font-size: 1.5rem;
}

.link-to-all {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-weight: 700;
}

/* Philosophy Section */
.features-grid {
    display: flex;
    justify-content: space-around;
    text-align: center;
    gap: 30px;
}

.feature h4 {
    font-size: 1.2rem;
}

/* Gallery Preview */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 250px);
    gap: 15px;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.gallery-item img:hover {
    transform: scale(1.05);
}

/* Remove old asymmetrical grid styles */

/* Gallery Carousel */
.gallery-carousel {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    display: block;
    height: 500px;
    object-fit: cover;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    color: var(--primary-text);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 50%;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.carousel-arrow:hover {
    background-color: #fff;
}

.carousel-arrow.prev {
    left: 15px;
}

.carousel-arrow.next {
    right: 15px;
}

/* Events Page */
.page-header {
    padding: 60px 0;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.page-header h1 {
    font-size: 3.5rem;
    color: #fff;
}

.event-item {
    display: flex;
    gap: 30px;
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
    align-items: flex-start;
}

.event-date {
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    font-family: var(--font-headings);
    font-weight: 700;
    flex-shrink: 0;
}

.event-date span {
    font-size: 2.5rem;
    display: block;
    line-height: 1;
}

.event-details h2 {
    margin-top: 0;
}

.event-meta {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 15px;
}

/* Gallery Page */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.album-card {
    display: block;
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.album-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(44, 95, 45, 0.2);
}

.album-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.album-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    color: #fff;
    padding: 40px 20px 20px;
}

.album-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    color: #fff;
}

/* Blog Page */
.post-card {
    display: flex;
    gap: 30px;
    background: #fff;
    border-radius: 15px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.07);
    overflow: hidden;
}

.post-card:nth-child(even) {
    flex-direction: row-reverse;
}

.post-image {
    flex: 0 0 40%;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-content {
    padding: 30px;
}

.post-content h2 {
    margin: 10px 0;
}

.post-content h2 a {
    color: var(--brand-green);
}

.post-meta {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 10px;
}

.read-more {
    font-weight: 700;
    font-family: var(--font-headings);
}

/* About Page */
.about-container {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-text {
    flex: 2; /* Takes up 2/3 of the space */
}

.about-visual {
    flex: 1; /* Takes up 1/3 of the space */
    text-align: center;
}

.about-visual img {
    max-width: 100%;
    opacity: 0.8;
}

.about-philosophy {
    text-align: left; /* Override centered text for this section */
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.team-member-card img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 5px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.team-member-card h3 {
    margin: 0;
}

/* Contacts Page */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    text-align: center;
    margin-bottom: 40px;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-family: var(--font-headings);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-family: var(--font-body);
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

.contact-form .cta-button {
    width: 100%;
    border: none;
    font-size: 1.1rem;
}

/* CTA Block */
.cta-block {
    background-color: #f8f5e8;
    text-align: center;
    border-radius: 20px;
}

/* Snail Trail Animation */
#snail-trail-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 100;
    width: 100%;
}

#trail-path {
    fill: none;
    stroke: var(--accent-color);
    stroke-width: 3px;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.6;
}

.cta-block .container {
    padding-top: 60px;
    padding-bottom: 60px;
}

/* Footer */
.main-footer {
    background: var(--brand-green);
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: 40px;
}

.main-footer a {
    color: #fff;
    margin: 0 10px;
}

.main-footer a:hover {
    color: var(--accent-color);
}

/* --- Responsive Styles --- */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    /* Full-width sections on mobile */
    section:not(.hero):not(.page-header) {
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Header & Burger Menu */
    .main-header .container {
        flex-direction: row; /* Revert to row for alignment */
        justify-content: space-between;
        align-items: center;
    }

    .main-nav {
        display: none; /* Hide nav by default */
        position: absolute;
        top: 90px; /* Position below header */
        left: 0;
        right: 0;
        background: #fff;
        padding: 20px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    .main-nav.active {
        display: block; /* Show when active */
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .main-header .cta-button {
        display: none; /* Hide CTA button in header on mobile */
    }

    .burger-menu {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 30px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1010;
    }

    .burger-menu span {
        width: 30px;
        height: 3px;
        background: var(--brand-green);
        border-radius: 10px;
        transition: all 0.3s linear;
        position: relative;
        transform-origin: 1px;
    }

    .burger-menu.active span:nth-child(1) {
        transform: rotate(45deg);
    }
    .burger-menu.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(20px);
    }
    .burger-menu.active span:nth-child(3) {
        transform: rotate(-45deg);
    }


    /* Typography */
    .hero h1 {
        font-size: 2.8rem;
    }

    .hero .hero-subtitle {
        font-size: 1.5rem;
    }

    section h2, .page-header h1 {
        font-size: 2.2rem;
    }

    /* Layouts */
    .events-grid, .albums-grid, .team-grid, .contact-grid {
        grid-template-columns: 1fr;
    }

    .about-container {
        flex-direction: column;
    }

    .post-card {
        flex-direction: column;
    }

    .post-card:nth-child(even) {
        flex-direction: column;
    }

    .features-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .event-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Carousel */
    .carousel-slide img {
        height: 300px;
    }
}
