/* ==================== */
/* Базовые стили */
/* ==================== */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    line-height: 1.6;
    color: #333;
}

.container {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== */
/* Шапка и навигация */
/* ==================== */
.header {
    background: linear-gradient(135deg, #388E3C, #2E7D32);
    padding: 1rem 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    text-align: center;
    font-size: 3rem;
    font-family: 'Georgia', serif;
    color: #1B5E20;
    font-style: italic;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    margin-top: 2rem;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 0 1.5rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.7rem 1.2rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-link:hover, 
.nav-link.active {
    background-color: #1B5E20;
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ==================== */
/* Основные секции */
/* ==================== */
.hero {
    display: flex;
    align-items: center;
    padding: 2rem 5%;  
    background-color: #E8F5E9; 
    gap: 2rem;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 2rem;
}

.hero-image {
    width: 50%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    object-fit: cover;
}

.hero-text {
    flex: 1;
    min-width: 300px;
}

.hero-text h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.hero-text h2 {
    margin-top: 1.5rem;
    color: #2E7D32;
}

.hero-text ul {
    padding-left: 1.2rem;
    list-style-type: disc;
}

.hero-text blockquote {
    margin-top: 1.5rem;
    font-style: italic;
    color: #555;
    border-left: 4px solid #2E7D32;
    padding-left: 1rem;
}

section {
    margin-bottom: 3.5rem;
    padding: 1.5rem;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 12px rgba(46, 125, 50, 0.08);
    transition: transform 0.3s ease;
}

.section h2 {
    font-size: 1.8em;
    margin-bottom: 1em;
    border-bottom: 2px solid #6b8e23;
    padding-bottom: 0.3em;
    color: #2e5c00;
}

.section-title {
    margin-top: 1.5rem;
    font-size: 2rem;
    color: #2e5c00;
    text-align: center;
}

.section-description {
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.2rem;
    color: #444;
}

/* ==================== */
/* Карточки и сетки */
/* ==================== */
.news-section {
    padding: 3rem 5%;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.news-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-content {
    padding: 1.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1em;
}

.card {
    background-color: #f6fdf6;
    border: 1px solid #cce0cc;
    border-radius: 12px;
    padding: 1em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-3px);
}

.card h3 {
    margin-top: 0;
    color: #2e5c00;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background-color: #f6fdf6;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 соотношение */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* ==================== */
/* Кнопки и ссылки */
/* ==================== */
/* Общие стили для всех кнопок */
a.btn, .btn, button.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #2E7D32;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

a.btn:hover, .btn:hover, button.btn:hover {
    background-color: #2E7D32;
    filter: brightness(1.1);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.read-more {
    color: #2E7D32;
    text-decoration: none;
    font-weight: 600;
}

.edit-btn {
    display: inline-block;
    margin-bottom: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 5px;
}

.back-link {
    display: inline-block;
    margin-top: 2rem;
    text-decoration: none;
    color: white;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border: 1px solid #388E3C;
    border-radius: 6px;
    background-color: #388E3C;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.back-link:hover {
    background-color: #2C6B2F; 
    color: white; 
}

.card a {
    color: #33691e;
    font-weight: bold;
    text-decoration: none;
}

.card a:hover {
    text-decoration: underline;
}

/* ==================== */
/* Пагинация */
/* ==================== */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
    font-family: inherit;
}

.page-link {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    background-color: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.page-link:hover {
    background-color: #C8E6C9;
    color: #1B5E20;
}

.page-link.current {
    background-color: #2E7D32;
    color: white;
    font-weight: 600;
    cursor: default;
}

/* ==================== */
/* Страницы постов */
/* ==================== */
.post-page {
    padding: 3rem 5%;
    background-color: #f9f9f9;
}

.post-container {
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

.post-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #2E7D32;
    text-align: center;
}

.post-date {
    font-size: 0.9rem;
    color: #777;
    text-align: center;
    margin-bottom: 1.5rem;
}

.post-image-wrapper {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.post-image-wrapper img {
    width: 100%;
    max-width: 700px;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.post-image-wrapper img:hover {
    transform: scale(1.02);
}

.post-body {
    font-size: 1.2rem;
    line-height: 1.75;
    color: #333;
}

.post-content {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 40px;
    padding-left: 10%;
    padding-right: 10%;
}

/* ==================== */
/* Формы */
/* ==================== */
.form-card {
    max-width: 800px;
    margin: 3rem auto;
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.05);
}

.form-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2E7D32;
    margin-bottom: 1.5rem;
    text-align: center;
}

input[type="text"],
textarea,
input[type="file"] {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
textarea:focus,
input[type="file"]:focus {
    border-color: #2E7D32;
    box-shadow: 0 0 0 3px rgba(46,125,50,0.15);
    outline: none;
}

/* ==================== */
/* О нас и контакты */
/* ==================== */
.about-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.about-content {
    padding: 0 15px;
}

.about-text {
    line-height: 1.7;
    margin-bottom: 40px;
    font-size: 16px;
    color: #333;
    text-align: justify;
    padding: 0 10px;
}

.about-text p {
    margin-bottom: 20px;
    text-indent: 1.5em;
}

.about-content h3 {
    color: #2a6f3b;
    margin: 30px 0 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
    font-size: 22px;
}

.about-content ol, 
.about-content ul {
    margin-left: 30px;
    margin-bottom: 25px;
    padding-left: 15px;
}

.about-content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.contacts-section {
    background-color: #f5f9f5;
    padding: 30px;
    border-radius: 10px;
    margin: 40px 0;
    border-left: 5px solid #2a6f3b;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.contact-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.contact-card p {
    margin-bottom: 18px;
    font-size: 16px;
}

.contact-card i {
    color: #2a6f3b;
    margin-right: 12px;
    font-size: 18px;
}

/* ==================== */
/* Модальные окна */
/* ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    animation: fadeIn 0.3s;
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    max-height: 90vh;
    margin-top: 5vh;
    position: relative;
}

.close {
    position: absolute;
    top: -40px;
    right: -40px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

#viewerContent {
    width: 100%;
    height: 100%;
}

#viewerContent embed, 
#viewerContent iframe {
    width: 100%;
    height: 80vh;
    border: none;
}

#viewerContent img {
    max-width: 100%;
    max-height: 80vh;
    display: block;
    margin: 0 auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: zoomIn 0.3s;
}

@keyframes zoomIn {
    from { transform: translate(-50%, -50%) scale(0.9); }
    to { transform: translate(-50%, -50%) scale(1); }
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #111;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close:hover {
    color: #555;
}

/* ==================== */
/* Подвал */
/* ==================== */
.footer {
    text-align: center;
    padding: 1.5rem;
    background-color: #f5f5f5;
    margin-top: 2rem;
}

/* ==================== */
/* Видео блоки (десктопная версия) */
/* ==================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(560px, 1fr));
    gap: 20px;
}

.video-card {
    background-color: #f6fdf6;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 соотношение */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* ==================== */
/* Адаптивность */
/* ==================== */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-image {
        max-width: 100%;
        margin-top: 1.5rem;
    }
    
    .nav {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .post-container {
        flex-direction: column;
        text-align: center;
    }

    .about-section .container {
        padding: 0 15px;
    }
    
    .about-text {
        padding: 0;
        text-align: left;
    }
    
    .about-text p {
        text-indent: 1em;
    }
    
    .contacts-section {
        padding: 20px;
        margin: 30px 0;
    }
    
    .contact-card {
        grid-template-columns: 1fr;
    }

    .section {
        margin-bottom: 2.5rem !important;
        padding: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-description {
        font-size: 1rem;
    }

    .card-grid,
    .video-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .video-card {
        padding: 0.5rem;
    }
    
    .video-container {
        padding-bottom: 56.25%;
    }

    .btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-top: 0.75rem;
    }

    .modal-content {
        width: 95%;
        height: 90%;
        top: 5%;
        left: 2.5%;
        transform: none;
        padding: 0;
    }

    #viewerContent iframe,
    #viewerContent embed {
        height: 70vh;
    }

    .close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .about-content {
        padding: 0;
    }
    
    .about-content h3 {
        font-size: 20px;
    }
    
    .contact-card p {
        font-size: 15px;
    }

    .video-container {
        padding-bottom: 75%;
    }
    
    .video-card h3 {
        font-size: 1.1rem;
    }
}