/* Shared presentation layer for the learning catalogue pages. */
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) {
    --learning-shell-width: 1440px;
    --learning-header-height: 62px;
    color: var(--site-text);
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) header:not(.header--deals) {
    position: sticky;
    top: 12px;
    z-index: 80;
    width: min(var(--learning-shell-width), calc(100% - clamp(24px, 4vw, 48px)));
    min-height: var(--learning-header-height);
    margin: 12px auto 0;
    padding: 7px 10px 7px 12px;
    gap: 12px;
    border: 1px solid var(--site-border);
    border-radius: 18px;
    background: var(--site-header-bg);
    box-shadow: var(--site-shadow-soft);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .logo-container {
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
    align-items: center;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .logo-a,
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .logo-a img {
    width: auto;
    height: 46px;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .logo-container h3 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--site-text);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .icon-container {
    flex: 0 0 auto;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .icon-container > div,
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .theme-toggle--header,
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav,
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav [type="checkbox"] + label,
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu-icon {
    height: 48px;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .theme-toggle--header {
    min-width: 106px;
    padding: 0 14px;
    border-radius: 12px;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav {
    position: relative;
    width: auto;
    max-width: none;
    overflow: visible;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav > .log-button {
    width: auto;
    min-width: 112px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--site-border);
    border-radius: 12px;
    background: var(--site-surface);
    color: var(--site-text);
    box-shadow: none;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav > .log-button > .log-button {
    width: auto;
    min-width: 112px;
    height: 100%;
    padding: 0 20px;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: inherit;
    box-shadow: none;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav [type="checkbox"] + label {
    width: auto;
    min-width: 156px;
    max-width: 216px;
    padding: 0 12px 0 5px;
    gap: 8px;
    border: 1px solid var(--site-border);
    border-radius: 12px;
    color: var(--site-text);
    background: var(--site-surface);
    box-shadow: none;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav-user-photo {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav-user-photo img {
    width: 38px;
    height: 38px;
    border-radius: 9px;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav-user-name {
    justify-content: flex-start;
    width: auto;
    min-width: 0;
    height: auto;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav-user-name span {
    min-width: 0;
    overflow: hidden;
    color: var(--site-text);
    font-size: 0.92rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu-icon {
    z-index: 91;
    width: 48px;
    border: 1px solid var(--site-border);
    border-radius: 12px;
    background: var(--site-surface);
    box-shadow: none;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) #button {
    width: 48px;
    height: 48px;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) #icon {
    right: 15px;
    left: 15px;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .lines,
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .lines::before,
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .lines::after {
    background: var(--site-text);
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) #icon.close .lines {
    background: transparent;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 10px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: min(296px, calc(100vw - 24px));
    height: auto;
    max-height: calc(100dvh - 96px);
    padding: 8px;
    overflow: auto;
    border: 1px solid var(--site-border-strong);
    border-radius: 14px;
    background: var(--site-surface);
    box-shadow: var(--site-shadow-card);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(0.985);
    transform-origin: top right;
    transition:
        opacity 160ms ease,
        transform 160ms ease,
        visibility 160ms ease;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu.active {
    right: 10px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu-title {
    display: none;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu a {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 9px;
    color: var(--site-text);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
    text-transform: none;
    transition:
        color 160ms ease,
        background-color 160ms ease;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu a:hover,
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu a:focus-visible {
    padding: 0 12px;
    color: var(--site-text);
    background: var(--site-surface-muted);
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu a.is-active,
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu a[aria-current="page"] {
    color: var(--site-text);
    background: var(--site-surface-strong);
    box-shadow: inset 2px 0 0 var(--main-color);
}

/* Normalize the profile dropdown so it cannot collide with the navigation panel. */
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 92;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: min(232px, calc(100vw - 24px));
    margin: 0;
    padding: 6px;
    border: 1px solid var(--site-border-strong);
    border-radius: 14px;
    background: var(--site-surface);
    box-shadow: var(--site-shadow-card);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition:
        opacity 160ms ease,
        transform 160ms ease,
        visibility 160ms ease;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav input:checked ~ .user-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .user-menu li,
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav input:checked ~ .user-menu li,
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav input:checked ~ .user-menu li:nth-child(1),
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav input:checked ~ .user-menu li:nth-child(2),
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav input:checked ~ .user-menu li:nth-child(3) {
    position: static;
    top: auto;
    right: auto;
    display: block;
    width: 100%;
    height: auto;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition: none;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .user-menu li a,
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .user-menu-link {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    width: 100%;
    min-height: 44px;
    height: auto;
    border: 0;
    border-radius: 9px;
    color: var(--site-text);
    background: transparent;
    box-shadow: none;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .user-menu li a:hover,
:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .user-menu li a:focus-visible {
    background: var(--site-surface-muted);
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .user-menu li .user-menu-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--site-surface-muted);
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .user-menu li .user-menu-icon img {
    width: 22px;
    height: 22px;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page)[data-theme="light"] .user-menu li .user-menu-icon img {
    filter: brightness(0) saturate(100%) opacity(0.72);
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .user-menu li .user-menu-text {
    align-items: center;
    justify-content: flex-start;
    width: auto;
    min-width: 0;
    height: auto;
    padding: 0 8px;
    line-height: 1;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .user-menu li .user-menu-text span {
    display: block;
    overflow: hidden;
    color: var(--site-text);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 1;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .footer {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    min-height: 60px;
    padding: 18px 16px;
    font-size: 0.9rem;
}

:is(body.index-page, body.courses-page, body.videos-page, body.books-page) .footer p {
    margin: 0;
}

body.courses-page .courses-shell {
    min-height: 0;
    padding: 28px clamp(12px, 2.5vw, 32px) 52px;
}

body.courses-page .courses-toolbar,
body.courses-page .grid {
    width: min(1280px, 100%);
}

body.courses-page .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

body.courses-page .card {
    min-height: 322px;
    padding: 18px;
    border: 1px solid var(--site-border);
    border-radius: 14px;
    background: var(--site-surface);
    box-shadow: none;
    transition:
        border-color 160ms ease,
        transform 160ms ease;
}

body.courses-page .card .shine,
body.courses-page .card .background {
    display: none;
}

body.courses-page .card:hover {
    border-color: var(--site-border-strong);
    box-shadow: none;
    transform: translateY(-2px);
}

body.courses-page .card .course-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
}

body.courses-page .card .course-card-icon svg {
    width: 22px;
    height: 22px;
}

body.courses-page .card h4 {
    margin: 12px 0 6px;
    font-size: 1.14rem;
    line-height: 1.25;
    letter-spacing: 0;
}

body.courses-page .course-status-badge {
    top: 14px;
    right: 14px;
    min-height: 24px;
    font-size: 0.68rem;
}

body.courses-page .course-progress__action {
    min-height: 38px;
    border-radius: 10px;
}

body.courses-page[data-theme="dark"] .card {
    border-color: var(--site-border);
    background: var(--site-surface);
    box-shadow: none;
}

body.courses-page[data-theme="dark"] .card:hover {
    border-color: var(--site-border-strong);
    box-shadow: none;
}

body.videos-page .videos-page__section {
    padding: 28px clamp(12px, 2.5vw, 32px) 52px;
}

body.videos-page .videos-container {
    width: min(1280px, 100%);
    gap: 20px;
}

body.videos-page .videos-tools {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 12px;
}

body.videos-page .videos-search,
body.videos-page .videos-filter {
    min-height: 48px;
    border-radius: 12px;
    box-shadow: none;
}

body.videos-page .videos-grid-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

body.videos-page .videos-card {
    padding: 12px 12px 14px;
    border-radius: 14px;
    box-shadow: none;
    transition:
        border-color 160ms ease,
        transform 160ms ease;
}

body.videos-page .videos-card:hover {
    border-color: var(--site-border-strong);
    box-shadow: none;
    transform: translateY(-2px);
}

body.books-page section {
    padding: 28px clamp(12px, 2.5vw, 32px) 52px;
}

body.books-page .books-container {
    width: min(1280px, 100%);
}

body.books-page .books-grid-container {
    grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
    gap: 16px;
}

body.books-page .books-grid-item,
body.books-page .front,
body.books-page .back {
    border-radius: 14px;
}

body.books-page .books-grid-item-front,
body.books-page .books-grid-item-back {
    border-color: var(--site-border);
    box-shadow: none;
}

body.objects-page .center {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    align-items: start;
    justify-content: normal;
    width: min(960px, calc(100% - 32px));
    height: auto;
    min-height: calc(100vh - 110px);
    margin: 0 auto;
    padding: 32px 0 52px;
    gap: 16px;
}

body.objects-page .property-card {
    z-index: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: 320px;
    overflow: hidden;
    border: 1px solid var(--site-border);
    border-radius: 14px;
    background: var(--site-surface);
    box-shadow: none;
    transition:
        border-color 160ms ease,
        transform 160ms ease;
}

body.objects-page .property-card:hover {
    border-color: var(--site-border-strong);
    transform: translateY(-2px);
}

body.objects-page .property-card a {
    display: block;
    overflow: hidden;
}

body.objects-page .property-image {
    position: relative;
    width: 100%;
    height: 164px;
    padding: 0;
    background-position: center;
    transition: transform 200ms ease;
}

body.objects-page .property-card:hover .property-image {
    height: 164px;
    transform: scale(1.04);
}

body.objects-page .property-description,
body.objects-page .property-card:hover .property-description {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    height: auto;
    min-height: 156px;
    padding: 16px;
    color: var(--site-text);
    text-align: left;
    background: var(--site-surface);
}

body.objects-page .property-description h5 {
    margin: 0;
    color: var(--site-text);
    font-size: 1.12rem;
    line-height: 1.25;
}

body.objects-page .property-description p {
    margin: 0;
    color: var(--site-text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

body.index-page .index-bottom-nav {
    width: min(1280px, calc(100% - 32px));
    gap: 14px;
}

body.index-page .button {
    min-height: 144px;
    padding: 18px 14px;
    border: 1px solid var(--site-border);
    border-radius: 14px;
    box-shadow: none;
}

body.index-page .button:hover {
    border-color: var(--site-border-strong);
    box-shadow: none;
    transform: translateY(-2px);
}

@media (max-width: 1120px) {
    body.courses-page .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 840px) {
    body.courses-page .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) {
        --learning-header-height: auto;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) header:not(.header--deals) {
        top: 8px;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: calc(100% - 16px);
        margin: 8px auto 0;
        padding: 8px;
        gap: 8px;
        border-radius: 14px;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .logo-a,
    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .logo-a img {
        height: 42px;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .logo-container h3 {
        font-size: 0.98rem;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .icon-container {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) 44px;
        width: 100%;
        gap: 8px;
    }

    body.objects-page .icon-container {
        grid-template-columns: minmax(0, 1fr) 44px;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .icon-container > div,
    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .theme-toggle--header,
    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav,
    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav [type="checkbox"] + label,
    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu-icon {
        height: 44px;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .theme-toggle--header {
        min-width: 44px;
        padding: 0;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav,
    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav [type="checkbox"] + label {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav > .log-button,
    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav > .log-button > .log-button {
        width: 100%;
        min-width: 0;
        height: 44px;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav-user-photo,
    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .nav-user-photo img {
        width: 34px;
        height: 34px;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu-icon,
    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) #button {
        width: 44px;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) #icon {
        right: 13px;
        left: 13px;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu {
        position: fixed;
        top: 126px;
        right: 8px;
        width: calc(100% - 16px);
        max-height: calc(100dvh - 134px);
        padding: 6px;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu.active {
        right: 8px;
    }

    :is(body.index-page, body.courses-page, body.videos-page, body.books-page) .menu a {
        min-height: 42px;
    }

    body.videos-page .videos-tools {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    body.courses-page .grid,
    body.videos-page .videos-grid-container,
    body.books-page .books-grid-container {
        grid-template-columns: minmax(0, 1fr);
    }

    body.courses-page .card {
        min-height: auto;
    }
}
