* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #ffffff;
    color: #333;
}
header {
    background-color: #f0f0f0;
    padding: 20px;
    text-align: center;
}
header img {
    height: 60px;
    vertical-align: middle;
}
header h1 {
    display: inline-block;
    margin: 0 0 0 15px;
    font-size: 24px;
    vertical-align: middle;
}
nav {
    background-color: #004080;
    text-align: center;
    font-family: Arial, sans-serif;
    padding: 0;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.nav-menu li {
    position: relative;
}

.nav-menu > li > a {
    position: relative;
    display: block;
    padding: 14px 20px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;
}

.nav-menu > li > a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 8px;
    width: 100%;
    height: 3px;
    background-color: #ffcc00;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.nav-menu > li:hover > a::after {
    transform: scaleX(1);
}

.nav-menu > li > a:hover {
    background-color: #0073e6;
}

/* Подменю */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
    border-radius: 8px;
    z-index: 1000;
    list-style: none;
    margin: 0;

    /* Добавляем выравнивание */
    left: 0; /* ВАЖНО: прижимаем к левой стороне родителя */
    text-align: left; /* Выравнивание текста по левому краю */
}

.dropdown-content li {
    padding: 0;
}

.dropdown-content li a {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    color: #004080;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.dropdown-content li a::before {
    content: "\2022";
    color: #0073e6;
    font-size: 18px;
    margin-right: 8px;
}

.dropdown-content li a:hover {
    background-color: #f0f0f0;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    display: block;
}

.main-content {
    text-align: center;
    padding: 50px 20px;
}
.main-content h2 {
    font-size: 28px;
    margin-bottom: 20px;
}
.main-content p {
    font-size: 18px;
    margin-bottom: 30px;
}
.main-content img {
    max-width: 100%;
    height: auto;
}
.news-section {
    background-color: #f8f8f8;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.news-section h3 {
    text-align: center;
    margin-bottom: 20px;
}
.news-item {
    margin: 0;
    padding: 20px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.news-item span {
    display: block;
    font-weight: bold;
}
.news-item p {
    margin: 5px 0;
}
.news-item a {
    color: #004080;
    text-decoration: underline;
}
.news-button {
    text-align: center;
    margin-top: 20px;
}
.news-button a {
    background-color: #ffcc00;
    color: #000;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
}
footer {
    background-color: #004080;
    color: white;
    text-align: center;
    padding: 20px;
}
footer p {
    margin: 5px 0;
}

.logo {
    width: 150px;
    height: auto;
}

.energy-banner {
    width: 100%;
    max-width: 1240px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
}



.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    font-size: 16px;
    line-height: 1.6;
    text-align: left; /* ← вот это важно */
}

.main-content h2, .main-content h3, .main-content p {
    text-align: left; /* ← для заголовков и параграфов */
}

.page-content {
    text-align: left;
}


.page-content p {
    margin-bottom: 1em;
}

.article-body {
    font-size: 17px;
    line-height: 1.8;
    color: #1f2d3d;
}

.article-body h1,
.article-body h2,
.article-body h3 {
    margin-top: 1.2em;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

.article-body ul,
.article-body ol {
    margin: 0.8em 0 1em 1.4em;
}

.article-body a {
    color: #004080;
}

.description {
    font-style: italic;
    color: #555;
    margin-top: 10px;
    margin-bottom: 20px;
}

.file-download {
    background-color: #f8f8f8;
    padding: 15px;
    border-left: 4px solid #0073e6;
    margin-top: 30px;
}

.file-download a {
    text-decoration: none;
    font-weight: bold;
    color: #004080;
}

header.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 60px;

    background-image: url("../main/images/header-bg.png");
    background-repeat: no-repeat;
    background-size: 100% 100%; /* чтобы полностью заполняло */
    background-position: center;

    height: 200px;
    color: white;
}


.logo-title h1 {
    color: white;
    font-size: 45px;
}

.lang-switch {
    font-weight: bold;
    font-size: 14px;
    color: white;
}

.lang-switch a {
    margin-left: 10px;
    color: white;
    text-decoration: none;
}

.lang-switch button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-weight: bold;
    margin: 0 5px;
    font-size: 14px;
}
.lang-switch button:hover {
    text-decoration: underline;
}

/* Ссылка «Картограмма коррупции» */
.corruption-link-wrap {
    margin-left: 60px;
    margin-top: 30px;
}

.corruption-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.corruption-link-logo {
    height: 40px;
    margin-right: 10px;
    flex-shrink: 0;
}

.corruption-link-text {
    font-weight: bold;
    color: #000;
}

html {
    -webkit-text-size-adjust: 100%;
}

.page-content img,
.page-content video,
.main-content img,
.main-content video {
    max-width: 100%;
    height: auto;
}

/* Планшеты и узкие окна */
@media (max-width: 1024px) {
    header.header-flex {
        height: auto;
        min-height: 160px;
        padding: 24px 28px;
    }

    .logo-title h1,
    .header-title {
        font-size: clamp(1.25rem, 3.2vw, 2rem);
    }

    .nav-menu > li > a {
        padding: 12px 14px;
        font-size: 14px;
    }

    .dropdown-content {
        max-width: min(320px, calc(100vw - 24px));
    }

    .dropdown-content li a {
        word-break: break-word;
    }
}

/* Мобильные */
@media (max-width: 768px) {
    header.header-flex {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        min-height: 0;
        padding: 16px;
        background-size: cover;
    }

    .logo-title {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }

    .logo-title .logo {
        width: min(120px, 32vw);
        height: auto;
    }

    .logo-title h1,
    .header-title {
        font-size: clamp(1rem, 4.5vw, 1.35rem);
        line-height: 1.25;
        margin: 0;
    }

    .lang-switch {
        align-self: flex-end;
    }

    /* overflow-x: auto здесь обрезал бы выпадающие подменю — тач-клики «пропадали» */
    nav {
        position: relative;
        z-index: 100;
        overflow: visible;
        text-align: left;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: flex-start;
        width: 100%;
        min-width: 0;
        padding: 0 8px 8px;
        gap: 0;
    }

    .nav-menu > li > a {
        padding: 12px 10px;
        font-size: 13px;
        white-space: normal;
        touch-action: manipulation;
    }

    .dropdown-content {
        max-width: min(280px, calc(100vw - 20px));
        z-index: 1100;
    }

    .dropdown-content li a {
        touch-action: manipulation;
    }

    .corruption-link-wrap {
        margin-left: 16px;
        margin-right: 16px;
        margin-top: 20px;
    }

    .corruption-link {
        align-items: flex-start;
    }

    .main-content {
        padding: 24px 16px;
    }

    .article-body {
        font-size: 16px;
    }
}
