:root {
    --light: #fff;
    --dark: #003092;
    --colored: #dfaa4e;
    --paraColor: #74828f;
    --textColor: #183B4E;
    --primaryColor: #007bff;

    --add-color: hsl(38, 61%, 30%);

    --header-height: 3.5rem;
    --max-width: 700px;
    --max-container-width: 1200px;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
}

body {
    height: 100vh;
    background: none;
}


li {
    list-style: none;
    text-decoration: none;
}

a {
    text-decoration: none;
    color: var(--light);
    font-size: 1rem;
}

a:hover {
    color: var(--colored);
}

h1 {
    color: var(--colored);
    text-align: center;
    font-size: 3rem;
    margin-bottom: 3rem;
}

h2 {
    color: var(--dark);
    text-align: center;
    font-size: 1.5rem;
    margin: 1rem;
    font-weight: 400;
}

h3 {
    color: var(--paraColor);
    text-align: center;
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

h4 {
    color: var(--textColor);
    text-align: center;
    font-size: 0.8rem;
    font-weight: 300;
}

p {
    max-width: 700px;
    line-height: 1.5;
    color: var(--textColor);
    font-size: 1rem;
}

/*=============== HEADER & NAV ===============*/
header {
    height: calc(var(--header-height) + 1.5rem);
    padding-bottom: 3rem;
}

.header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    background-color: transparent;

}

.header .nav-container {
    max-width: var(--max-container-width);
    margin: 0 auto;
    padding: 3rem 5rem;
}

.nav {
    max-width: var(--max-container-width);
    margin: 0 auto;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav__logo,
.nav__logo span {
    font-size: 2rem;
    font-weight: 700;
    transition: .4s;
}

.nav__logo span {
    color: var(--dark);
}

.nav__logo:hover {
    transform: scale(1.2);
    filter:
        drop-shadow(0 4px 8px var(--add-color));
}

.nav__logo span:hover {
    transform: scale(1.2);
    filter:
        drop-shadow(0 4px 8px var(--dark));
}

.nav__logo,
.nav__toggle {
    color: var(--colored);
    display: inline-flex;
}

.nav__toggle {
    font-size: 2.5rem;
    cursor: pointer;
    transition: .1s;
}

.nav__toggle:hover {
    transform: scale(1.1);
    filter:
        drop-shadow(0 4px 8px var(--colored));
}

.nav__list {
    text-align: center;
    display: flex;
    flex-direction: column;
    row-gap: 2rem;
    font-size: 1.2rem;
}

.nav__link {
    color: var(--colored);
}

.nav__link:hover {
    color: var(--add-color);
}

.nav__close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2.5rem;
    color: var(--colored);
    cursor: pointer;

}

.nav__close:hover {
    transform: scale(1.2);
    filter:
        drop-shadow(0 4px 12px var(--colored));
}


@media screen and (max-width: 767px) {

    .nav__menu {
        position: fixed;
        background-color: var(--dark);
        left: 0;
        top: -100%;
        width: 100%;
        padding: 5rem 0 4rem;
        border-radius: 0 0 1.5rem 1.5rem;
        box-shadow: 0 2px 4px hsla(38, 4%, 15%, .15);
        transition: .4s;
        z-index: 101;

    }

    .nav__link {
        color: var(--light);
    }
    
}


/* Show menu */
.show-menu {
    top: 0;
}


@media screen and (min-width: 768px) {

    .nav {
        height: calc(var(--header-height) + 1.5rem);
    }

    .nav__toggle,
    .nav__close {
        display: none;
    }

    .nav__list {
        flex-direction: row;
        column-gap: 2rem;
    }
}

/* 🎛 Фильтры */
main {
    padding: 5rem;
    overflow: hidden;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: space-around;
}

.head {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
    text-align: center;
    align-items: center;
    padding: 3rem;
}

.filters {
    text-align: center;
    margin-bottom: 20px;
}

.filters button {
    margin: 5px;
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.filters button:hover {
    background-color: #0056b3;
}

/* 🧱 Сетка: desktop — 2 колонки */
.layout {
    display: flex;
    gap: 20px;
}

#article-list {
    flex: 1;
    overflow-y: auto;
    max-height: 90vh;
    max-width: 400px;
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: var(--colored) #fff;
    /* Firefox */
    padding-inline: 1rem;
}

/* Chrome/Safari */
#article-list::-webkit-scrollbar {
    width: 6px;
}

#article-list::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

#article-list::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.content {
    flex: 2;
    background: transparent;
    padding: 2rem 3rem;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(72, 69, 174, 0.1);
}

/* 📦 Карточки */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    align-items: center;

    animation: fadeIn 0.5s ease-in-out;
}

.card:hover {
    transform: scale(1.02);
}

.card img {
    width: 70%;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.card p {
    margin: 10px 0;
    color: var(--textColor);
    font-size: 0.95rem;
}


#article-content {
    display: none;
}

/* ✨ Раскрытая карточка (mobile only) */
.card.expanded {

    border: 2px solid #007bff;
    transform: scale(1.03);
    padding: 20px;
    z-index: 10;
}

.card.expanded #article-content {
    display: block;
}

#full-article-content a,
#article-content a {
    color: var(--primaryColor);
}

#full-article-content a:hover,
#article-content a:hover {
    color: var(--colored);
}

/* 📱 Мобильная версия */
@media screen and (max-width: 860px) {
    main {
        width: 100%;
        margin: 1rem;
        padding: 2rem 0;
    }

    #article-list {
        max-width: 90%;
    }
}

/* 📱 Мобильная версия */
@media screen and (max-width: 768px) {
    .layout {
        flex-direction: column;
    }

    .content {
        display: none;
    }

    .sidebar {
        max-width: 100%;
    }

    .sidebar {
        order: 2;
    }

    .card {
        width: 100%;
        text-align: left;
    }

    .card img {
        width: 50%;
    }

}

/* 👋 Анимация */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}