* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Times New Roman', serif;
    background-color: #fafafa;
    color: #1a1a1a;
    line-height: 1.6;
}

.container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: #ffffff;
    border-bottom: 2px solid #e0e0e0;
    padding: 20px 0;
    margin-bottom: 30px;
}

.header-content {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-top {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-container {
    flex-shrink: 0;
}

.logo {
    max-height: 80px;
    width: auto;
    display: block;
}

.header-text {
    flex-shrink: 0;
}

.header-image {
    flex: 2;
    text-align: right;
    height: 80px;
    overflow: hidden;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-width: 300px;
}

.header-bg-image {
    height: 100%;
    width: 100%;
    object-fit: cover;
    object-position: right center;
}

h1 {
    font-size: 26px;
    color: #8b7355;
    text-align: left;
    font-weight: normal;
    letter-spacing: 1px;
    margin-bottom: 5px;
    margin-top: 0;
}

.subtitle {
    text-align: left;
    color: #666;
    margin-bottom: 0;
    font-size: 16px;
    margin-top: 0;
}

.main-nav {
    margin-top: 20px;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
    background-color: #ffffff;
}

.menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    margin: 0;
    padding: 0;
}

.menu-item {
    position: relative;
    margin: 0;
}

.menu-item > a {
    display: block;
    padding: 10px 15px;
    color: #2c2c2c;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.3s ease;
    border-radius: 4px;
    line-height: 1.4;
}

.menu-item > a:hover {
    background-color: #f5f5f5;
    color: #8b7355;
}

.menu-item > a.active {
    background-color: #f5f5f5;
    color: #8b7355;
    font-weight: bold;
}

.submenu {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px 0;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.menu-item:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Позиционирование подменю для последних пунктов меню справа */
.menu-item:nth-last-child(-n+3) .submenu {
    left: auto;
    right: 0;
}

.submenu li {
    margin: 0;
    position: relative;
    padding-left: 0;
}

.submenu li::before {
    display: none;
}

.submenu a {
    display: block;
    padding: 10px 15px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    white-space: normal;
}

.submenu a:hover {
    background-color: #f5f5f5;
    color: #8b7355;
    padding-left: 20px;
}

.content {
    background-color: #ffffff;
    padding: 30px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.content-section h2 {
    font-size: 28px;
    color: #2c2c2c;
    margin-bottom: 20px;
    font-weight: normal;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.content-section p {
    margin-bottom: 15px;
    text-align: justify;
    font-size: 16px;
}

.content-section ul {
    margin-left: 30px;
    margin-bottom: 20px;
}

.content-section ul li {
    margin-bottom: 10px;
}

.content-section h3 {
    font-size: 24px;
    color: #2c2c2c;
    margin-top: 30px;
    margin-bottom: 20px;
    font-weight: normal;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.content-section h3:first-of-type {
    margin-top: 0;
}

/* Секции */
.articles-section,
.history-section,
.restored-section {
    margin-bottom: 40px;
}

/* История древлехранилищ */
.history-items {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
}

.history-item {
    display: flex;
    gap: 30px;
    align-items: center;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.history-item:nth-child(even) {
    flex-direction: row-reverse;
}

.history-content {
    flex: 1;
    min-width: 0;
}

.history-content h4 {
    font-size: 20px;
    color: #8b7355;
    margin-bottom: 10px;
    font-weight: normal;
}

.history-content p {
    margin-bottom: 15px;
    text-align: justify;
}

.history-link {
    color: #8b7355;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.history-link:hover {
    color: #6b5a45;
    text-decoration: underline;
}

.history-image {
    flex: 1;
    min-width: 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Одно большое изображение */
.history-image-single {
    height: 350px;
}

.history-image-single img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Компоновка из 3 изображений */
.history-image-grid {
    height: 350px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.image-grid-top {
    display: flex;
    gap: 8px;
    height: 50%;
}

.image-grid-top img {
    flex: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.image-grid-bottom {
    height: 50%;
}

.image-grid-bottom img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Галерея портфолио */
.portfolio-gallery {
    margin-top: 20px;
    overflow: hidden;
}

.gallery-scroll {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 0 20px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.gallery-scroll::-webkit-scrollbar {
    height: 8px;
}

.gallery-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.gallery-scroll::-webkit-scrollbar-thumb {
    background: #8b7355;
    border-radius: 4px;
}

.gallery-scroll::-webkit-scrollbar-thumb:hover {
    background: #6b5a45;
}

.portfolio-item {
    flex: 0 0 320px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.portfolio-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-item:hover .portfolio-image > img:first-child {
    opacity: 0;
}

.portfolio-item {
    cursor: pointer;
}

.portfolio-item h4 {
    padding: 15px;
    margin: 0;
    font-size: 18px;
    color: #2c2c2c;
    font-weight: normal;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

/* Модальное окно галереи */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    position: relative;
    background-color: #ffffff;
    margin: 2% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #aaa;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s ease;
}

.modal-close:hover,
.modal-close:focus {
    color: #8b7355;
}

.modal-title {
    font-size: 28px;
    color: #8b7355;
    margin-bottom: 25px;
    text-align: center;
    font-weight: normal;
}

.modal-gallery {
    position: relative;
    margin-bottom: 20px;
}

.gallery-main {
    width: 100%;
    height: 500px;
    overflow: hidden;
    background-color: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(139, 115, 85, 0.8);
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 24px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    z-index: 100;
}

.gallery-nav:hover {
    background-color: rgba(139, 115, 85, 1);
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
    padding: 10px 0;
}

.thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: #8b7355;
    opacity: 1;
}

.gallery-counter {
    text-align: center;
    color: #666;
    font-size: 16px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .history-item {
        flex-direction: column !important;
    }

    .history-item:nth-child(even) {
        flex-direction: column !important;
    }

    .history-image {
        flex: 1 1 100%;
        width: 100%;
        height: 250px !important;
    }

    .history-image-grid {
        height: 250px !important;
    }

    .image-grid-top {
        height: 48%;
    }

    .image-grid-bottom {
        height: 48%;
    }

    .portfolio-item {
        flex: 0 0 280px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 5% auto;
    }

    .gallery-main {
        height: 300px;
    }

    .gallery-nav {
        padding: 10px 15px;
        font-size: 18px;
    }

    .gallery-prev {
        left: 10px;
    }

    .gallery-next {
        right: 10px;
    }

    .thumbnail {
        width: 70px;
        height: 70px;
    }

    .modal-title {
        font-size: 22px;
    }
}

footer {
    background-color: #ffffff;
    border-top: 2px solid #e0e0e0;
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.contact-info {
    background-color: #f9f9f9;
    padding: 20px;
    border-left: 3px solid #8b7355;
    margin: 20px 0;
}

.contact-info h3 {
    margin-bottom: 10px;
    color: #2c2c2c;
}

.contact-info p {
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .menu {
        flex-direction: column;
        align-items: stretch;
    }

    .menu-item {
        width: 100%;
    }

    .submenu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-top: 1px solid #e0e0e0;
        margin-top: 0;
        padding-left: 20px;
    }

    .menu-item:hover .submenu {
        transform: none;
    }
}

/* Стили для страницы видео */
.video-grid {
    display: flex;
    gap: 30px;
    margin-top: 30px;
    width: 100%;
}

.video-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Соотношение сторон 16:9 */
    height: 0;
    overflow: hidden;
    background-color: #000;
    border-radius: 8px;
    margin-bottom: 20px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-column h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 22px;
    color: #2c2c2c;
    font-weight: normal;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.video-column p {
    margin-bottom: 0;
    text-align: justify;
    font-size: 16px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .video-grid {
        flex-direction: column;
        gap: 40px;
    }
    
    .video-column {
        width: 100%;
    }
}

/* Стили для страницы новостей */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 30px;
    width: 100%;
}

.news-item {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.news-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.news-image-link {
    display: block;
    width: 100%;
    overflow: hidden;
    text-decoration: none;
}

.news-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-item:hover .news-image {
    transform: scale(1.05);
}

.news-title {
    font-size: 20px;
    color: #2c2c2c;
    margin: 20px 20px 10px 20px;
    font-weight: normal;
    line-height: 1.4;
}

.news-date {
    font-size: 14px;
    color: #999999;
    margin: 0 20px 20px 20px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .news-image {
        height: 200px;
    }
}

