:root {
    --background-color: #0d0b0c;
    --text-color: #ffe6dc;
    --headers: #a31941;
    --sec-header: #ffb86b;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 17px;
    text-align: left;
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease, background-color 0.3s ease;
}

a:hover {
    color: var(--sec-header);
}

ul, li {
    list-style: none;
    margin: 0;
    padding: 0;
}

h1, h2, h3, p {
    margin: 5px;
    padding: 5px;
}

h1 {
    font-size: 19px;
    padding: 10px;
}

h2 {
    font-size: 18px;
    padding: 3px 6px;
    text-align: center;
}

h3 {
    font-size: 17px;
    text-align: center;
}

header {
    background-color: var(--headers);
    width: 100%;
    display: flex;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
}

.head {
    max-width: 1500px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 10px;
    position: relative;
}

.column {
    position: relative;
    width: auto;
}

.column.left {
    margin-right: auto;
}

.column.right {
    margin-left: auto;
}

.toggle-button {
    width: auto;
    height: 42px;
    padding: 8px 14px;
    background-color: var(--headers);
    border: none;
    cursor: pointer;
    color: var(--text-color);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-sections,
.toggle-categories {
    width: 42px;
    height: 42px;
    padding: 0;
    background-size: 22px;
    background-repeat: no-repeat;
    background-position: center;
}

.toggle-sections {
    background-image: url(/icon/openmenu.svg);
}

.toggle-sections.open {
    background-image: url(/icon/closemenu.svg);
}

.toggle-categories {
    background-image: url(/icon/cat_icon.svg);
}

.toggle-categories.open {
    background-image: url(/icon/closemenu.svg);
}

.logotype {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    width: 200px;
    height: 45px;
}

.logotype a {
    display: block;
    width: 100%;
    height: 100%;
    background: url(/icon/logo_as.webp) no-repeat center;
    background-size: contain;
}

.links {
    margin-top: 10px;
    display: none;
    list-style: none;
    padding: 10px;
    background-color: var(--sec-header);
    border: 1px solid var(--headers);
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    z-index: 10;
}

.column.right .links {
    left: auto;
    right: 0;
}

.links a {
    display: block;
    padding: 8px 10px;
    color: #000000;
    text-decoration: none;
    border-bottom: 1px solid var(--headers);
}

.links a:hover {
    background-color: var(--headers);
    color: #fff;
}

.external-links-full {
    width: 100%;
    background-color: var(--headers);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    box-sizing: border-box;
}

.external-links {
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.external-links a {
    font-size: 14px;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.external-links a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

main {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 10px;
}

.container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.h1-top-bar {
    box-shadow: 0 7px 20px -10px rgba(0, 0, 0, 1);
    margin: 10px 0;
    background-color: var(--sec-header);
    text-align: left;
    color: var(--background-color);
}

.description {
    background-color: var(--headers);
    color: var(--text-color);
    padding: 5px 0;
    margin: 5px 0;
    width: 100%;
    text-align: left;
}

.description a {
    text-decoration: underline;
}

article {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    width: 100%;
    margin: 15px;
}

figure.article {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.article {
    background-color: var(--headers);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article:hover {
    transform: translateY(-5px);
    box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.15);
    background-color: var(--sec-header);
}

.article a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.image-wrapper {
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-bottom: 1px solid var(--sec-header);
}

.article img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: opacity 0.4s ease, filter 0.4s ease;
    opacity: 0;
    filter: blur(10px);
}

.article img.lazyloaded {
    opacity: 1;
}

img.lazyloaded {
    filter: blur(0);
    opacity: 1;
}

figcaption {
    padding: 8px 12px;
    font-size: 14px;
}

.info {
    padding: 15px;
    text-align: center;
}

.h2 {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
    text-align: left;
}

.navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    padding: 0;
    margin: 10px 0;
}

.navigation a,
.navigation .current {
    display: inline-block;
    padding: 10px 15px;
    margin: 5px;
    color: var(--text-color);
    background-color: var(--headers);
    text-decoration: none;
    border-radius: 5px;
    border-bottom: 1px solid var(--sec-header);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.navigation .current {
    background-color: var(--sec-header);
    color: #fff;
}

.navigation a:hover {
    background-color: var(--sec-header);
    color: white;
}

footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    background-color: var(--headers);
    width: 100%;
    padding: 8px 0;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.4);
    margin-top: 8px;
}

footer a {
    text-decoration: underline;
}

@media (min-width: 769px) {
    .toggle-button {
        background: none !important;
        width: auto;
        height: auto;
        padding: 8px 14px;
        font-size: 16px;
    }

    .toggle-sections::before {
        content: 'Разделы';
    }

    .toggle-categories::before {
        content: 'Категории';
    }
}

@media (max-width: 1024px) {
    article {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .head {
        gap: 10px;
        padding: 8px;
    }

    .logotype {
        width: 160px;
        height: 40px;
    }

    .logotype a {
        background-size: contain;
    }

    .links {
        top: 100%;
        left: 0;
        width: 60%;
    }

    .column.right .links {
        left: auto;
        right: 0;
    }

    article {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .navigation {
        flex-direction: row;
        gap: 5px;
    }

    .navigation a, .navigation .current {
        flex: 1 1 auto;
        text-align: center;
        padding: 12px;
        display: block;
    }
}

@media (max-width: 480px) {
    article {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 360px) {
    .container {
        width: 100%;
    }
}