* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Цвета */
    --orange: #FF6B35;
    --blue: #4FC3F7;
    --gray-dark: #37474F;
    --gray-medium: #78909C;
    --gray-light: #ECEFF1;
    --gray-bg: #f8f9fa;
    --red: #FF5252;
    
    /* Размеры шрифтов */
    --font-size-h1: 34px;
    --font-size-slogan: 18px;
    --font-size-description: 14px;
    --font-size-contacts: 14px;
    --font-size-menu: 16px;
    
    /* Цвета текста */
    --description-color: #666;
}

body {
    font-family: 'Roboto', sans-serif;
    position: relative;
    overflow-x: hidden;
    background-color: var(--gray-bg);
    line-height: 1.6;
}

.header {
    background: white;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    position: relative;
    z-index: 10;
}

/* Подложка для верхней части шапки */
.top-header {
    display: flex;
    justify-content: space-between;
    padding: 15px 3%;
    border-bottom: 1px solid var(--gray-light);
    position: relative;
    z-index: 2;
    background-image: url('../images/logo/p_head.jpg');
    background-repeat: repeat-x;
    background-position: center top;
}

/* Затемнение для лучшей читаемости текста */
.top-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: -1;
}

/* Контакты теперь слева */
.contacts {
    display: flex;
    flex-direction: column;
    text-align: left;
    justify-content: center;
    flex: 1;
    max-width: 40%;
    gap: 3px; /* Минимальное расстояние между строками */
}

.flags-container {
    display: flex;
    justify-content: flex-start;
    gap: 6px;
    margin-bottom: 5px;
}

.flag {
    height: 30px;
    width: 30px;
    border-radius: 50%;
    border: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    object-fit: cover;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1px;
    justify-content: flex-start;
}

.contact-icon {
    width: 30px;
    height: 30px;
    background: var(--gray-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--orange);
    flex-shrink: 0;
}

.contact-text {
    font-size: var(--font-size-contacts);
    color: var(--gray-dark);
}

.contact-text strong {
    display: block;
    color: var(--orange);
    font-size: 16px;
}

/* Стили для активных ссылок контактов */
.contact-link {
    color: var(--orange);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--blue);
    text-decoration: underline;
}

/* Значки мессенджеров в десктопной версии - слева */
.messengers {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 8px;
    width: 100%;
}

.messenger-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-medium);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.messenger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.viber:hover { background: #7360F2; }
.whatsapp:hover { background: #25D366; }
.telegram:hover { background: #0088CC; }

/* Логотип и описание теперь справа */
.logo-container {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 60%;
    justify-content: flex-end;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    text-align: left;
}

.logo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin-right: 20px;
    object-fit: cover;
    border: 2px solid var(--gray-light);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-text {
    flex: 1;
    user-select: text;
}

.logo-text h1 {
    font-family: 'Exo 2', sans-serif;
    color: var(--gray-dark);
    font-size: var(--font-size-h1);
    margin-bottom: 5px;
}

.slogan {
    color: var(--orange);
    font-size: var(--font-size-slogan);
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.description {
    font-size: var(--font-size-description);
    color: var(--description-color);
    line-height: 1.4;
    max-width: 500px;
}

/* Стили для цветных тегов */
.color-tag-a1 {
    color: var(--orange);
    transition: color 0.3s ease;
    cursor: default;
}

.color-tag-a2 {
    color: var(--blue);
    transition: color 0.3s ease;
    cursor: default;
}

.color-tag-a3 {
    color: var(--gray-dark);
    transition: color 0.3s ease;
    cursor: default;
}

.color-tag-a4 {
    color: var(--red);
    transition: color 0.3s ease;
    cursor: default;
}

.color-tag-a1:hover {
    color: #e55a2b;
}

.color-tag-a2:hover {
    color: #3db4e8;
}

.color-tag-a3:hover {
    color: #2c3e50;
}

.color-tag-a4:hover {
    color: #e53935;
}

.bottom-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 3%;
    position: relative;
    z-index: 2;
    background-image: url('../images/logo/p_menu.jpg');
    background-repeat: repeat-x;
    background-position: center top;
}

/* Затемнение для меню */
.bottom-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(236, 239, 241, 0.9);
    z-index: -1;
}

.bottom-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1100px;
}

.nav-menu {
    display: flex;
    gap: 15px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--gray-dark);
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    font-size: var(--font-size-menu);
}

/* Убрана подсветка и добавлен эффект качания */
.nav-menu a:hover {
    color: var(--blue);
    animation: shake 0.5s ease-in-out;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--blue);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-menu a:hover::after {
    width: 80%;
}

/* Анимация качания для меню */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* Основной контент */
.main-content {
    min-height: 60vh;
    padding: 25px 3%;
}

.full-story {
    max-width: 1100px;
    margin: 0 auto;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.full-story h1 {
    color: var(--gray-dark);
    margin-bottom: 15px;
    font-family: 'Exo 2', sans-serif;
}

.story-content {
    line-height: 1.7;
    color: var(--gray-dark);
}

.news-list {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    gap: 15px;
}

.news-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

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

.news-item h2 {
    margin-bottom: 10px;
}

.news-item h2 a {
    color: var(--gray-dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-item h2 a:hover {
    color: var(--orange);
}

/* Стили для ориентации мобильных устройств */
@media (max-width: 768px) and (orientation: portrait) {
    .top-header {
        flex-direction: column;
        gap: 15px;
        padding: 10px 2%;
    }
    
    .contacts {
        max-width: 100%;
        text-align: center;
        order: 2;
        gap: 5px;
        width: 100%;
    }
    
    .flags-container {
        justify-content: center;
        margin-bottom: 5px;
    }
    
    .logo-container {
        max-width: 100%;
        text-align: center;
        order: 1;
        justify-content: center;
        width: 100%;
    }
    
    .logo-link {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        margin-right: 0;
        margin-bottom: 10px;
        width: 80px;
        height: 80px;
    }
    
    .logo-text h1 {
        font-size: 22px;
    }
    
    .contact-item {
        justify-content: center;
    }
    
    .contact-text {
        font-size: 13px;
    }
    
    .contact-text strong {
        font-size: 14px;
    }
    
    /* Значки мессенджеров в мобильной версии - по центру */
    .messengers {
        justify-content: center;
        gap: 10px;
        margin-top: 8px;
    }
    
    /* Статическое меню в мобильной версии */
    .bottom-header {
        padding: 8px 2%;
    }
    
    .nav-menu {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        width: 100%;
    }
    
    .nav-menu a {
        padding: 6px 10px;
        font-size: 14px;
        border-radius: 15px;
    }
    
    .contacts {
        gap: 4px;
        margin-bottom: 8px;
    }
    
    .flags-container {
        margin-bottom: 5px;
    }
    
    .logo-text h1 {
        font-size: 20px;
    }
    
    .slogan {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .description {
        font-size: 12px;
        text-align: center;
        line-height: 1.3;
    }
    
    .bottom-header-content {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .messenger-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .main-content {
        padding: 15px 2%;
    }
    
    .full-story {
        padding: 15px;
    }
}

/* Альбомная ориентация мобильных устройств - показываем десктопную версию */
@media (max-width: 768px) and (orientation: landscape) {
    .top-header {
        flex-direction: row !important;
        justify-content: space-between !important;
        padding: 10px 2% !important;
    }
    
    .contacts {
        max-width: 45% !important;
        text-align: left !important;
        order: 1 !important;
        justify-content: flex-start !important;
        gap: 3px !important;
    }
    
    .flags-container {
        justify-content: flex-start !important;
    }
    
    .logo-container {
        max-width: 55% !important;
        text-align: right !important;
        order: 2 !important;
        justify-content: flex-end !important;
    }
    
    .logo-link {
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
    }
    
    .logo {
        margin-right: 15px !important;
        margin-bottom: 0 !important;
        width: 70px !important;
        height: 70px !important;
    }
    
    .logo-text h1 {
        font-size: 18px !important;
    }
    
    .slogan {
        font-size: 14px !important;
    }
    
    .description {
        font-size: 11px !important;
    }
    
    /* В альбомной ориентации мессенджеры тоже слева */
    .messengers {
        justify-content: flex-start !important;
    }
    
    .nav-menu {
        display: flex !important;
        position: static !important;
        flex-direction: row !important;
        gap: 10px !important;
        background: transparent !important;
        box-shadow: none !important;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-menu a {
        padding: 5px 10px !important;
        border-radius: 15px !important;
        border-bottom: none !important;
        font-size: 14px !important;
    }
    
    .nav-menu a::after {
        display: block !important;
    }
    
    .nav-menu a:hover {
        background: transparent !important;
        color: var(--blue) !important;
        animation: shake 0.5s ease-in-out !important;
    }
}

/* Адаптивность для мобильных устройств (общие стили) */
@media (max-width: 992px) {
    .description {
        font-size: 13px;
    }
    
    .logo {
        width: 150px;
        height: 150px;
    }
    
    .logo-text h1 {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .top-header {
        padding: 8px 2%;
    }
    
    .logo {
        width: 70px;
        height: 70px;
        margin-bottom: 8px;
    }
    
    .logo-text h1 {
        font-size: 18px;
    }
    
    .slogan {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .description {
        font-size: 11px;
        line-height: 1.3;
    }
    
    .contact-text {
        font-size: 11px;
    }
    
    .contact-text strong {
        font-size: 12px;
    }
    
    .contact-icon {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
    
    .flag {
        height: 25px;
        width: 25px;
    }
    
    /* В мобильной версии логотип справа от текста */
    .logo-link {
        flex-direction: row-reverse;
        align-items: flex-start;
        text-align: left;
        gap: 10px;
    }
    
    .logo {
        margin-right: 0;
        margin-left: 10px;
        margin-bottom: 0;
    }
    
    .logo-text {
        flex: 1;
    }
    
    .contacts {
        gap: 3px;
        margin-bottom: 6px;
    }
    
    .flags-container {
        margin-bottom: 4px;
        gap: 5px;
    }
    
    .contact-item {
        gap: 4px;
    }
    
    .messengers {
        gap: 8px;
    }
    
    .messenger-btn {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    
    .main-content {
        padding: 10px 2%;
    }
    
    .full-story {
        padding: 10px;
    }
    
    .nav-menu a {
        padding: 5px 8px;
        font-size: 13px;
    }
}

/* Стили для футера */
footer {
    background-color: var(--gray-bg);
    color: var(--gray-dark);
    padding: 20px 0 15px;
    text-align: center;
    border-top: 1px solid var(--gray-light);
    font-size: 14px;
    margin-top: 30px;
    position: relative;
    font-family: 'Georgia', 'Times New Roman', serif;
    min-height: 160px;
    background-image: url('../images/logo/p_footer.jpg');
    background-repeat: repeat-x;
    background-position: center top;
}

/* Затемнение для лучшей читаемости текста в футере */
footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 249, 250, 0.9);
    z-index: 0;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3% 15px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    /* Убрана граница */
    border-bottom: none;
}

.footer-logo-container {
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 50%;
}

.footer-logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    text-align: left;
}

.footer-logo {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    border: 1px solid var(--gray-light);
    flex-shrink: 0;
}

.footer-logo-text {
    flex: 1;
}

.footer-logo-text h2 {
    font-family: 'Exo 2', sans-serif;
    color: var(--gray-dark);
    font-size: 18px; /* Увеличен с 14px */
    margin-bottom: 4px;
    line-height: 1.2;
}

.footer-slogan {
    color: var(--orange);
    font-size: 11px; /* Увеличен с 8px */
    font-weight: 500;
    display: block;
    line-height: 1.2;
}

.footer-info {
    flex: 1;
    max-width: 50%;
    text-align: right;
}

.footer-info p {
    margin-bottom: 5px;
    line-height: 1.3;
    color: var(--gray-dark);
    font-size: 14px; /* Увеличен с 11px */
}

.footer-info a {
    color: var(--orange);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-info a:hover {
    color: var(--blue);
    text-decoration: underline;
}

.container {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 10px;
    position: relative;
    z-index: 1;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 5px;
    position: relative;
    z-index: 1;
    /* Убрана верхняя граница и отступ */
    border-top: none;
    padding-top: 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--gray-medium);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 14px; /* Увеличен с 12px */
    white-space: nowrap;
}

/* Стиль для красной ссылки копирайта */
.copyright-link {
    color: var(--red) !important;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 14px; /* Увеличен с 12px */
    white-space: nowrap;
}

.copyright-link:hover {
    color: #e53935 !important;
    text-decoration: underline;
}

.seo-links {
    text-align: center;
    line-height: 1.4;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 12px; /* Увеличен с 11px */
}

.seo-links a {
    color: var(--gray-medium);
    text-decoration: none;
    margin: 0 4px;
    transition: color 0.3s;
    font-size: 12px; /* Увеличен с 11px */
    white-space: nowrap;
}

.seo-links a:hover {
    color: var(--orange);
    text-decoration: underline;
}

/* Скрытые SEO-ссылки для роботов */
.seo-navigation {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.seo-navigation a {
    color: var(--gray-dark);
    text-decoration: none;
    margin: 0 3px;
    font-size: 11px;
}

/* Адаптивность для футера */
@media (max-width: 768px) and (orientation: portrait) {
    footer {
        padding: 15px 0 10px;
        font-size: 12px;
        min-height: 140px;
    }
    
    .footer-top {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 0 2% 10px;
    }
    
    .footer-logo-container,
    .footer-info {
        max-width: 100%;
        text-align: center;
    }
    
    .footer-info {
        text-align: center;
    }
    
    .footer-logo {
        width: 60px;
        height: 60px;
        margin-right: 10px;
    }
    
    .footer-logo-text h2 {
        font-size: 16px; /* Увеличен для мобильной */
    }
    
    .footer-slogan {
        font-size: 10px; /* Увеличен для мобильной */
    }
    
    .footer-info p {
        font-size: 13px; /* Увеличен для мобильной */
        margin-bottom: 4px;
    }
    
    .footer-links {
        gap: 15px;
    }
    
    .footer-links a {
        font-size: 13px; /* Увеличен для мобильной */
    }
    
    .copyright-link {
        font-size: 13px; /* Увеличен для мобильной */
    }
    
    .seo-links {
        font-size: 11px; /* Увеличен для мобильной */
        line-height: 1.3;
    }
    
    .seo-links a {
        font-size: 11px; /* Увеличен для мобильной */
        margin: 0 3px;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    footer {
        padding: 15px 0 10px;
        font-size: 12px;
    }
    
    .footer-top {
        padding: 0 2% 10px;
    }
    
    .footer-logo {
        width: 55px;
        height: 55px;
    }
    
    .footer-logo-text h2 {
        font-size: 14px; /* Увеличен для альбомной */
    }
    
    .footer-slogan {
        font-size: 9px; /* Увеличен для альбомной */
    }
    
    .footer-info p {
        font-size: 12px; /* Увеличен для альбомной */
    }
    
    .footer-links {
        flex-direction: row;
        gap: 15px;
    }
    
    .footer-links a {
        font-size: 12px; /* Увеличен для альбомной */
    }
    
    .copyright-link {
        font-size: 12px; /* Увеличен для альбомной */
    }
    
    .seo-links {
        font-size: 11px; /* Увеличен для альбомной */
    }
    
    .seo-links a {
        font-size: 11px; /* Увеличен для альбомной */
    }
}

/* Десктопная версия футера */
@media (min-width: 769px) {
    .container {
        max-width: 1000px;
    }
    
    .footer-top {
        padding: 0 2% 15px;
    }
    
    .footer-logo {
        width: 75px;
        height: 75px;
    }
    
    .footer-logo-text h2 {
        font-size: 18px; /* Сохранено увеличение */
    }
    
    .footer-slogan {
        font-size: 11px; /* Сохранено увеличение */
    }
    
    .footer-info p {
        font-size: 14px; /* Сохранено увеличение */
        margin-bottom: 4px;
    }
    
    .footer-links {
        gap: 20px;
    }
    
    .footer-links a {
        font-size: 14px; /* Сохранено увеличение */
    }
    
    .seo-links {
        font-size: 12px; /* Сохранено увеличение */
    }
    
    .seo-links a {
        font-size: 12px; /* Сохранено увеличение */
    }
}