body {
    display: flex;
    flex-direction: column;
    gap: var(--m);
}

.header,
.footer {
    background-color: var(--color-background-card);
    transition: 0.3s ease-out all;
}

.header {
    position: sticky;
    top: 0;
    border-bottom: 0.1rem solid rgba(255, 255, 255, 0.06);      
    box-shadow: 0 0 0.5rem 0.06rem rgba(255, 255, 255, 0.02);  
    z-index: 2;
}

.wrapper {
    flex: 1;
    display: flex;
    align-items: stretch;
}

.wrapper .blur {
    opacity: 0;
    transition: 0.3s ease all;
}

.header__content,
.wrapper__content,
.footer__content {
    width: var(--content-width);
    margin-inline: auto;
    display: flex;
    gap: var(--l);
}

.header__content,
.footer__content {
    height: var(--header-height);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--xxs);
    position: relative;
}

.logo {
    margin-right: auto;
    font-size: var(--font-l);
    font-weight: var(--semi-bold);
}

.header__institution {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--font-l);
    font-weight: var(--semi-bold);
}

.header__user {    
    font-size: var(--font-s);
    font-weight: var(--semi-bold);
    display: flex;
    align-items: center;
    gap: var(--xxxs);
}

.header__user-info {
    padding-inline: var(--xxs);
    cursor: default;
}

.header__user-info:has(.header__user-role) {
    padding-inline: var(--xxs) 0;
}

.header__user .logout {
    background-color: var(--color-logout);
}

.header__user .login {
    background-color: var(--color-login);
}

.menu {
    font-size: var(--font-s);
    font-weight: var(--lighter);
    display: flex;
    align-items: center;
    text-transform: uppercase;
    display: none;
}

.theme__button {
    font-size: var(--font-s);
    font-weight: var(--lighter);
    display: flex;
    align-items: center;
    text-transform: uppercase;
}

.theme {
    position: relative;
    z-index: 1;
}

.theme__options {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, var(--l));
    background-color: var(--color-background-card);
    display: flex;
    flex-wrap: wrap;
    gap: var(--xxxs);
    width: 9rem;
    padding: var(--xxs);
    border-radius: var(--radius-s);
    border: 0.1rem solid var(--color-input-border);
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease-out all;
}

.theme__options.active {
    transform: translate(-50%, var(--xs));
    opacity: 1;
    pointer-events: all;
}

.theme__option {
    flex-basis: 30%;
    border: 0.1rem solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0.5rem 0.06rem rgba(255, 255, 255, 0.02);
}

#dark {
    background-color: #222222;
}

#light {
    background-color: #eff2f9;
}

#green {
    background-color: #023020;
}

.aside {
    min-width: 20rem;
    align-self: flex-start;
    position: sticky;
    top: calc(var(--header-height) + var(--m));
    transition: 0.65s cubic-bezier(0.68, 0.22, 0, 0.9) all;
}

.aside__content,
.main__content,
.note__content {
    padding: var(--xs);
    background-color: var(--color-background-card);
    border-radius: var(--radius-xs);
    border: 0.1rem solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0.5rem 0.06rem rgba(255, 255, 255, 0.02);
    transition: 0.3s ease-out all;
}

body[data-theme="light"] .wrapper__content > * > *,
body[data-theme="light"] .header,
body[data-theme="light"] .footer,
body[data-theme="light"] .theme__option {
    border: 0.1rem solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 0 0.5rem 0.06rem rgba(0, 0, 0, 0.02);
}

.aside__header,
.note__title {
    text-align: center;
    font-size: var(--font-m);
    font-weight: var(--semi-bold);
    border-bottom: 0.01rem solid rgba(255, 255, 255, 0.1);
    padding-block: var(--xxs);
}

body[data-theme="light"] .aside__header,
body[data-theme="light"] .main__header,
body[data-theme="light"] .note__title,
body[data-theme="light"] .wrapperInfo__content {
    border-bottom: 0.01rem solid rgba(0, 0, 0, 0.1);
}

.aside__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aside__title {
    text-align: start;
    padding-left: var(--s);
    font-size: var(--font-m);
    font-weight: var(--semi-bold);
}

.aside__button {
    display: none;
}

.aside__list {
    max-height: 34rem;
    overflow-y: auto;
    display: grid;
    gap: var(--xxxs);
    margin-top: var(--xs);
}

.aside__link {
    font-size: var(--font-s);
    border-radius: var(--radius-xs);
    display: flex;
    padding: var(--s);
    transition: 0.3s ease-out all;
}

.aside__link:hover {
    background-color: var(--color-background-page);
    filter: brightness(1.2);
}

.main {
    flex: 1;
}

.main__content {
    height: 100%;
    overflow-x: hidden;
}

.main__header {
    display: flex;
    align-items: center;
    gap: var(--xl);
    border-bottom: 0.01rem solid rgba(255, 255, 255, 0.1);
    padding-block: var(--xxs);
    margin-bottom: var(--xs);
}

.main__title {
    font-size: var(--font-xl);
}

.main__intro {
    line-height: 1.4;
}

.main__features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    grid-auto-rows: 14rem;
    gap: var(--xxs);
    margin-block: var(--xxxxl);
}

.main__feature {
    border-radius: var(--radius-xs);
    padding: var(--xs);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--color-accent);
    color: var(--color-background-card);
    transition: 0.3s ease-out all;
}

.main__feature:hover {
    filter: brightness(1.09);
}

.main__feature .icon {
    font-size: var(--font-xl);
    margin-bottom: var(--xxs);
}

.main__feature-title {
    margin-bottom: var(--l);
    font-size: var(--font-m);
}

.main__feature-text {
    opacity: 0.66;
}

/* wrapper info */
.wrapperInfo__content {
    padding-block: var(--l) var(--xxxl);
    display: grid;
    gap: var(--xl);
    border-bottom: 0.01rem solid rgba(255, 255, 255, 0.1);
}

.wrapperInfo__body {
    display: flex;
    flex-direction: column;
    gap: var(--xxl);
}

.wrapperInfo__data {
    font-size: var(--font-s);
    display: flex;
    flex-direction: column;
    gap: var(--xxxs);
}

.wrapperInfo__barcode {
    width: 18rem;
    object-fit: cover;
    object-position: center;
}

.wrapperInfo__key {
    opacity: 0.65;
    font-weight: var(--light);
}

.wrapperInfo__top {
    display: flex;
    flex-wrap: wrap;
    gap: var(--l) var(--xxl);
}

.wrapperInfo__bottom {
    display: flex;
    flex-wrap: wrap;
    gap: var(--xl) var(--xxxxl);
}

/* pagination */
.pagination {
    background-color: var(--color-pagination-background);
    border-radius: var(--radius-s);
    padding: var(--xxxs);
    justify-self: flex-start;
    margin-block: var(--xs);
    display: flex;
    flex-wrap: wrap;
    gap: var(--xxxs) var(--xs);
}

.pagination__button {
    border-radius: var(--radius-s);
    height: 2.3rem;
    padding-inline: var(--s);
    font-size: var(--font-s);
    font-weight: var(--light);
    transition: 0.3s all ease-out;
    background-color: var(--color-pagination-button);
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination__button:hover {
  filter: brightness(1.4);
}

.pagination__button.active {
    border: 0.06rem solid var(--color-pagination-active);
}

.pagination__pages {
    display: flex;
    gap: var(--xxxs);
}

.note {
    min-width: 16rem;
    max-width: 20rem;
    min-height: 30rem;
    max-height: 100%;
    align-self: flex-start;
    position: sticky;
    top: calc(var(--header-height) + var(--m));
}

.note__content {
    height: 100%;
}

.note__body {
    display: grid;
    gap: var(--l);
    padding-block: var(--s);
}

.note__text {
    font-size: var(--font-s);
    line-height: 1.4;
    font-weight: var(--light);
}

.note__text .icon {
    opacity: 0.6;
}

.wrapper__content:has(#chronicle) {
    flex-direction: row-reverse;
    flex-wrap: wrap;
}

.wrapper__content:has(#chronicle) .note {
    min-width: 100%;
    min-height: auto;
    position: initial;
    flex: 1;
    flex-basis: 100%;
}

.wrapper__content:has(#chronicle) .aside {
    order: 3;
}

.wrapper__content:has(#chronicle) .main {
    order: 2;
}

.footer {
    margin-top: auto;
    border-top: 0.01rem solid rgba(255, 255, 255, 0.06);    
}

.footer__content {
    padding: var(--xs);
}


/* media query */
@media (max-width: 1440px) {
    .header__content {
        justify-content: space-between;
    }

    .logo {
        margin-right: var(--xxs);
        position: relative;
    }

    .logo::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 0;
        transform: translate(calc(var(--l) / 2), -50%);
        height: 2rem;
        width: 0.01rem;
        background-color: rgba(255, 255, 255, 0.1);
    }

    .header__institution {
        position: initial;
        top: initial;
        left: initial;
        transform: translate(0, 0);
        margin-right: auto;
        opacity: 0.56;
    }

    .menu {
        display: block;
    }

    .aside {
        position: fixed;
        top: 0;
        right: 0;
        transform: translateX(100%);
        z-index: 3;
    }
    
    .aside.active {
        transform: translateX(0);
    }
    
    .aside__content {
        height: 100vh;
    }
    
    .aside__list {
        max-height: 86vh;
    }
    
    .wrapper .blur.active {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        opacity: 1;
        background-color: rgba(255, 255, 255, 0.04);
        backdrop-filter: blur(0.05rem);
        z-index: 2;
    }

    .aside__button {
        display: block;
    }
}

@media (max-width: 1200px) {
    .wrapper__content {
        flex-direction: column-reverse;
    }

    .note {
        min-width: 100%;
        min-height: auto;
        position: initial;
    }
}

@media (max-width: 880px) {
    .header__content {
        gap: var(--xxxs);
    }

    .header__institution {
        display: none;
    }

    .theme {
        margin-left: auto;
    }

    .menu span {
        display: none;
    }
}

@media (max-width: 560px) {
    .header__content {
        height: auto;
        padding-block: var(--xs);
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .logo {
        margin-top: var(--xs);
    }

    .logo::after {
        display: none;
    }

    .header__user {
        flex-basis: 100%;
        flex-direction: column;
        align-items: flex-end;
    }

    .login,
    .logout {
        align-self: flex-end;
    }

    .aside {
        width: 100%;    
    }
    
    .main__header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .main__title {
        font-size: var(--font-l);
        font-weight: var(--semi-bold);
    }

    .main__features {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .main__feature {
        aspect-ratio: 1;
    }

    .wrapperInfo__title {
        font-size: var(--font-m);
    }
}



@media (max-width: 480px) {
    .wrapperInfo__barcode {
        width: 100%;
    }

    .wrapperInfo__name {
        font-size: var(--font-xxs);
    }

}
