/* Базовые стили */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    font-weight: 300;

    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Запрет прокрутки при открытом бургер-меню */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

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

/* Шапка */
.site-header {
    background: #293844;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.site-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    z-index: -1;
}

.header-right-group {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-shrink: 0;
}

.header-contacts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    color: white;
    font-size: 0.9rem;
    margin-right: 15px;
}

.header-hours {
    white-space: nowrap;
    font-weight: 500;
}

.header-email {
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.header-email:hover {
    color: #e67e22;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-phones {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.header-phone {
    color: white;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease;
    font-size: 0.95em;
}

.header-phone:hover {
    color: #e67e22;
}

.logo img {
    height: 90px;
    width: auto;
    transition: all 0.3s;
}

.help-button {
    background: #e67e22;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    margin-left: 0;
    order: 2;
    cursor: pointer;
    border-radius: 25px;
    font-size: 1rem;
    transition: background 0.3s ease;
}

.help-button:hover {
    background: #d35400;
}

main {
    flex: 1 0 auto;
    padding: 20px 0;
}

.main-nav {
    display: flex;
}

.main-nav ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 20px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: #e67e22;
}

.main-nav li {
    position: relative;
}

.main-nav .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: -20px;
    background: #2c3e50;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.main-nav li:hover .dropdown {
    display: block;
}

.main-nav .dropdown li {
    padding: 0.5rem 1rem;
}

.main-nav .dropdown a {
    color: white !important;
    font-size: 1rem;
    z-index: 1000;
    min-width: auto;
    padding: 0.5rem 1.5rem;
    white-space: nowrap;
}

.main-nav .dropdown a:hover {
    color: #e67e22 !important;
}

/* Бургер меню */
.burger-menu {
    display: none;
}

.burger-checkbox {
    position: absolute;
    visibility: hidden;
}

.burger {
    position: relative;
    z-index: 1;
    cursor: pointer;
    display: block;
    border: none;
    background: transparent;
    width: 30px;
    height: 24px;
}

.burger::before,
.burger::after {
    content: '';
    left: 0;
    position: absolute;
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    transition: all 0.3s ease;
    transform-origin: center;
}

.burger span {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
    transform-origin: center;
    top: 50%;
    transform: translateY(-50%);
}

.burger::before {
    top: 0;
    transform: translateY(0);
}

.burger::after {
    bottom: 0;
    transform: translateY(0);
}

.burger-checkbox:checked + .burger::before {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.burger-checkbox:checked + .burger::after {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

.burger-checkbox:checked + .burger span {
    opacity: 0;
}

.burger-checkbox:checked ~ .mobile-menu {
    top: 100%; 
    position: absolute;
    width: 100%;
    left: 0;
}

.burger:hover::before,
.burger:hover::after {
    background: #e67e22;
}

.burger:hover span {
    background: #e67e22 !important;
}

/* Основной контент */
.news-item {
    display: flex;
    flex-direction: row;
    margin: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    background: white;
}

.news-link {
    display: flex;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.news-image {
    flex: 0 0 40%;
    max-width: 400px;
    position: relative;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-content h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.news-content p {
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-content time {
    margin-top: 1rem;
    display: block;
    color: #666;
    font-size: 0.9em;
}

/* Добавляем кнопку "Читать далее" */
.read-more {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: #e67e22;
    color: white;
    border-radius: 25px;
    text-decoration: none;
    text-align: center;
    transition: background 0.3s ease;
    align-self: flex-start;
}

.read-more:hover {
    background: #d35400;
}

/* Эффекты при наведении */
.news-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

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

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

.all-news .news-item {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.news-filter {
    margin: 2rem 0;
    max-width: 600px;
}

#search-news {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

#filter-date {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.pagination {
    margin-top: 2rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 4px;
}

.pagination button.active {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

/* Подвал */
.site-footer {
    background: #293844;
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer {
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-left {
    text-align: left;
}

.footer-right {
    text-align: right;
}

.work-time {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.work-time span {
    font-size: 0.9em;
    color: #666;
}

.footer-copyright {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.footer-email {
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.footer-email:hover {
    color: #e67e22;
}

.footer-phone {
    color: white;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease;
    font-size: 0.95em;
}

.footer-phone:hover {
    color: #e67e22;
}

@media screen and (orientation: landscape) and (max-width: 1024px) {
    .header-contacts {
        display: none;
    }

    .main-nav a {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }

    .main-nav ul {
        gap: 10px;
    }

    .header-row {
        gap: 10px;
    }
}

@media (max-width: 768px) {

    .site-header {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .header-row {
        padding: 15px 0;
    }

    .header-right-group {
        order: 2;
    }
    
    .header-contacts {
        margin-right: 0.5rem;
    }

    .header-contacts,
    .header-phone {
        display: none;
    }

    .logo img {
        height: 70px;
    }

    .help-button {
        order: 1;
        margin-left: auto;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #293844;
        padding: 20px;
    }

    .main-nav li {
        padding: 0.5rem 0;
    }

    .main-nav.active {
        display: block;
        border-top-color: #405365;
    }
    
    .main-nav .dropdown {
        position: static;
        display: none;
        background: transparent;
        box-shadow: none;
        padding: 0 0 0 20px;
    }
    
    .main-nav .dropdown li {
        padding: 0;
    }

    .main-nav li:hover .dropdown {
        display: block;
    }

    .main-nav .dropdown a {
        padding: 12px 0;
        font-size: 1rem;
        color: #e67e22;
    }

    .main-nav > ul {
        flex-direction: column;
        gap: 0;
    }

    .main-nav > ul > li {
        width: 100%;
        border-bottom: 1px solid #405365;
    }
    
    .main-nav > ul > li > a {
        display: block;
        padding: 15px 0;
        font-size: 1.2rem;
    }

    .burger-menu {
        display: block;
        margin-left: 15px;
        order: 3;
    }

    .news-item {
        flex-direction: row;
        margin: 0.75rem;
    }
    
    .news-image {
        flex: 0 0 40%;
        max-width: 100%;
        height: auto;
    }
    
    .news-image img {
        width: 100%;
        height: auto;
    }
    
    .news-content {
        padding: 1rem;
    }
    
    .news-content h3 {
        font-size: 1rem;
    }
    
    .news-content p {
        font-size: 0.9rem; 
    }
    
    .read-more {
        padding: 0.5rem 1rem; 
        font-size: 0.9rem;
    }
    
    .footer-row {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-left,
    .footer-right {
        text-align: center;
        width: 100%;
    }
    
    .work-time {
        align-items: center;
    }

    .burger-checkbox:checked ~ .main-nav {
        display: block;
    }
}

@media (min-width: 769px) {
    .main-nav {
        display: flex !important;
    }
}