@media (prefers-reduced-motion: reduce) {
    .site-logo:hover,
    .home-category-card:hover,
    .category-card-tile:hover,
    .page-back-link:hover {
        transform: none;
    }
}

body.site-body.is-category-page .site-main {
    flex: 0 0 auto !important;
    min-height: 0 !important;
    height: auto !important;
}

@media (min-width: 961px) {
    body.site-body.is-home-page {
        min-height: 100dvh;
        height: 100dvh;
        overflow: hidden;
        --home-cards-gap-top: 14px;
        --home-cards-gap-bottom: 6px;
        --home-main-gap-top: 18px;
        --home-main-gap-bottom: 6px;
    }

    body.site-body.is-home-page .site-main {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        width: 100%;
        padding-top: var(--home-main-gap-top);
        padding-bottom: var(--home-main-gap-bottom);
    }

    body.site-body.is-home-page .home-page {
        display: grid;
        grid-template-rows: minmax(0, 1fr);
        align-items: stretch;
        gap: 0;
        width: min(var(--container-width), 100%);
        margin: 0 auto;
        min-height: var(--home-available-height, calc(100dvh - 180px));
        height: var(--home-available-height, calc(100dvh - 180px));
        padding-top: var(--home-cards-gap-top);
        padding-bottom: var(--home-cards-gap-bottom);
    }

    body.site-body.is-home-page .home-categories-grid {
        width: 100%;
        min-height: 0;
        height: 100%;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-rows: minmax(0, 1fr);
        grid-auto-rows: minmax(0, 1fr);
        align-items: stretch;
        margin-top: 0;
        margin-bottom: 0;
    }

    body.site-body.is-home-page .home-category-card {
        min-height: 0;
        height: 100%;
    }

    .category-page {
        gap: 8px;
        padding-top: 4px;
    }

    .category-page .page-breadcrumbs {
        margin-bottom: 0;
        font-size: 10px;
    }

    .category-page .page-back-link {
        padding: 5px 10px;
        margin-bottom: 0;
        font-size: 12px;
    }

    .category-page-header {
        margin-bottom: 0;
    }

    .category-hero {
        padding: clamp(10px, 1.1vw, 14px);
        border-radius: 18px;
    }

    .category-hero-copy {
        gap: 4px;
    }

    .category-page-title {
        font-size: clamp(24px, 2vw, 32px);
    }

    .category-page-description {
        margin-top: 2px;
        max-width: 44ch;
        font-size: 13px;
        line-height: 1.35;
    }
}

.category-card-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 13px;
    border-radius: 999px;
    background: linear-gradient(120deg, #ff6a00 0%, #ff2d2d 100%);
    box-shadow: 0 10px 22px rgba(176, 44, 0, 0.35);
    color: #fff;
    font-family: "Unbounded", sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.card-page-badge {
    margin: 0;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: 999px;
    background: linear-gradient(120deg, #ff6a00 0%, #ff2d2d 100%);
    box-shadow: 0 10px 22px rgba(176, 44, 0, 0.3);
    color: #fff;
    font-family: "Unbounded", sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@media (min-width: 961px) and (max-width: 1280px) {
    body.site-body.is-home-page .home-categories-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1644px) and (max-width: 1940px) {
    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: clamp(18px, 1.5vw, 28px);
    }
}

.card-page-wrap {
    gap: 14px;
    padding-top: 10px;
}

.card-page-canvas {
    padding: clamp(18px, 2.5vw, 28px);
    gap: 18px;
}

.card-page-head {
    display: grid;
    gap: 8px;
}

.card-page-title {
    font-size: clamp(42px, 4.6vw, 70px);
    line-height: 0.98;
    letter-spacing: -0.03em;
}

.card-page-summary {
    margin: 0;
    max-width: 76ch;
    color: rgba(31, 36, 48, 0.9);
    font-size: clamp(16px, 1.2vw, 21px);
    line-height: 1.62;
    white-space: normal;
}

.card-page-text {
    width: min(920px, 100%);
}

.card-rich-content {
    color: rgba(31, 36, 48, 0.94);
    font-size: clamp(16px, 1.04vw, 19px);
    line-height: 1.72;
}

.card-rich-content > :first-child {
    margin-top: 0;
}

.card-rich-content > :last-child {
    margin-bottom: 0;
}

.card-rich-content h2,
.card-rich-content h3 {
    margin: 1.25em 0 0.55em;
    color: #1f2430;
    line-height: 1.2;
}

.card-rich-content h2 {
    font-size: clamp(26px, 2.3vw, 38px);
}

.card-rich-content h3 {
    font-size: clamp(21px, 1.85vw, 30px);
}

.card-rich-content p,
.card-rich-content ul,
.card-rich-content ol,
.card-rich-content blockquote {
    margin: 0.74em 0;
}

.card-rich-content ul,
.card-rich-content ol {
    padding-left: 1.3em;
}

.card-rich-content blockquote {
    padding-left: 0.95em;
    border-left: 3px solid rgba(98, 87, 162, 0.35);
    color: rgba(55, 63, 86, 0.9);
}

.card-rich-content a {
    color: #3c4487;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
}

.card-rich-content .text-size-sm {
    font-size: 0.9rem;
}

.card-rich-content .text-size-14 {
    font-size: 14px;
}

.card-rich-content .text-size-16 {
    font-size: 16px;
}

.card-rich-content .text-size-18 {
    font-size: 18px;
}

.card-rich-content .text-size-22 {
    font-size: 22px;
}

.card-rich-content .text-size-28 {
    font-size: 28px;
}

.card-rich-content .text-size-lg {
    font-size: 1.2rem;
}

.card-rich-content .text-size-xl {
    font-size: 1.45rem;
}

.card-rich-content .font-serif {
    font-family: "Times New Roman", serif;
}

.card-rich-content .font-accent {
    font-family: Georgia, serif;
    letter-spacing: 0.02em;
}

.card-rich-content .font-manrope {
    font-family: "Manrope", sans-serif;
}

.card-rich-content .font-playfair {
    font-family: "Playfair Display", serif;
}

.card-rich-content .font-unbounded {
    font-family: "Unbounded", sans-serif;
}

.card-hero-media {
    min-height: clamp(300px, 48vw, 560px);
}

.card-page-canvas {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.card-gallery-grid {
    gap: 16px;
}

.card-gallery-item {
    display: block;
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(117, 123, 170, 0.26);
    box-shadow: 0 14px 26px rgba(46, 43, 88, 0.2);
}

.card-gallery-item img {
    max-height: none;
    height: 100%;
    aspect-ratio: 2 / 3;
}

.card-gallery-item:hover img {
    transform: none;
}

.lightbox {
    z-index: 1500;
    background: rgba(3, 5, 12, 0.95);
}

html.is-lightbox-open .site-header,
body.is-lightbox-open .site-header {
    pointer-events: none !important;
    opacity: 0.04 !important;
    filter: none !important;
}

html.is-lightbox-open .site-footer,
body.is-lightbox-open .site-footer {
    pointer-events: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

html.is-lightbox-open .site-header *,
body.is-lightbox-open .site-header * {
    pointer-events: none !important;
}

@media (max-width: 980px) {
    .category-card-badge {
        top: 12px;
        left: 12px;
        padding: 6px 10px;
        font-size: 10px;
    }

    .card-page-badge {
        padding: 6px 11px;
        font-size: 10px;
    }

    .card-page-wrap {
        gap: 10px;
        padding-top: 8px;
    }

    .card-page-wrap,
    .card-page-canvas,
    .card-media-section,
    .card-kuula-list,
    .card-kuula-item,
    .card-video-block {
        width: 100%;
        max-width: 100%;
    }

    .card-page-canvas {
        overflow-x: hidden;
    }

    .card-page-canvas {
        padding: 0;
        gap: 12px;
    }

    .card-page-title {
        font-size: clamp(38px, 10vw, 56px);
    }

    .card-page-summary {
        font-size: 15px;
        line-height: 1.55;
    }

    .card-page-text {
        width: 100%;
    }

    .card-rich-content {
        font-size: 15px;
        line-height: 1.62;
    }

    .card-rich-content h2 {
        font-size: clamp(24px, 8.2vw, 34px);
    }

    .card-rich-content h3 {
        font-size: clamp(20px, 7vw, 28px);
    }

    .card-gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card-gallery-item img {
        aspect-ratio: 3 / 4;
    }

    .card-page-title,
    .card-kuula-title {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .card-media-section iframe,
    .card-media-section img {
        max-width: 100%;
    }

    .card-video-block {
        width: min(440px, 100%);
        margin-left: auto;
        margin-right: auto;
    }

    .card-video-block iframe {
        aspect-ratio: 9 / 16;
        min-height: 66vh;
        max-height: 78vh;
    }
}
