html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
}

header {
    width: 100%;
    position: relative;
    background-image: var(--bg-header);
    color: white;
    text-align: center;
    box-shadow: var(--box-shadow-header);
    z-index: 40;
}

.header-container {
    width: 90%;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    height: 80px;
}

.header-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    position: static;
}

header h1 {
    flex-grow: 1;
}

header h1 a {
    text-decoration: none;
    color: var(--text-load-more-button-color);
}

header h1 a:hover {
    text-decoration: none;
}

.h2 {
    width: 90%;
    margin: 20px auto 10px auto;
    font-size: 21px;
    font-weight: bold;
    color: var(--text-color);
}

.search-panel {
    width: 90%;
    position: relative;
    margin: 20px auto 10px auto;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}


.search-panel input[type="text"] {
    width: 90%;
    flex-grow: 1;
    padding: 10px 40px 10px 15px;
    font-size: 16px;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-search-panel);
    border-radius: 4px;
    height: 40px;
    background-color: var(--bg-color);
    color: var(--text-color);
    caret-color: var(--text-color);
    box-sizing: border-box;
}

.search-panel input[type="text"]:focus {
    outline: none;
}

.search-panel input[type="text"]:focus::placeholder {
    color: transparent;
}

.search-panel button {
    background-color: var(--bg-button);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 16px;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
}

.search-panel button img {
    width: 20px;
    height: 20px;
    display: block;
}

.search-panel button:not(:disabled):hover {
    background-color: var(--bg-button-hover);
}

.search-panel button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.clear-search {
    position: absolute;
    right: 85px;
    font-size: 24px;
    color: var(--text-color);
    cursor: pointer;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.3s ease, color 0.3s ease;
}

.clear-search:hover {
    transform: scale(1.2);
    color: var(--text-hover-color);
}

button {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}

button img {
    width: 24px;
    height: 24px;
    display: block;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-link img {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
}

.icon-link:hover {
    opacity: 0.7;
}

.section-header {
    width: 90%;
    margin: 20px auto 10px auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 20px;
    row-gap: 10px;
}

.section-header .h2 {
    width: auto;
    margin: 0;
    font-size: 21px;
    font-weight: bold;
    color: var(--text-color);
}

.section-header .filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    header h1 {
        font-size: 24px;
    }

    .h2 {
        font-size: 18px;
    }

    button img {
        width: 20px;
        height: 20px;
    }

    .icon-link img {
        width: 20px;
        height: 20px;
    }
}

@media (hover: none) {
    .search-panel button:hover {
        background-color: var(--bg-button);
    }
}

.header-menu-type {
    position: absolute;
    margin-left: auto;
    margin-right: auto;
    display: none;
    gap: 6px;
    white-space: nowrap;
    visibility: hidden;
}

.header-menu-button {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    color: var(--text-load-more-button-color);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: background-color 0.18s ease,
    border-color 0.18s ease,
    transform 0.12s ease,
    opacity 0.18s ease;
}

.header-menu-button:hover {
    border-bottom: 2px solid var(--text-color-menu);
}

.header-menu-button:active {
    border-bottom: 2px solid var(--text-color-menu);
}

.header-menu-button::after {
    content: "›";
    margin: 0 0 0 0.5rem;
    font-size: 16px;
    opacity: 0.75;
    align-items: center;
}

.header-menu-button.is-active {
    border-bottom: 2px solid #ffffff;
}

.header-menu {
    width: 100%;
    background-color: var(--bg-menu);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 30;
    text-align: left;
}

.header-menu-inner {
    width: 90%;
    margin: 0 auto;
    padding: 12px 0 16px;
    position: relative;
}

.header-menu-link {
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
    position: relative;
    display: inline-block;
    padding-right: 20px;
    text-decoration: none;
    color: var(--text-color);
}

.header-menu-link::after {
    content: "→";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(-6px, -50%);
    opacity: 0;

    font-size: 0.95em;
    font-weight: 500;

    transition: opacity 0.2s ease,
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-menu-link:hover::after {
    opacity: 1;
    transform: translate(0, -50%);
}

.header-menu-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.header-menu-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-color-menu);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background-color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.15s ease;
}

.header-menu-all:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.header-menu-all:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.authors-groups {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    --text-color: var(--text-color-menu);
    min-width: 220px;
    max-height: min(520px, calc(100vh - 170px));
    overflow: auto;
    padding-right: 6px;
}


.authors-group-title {
    font-weight: 700;
    margin: 0 0 17px;
    color: var(--text-load-more-button-color);
    text-decoration: underline;
}

.authors-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}


.overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(0.5px);
    z-index: 20;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.authors-group + .authors-group {
    border-left: 1px solid color-mix(in srgb, var(--text-color) 18%, transparent);
    padding-left: 18px;
    margin-left: 0;
}

.header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    pointer-events: none;
    margin: 0;
}

.header-logo a {
    pointer-events: auto;
    display: inline-flex;
}

.site-logo {
    width: 60px;
    height: auto;
    display: block;
    margin: 0;
    pointer-events: auto;
    object-fit: contain;
}

@media (max-width: 480px) {
    .site-logo {
        width: 50px;
        height: auto;
    }
}


.header-burger {
    display: inline-flex;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.header--burger-mode .header-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header--burger-mode .header-menu-type {
    display: none;
}

.header-menu-root-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.header-menu-root-btn {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 500;

    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;

    color: var(--text-color-menu);
    cursor: pointer;

    transition: background 0.2s ease;
}

.header-menu-root-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

@media (min-width: 768px) {
    header:not(.header--burger-mode) .header-menu-type {
        display: flex;
    }

    header:not(.header--burger-mode) .header-burger {
        display: none;
    }

    .header-menu-back {
        display: none !important;
    }
}

header.header--ready .header-menu-type {
    visibility: visible;
}



body.no-scroll {
    overflow: hidden;
}