:root {
    --ko-ink: #333333;
    --ko-muted: #68717c;
    --ko-blue: #309dff;
    --ko-link: #1264a3;
    --ko-orange: #f16c00;
    --ko-orange-strong: #b94f00;
    --ko-orange-dark: #a84300;
    --ko-border: #e3e7eb;
    --ko-soft: #f6f8fa;
    --ko-dark: #36393f;
    --ko-white: #ffffff;
    --ko-radius: 16px;
    --ko-shadow: 0 14px 38px rgba(31, 43, 55, 0.08);
    --ko-container: 1240px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: var(--ko-white);
    color: var(--ko-ink);

    font-family: "Quicksand", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;

    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.menu-open {
    overflow: hidden;
}

img {
    display: block;

    max-width: 100%;
    height: auto;
}

figure {
    margin: 0;
}

a {
    color: var(--ko-link);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--ko-orange-strong);
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid rgba(48, 157, 255, 0.38);
    outline-offset: 3px;
}

.site-container {
    width: min(calc(100% - 48px), var(--ko-container));
    margin-inline: auto;
}

.screen-reader-text {
    position: absolute !important;

    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;

    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);

    border: 0;

    white-space: nowrap;
}

.screen-reader-text:focus {
    z-index: 100000;
    top: 10px;
    left: 10px;

    width: auto;
    height: auto;
    padding: 12px 18px;
    margin: 0;

    background: var(--ko-white);
    clip: auto !important;
    clip-path: none;

    color: var(--ko-ink);
    font-weight: 700;
}

/* Header */
.site-header {
    position: relative;
    z-index: 100;

    background: rgba(255, 255, 255, 0.98);
}

.site-header__main {
    position: relative;

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

    min-height: 126px;
    padding-block: 19px 16px;
}

.site-branding {
    display: flex;
    align-items: center;
    flex-direction: column;
}

.site-branding__link,
.custom-logo-link {
    display: block;
}

.site-branding img,
.custom-logo {
    width: 250px;
    max-height: 62px;
    object-fit: contain;
}

.site-branding__slogan {
    margin: 7px 0 0;

    color: #707780;

    font-size: 14px;
    line-height: 1.3;
    letter-spacing: 0.015em;
}

.search-toggle,
.menu-toggle {
    position: absolute;

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

    width: 46px;
    height: 46px;
    padding: 0;

    background: transparent;
    color: var(--ko-ink);

    border: 0;
    border-radius: 50%;

    cursor: pointer;
}

.search-toggle {
    right: 0;
}

.search-toggle:hover,
.menu-toggle:hover {
    background: var(--ko-soft);
}

.search-toggle svg {
    width: 28px;
    height: 28px;

    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 2.2;
}

.menu-toggle {
    left: 0;

    display: none;
    flex-direction: column;

    gap: 5px;
}

.menu-toggle > span:not(.screen-reader-text) {
    width: 23px;
    height: 2px;

    background: currentColor;

    border-radius: 2px;

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

.header-search {
    padding: 18px 0;

    background: var(--ko-soft);

    border-top: 1px solid var(--ko-border);
}

.search-form {
    display: flex;

    width: min(100%, 660px);
    margin-inline: auto;
}

.search-form label {
    flex: 1;
}

.search-field {
    width: 100%;
    height: 50px;
    padding: 0 17px;

    background: var(--ko-white);
    color: var(--ko-ink);

    border: 1px solid #ccd3da;
    border-right: 0;
    border-radius: 12px 0 0 12px;
    outline: 0;
}

.search-field:focus {
    border-color: var(--ko-blue);
    box-shadow: inset 0 0 0 1px var(--ko-blue);
}

.search-submit {
    min-width: 92px;
    padding-inline: 20px;

    background: var(--ko-orange-strong);
    color: var(--ko-white);

    border: 0;
    border-radius: 0 12px 12px 0;

    font-weight: 700;
    cursor: pointer;
}

.search-submit:hover {
    background: var(--ko-orange-dark);
}

/* Navigation */
.main-navigation {
    border-top: 1px solid #eef0f2;
    border-bottom: 1px solid var(--ko-border);
}

.primary-menu,
.primary-menu ul {
    padding: 0;
    margin: 0;

    list-style: none;
}

.primary-menu {
    display: flex;
    align-items: stretch;
    justify-content: center;

    min-height: 70px;
}

.primary-menu > li {
    position: relative;

    display: flex;
    align-items: center;
}

.primary-menu a {
    display: flex;
    align-items: center;

    height: 100%;
    padding: 0 22px;

    color: var(--ko-ink);

    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}

.primary-menu > li > a:hover,
.primary-menu > .current-menu-item > a,
.primary-menu > .current-menu-ancestor > a {
    color: var(--ko-orange-strong);
}

.primary-menu .menu-item-has-children > a::after {
    content: "";

    width: 7px;
    height: 7px;
    margin: -4px 0 0 8px;

    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;

    transform: rotate(45deg);
}

.sub-menu {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;

    min-width: 250px;
    padding: 9px 0 !important;

    background: var(--ko-white);

    border: 1px solid var(--ko-border);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--ko-shadow);

    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);

    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.sub-menu a {
    min-height: 43px;
    padding: 10px 20px;

    font-size: 13px;
    text-align: left;
}

.sub-menu a:hover {
    background: #f6f9fc;
    color: var(--ko-orange-strong);
}

.menu-item-has-children:hover > .sub-menu,
.menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu-toggle {
    display: none;
}

.reading-progress {
    position: fixed;
    z-index: 9997;
    top: 0;
    right: 0;
    left: 0;

    height: 3px;

    pointer-events: none;
}

.reading-progress span {
    display: block;

    width: 100%;
    height: 100%;

    background: linear-gradient(90deg, var(--ko-blue), var(--ko-orange));

    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

/* Main layout */
.site-content {
    padding-block: 46px 80px;
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;

    gap: 44px;
}

.site-main {
    min-width: 0;
}

.page-header {
    margin: 0 0 34px;
    padding: 0 0 24px;

    border-bottom: 1px solid var(--ko-border);
}

.page-header--home {
    border-bottom: 0;
}

.page-header h1,
.entry-title {
    margin: 0;

    color: var(--ko-ink);

    font-size: clamp(30px, 3vw, 42px);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.025em;
}

.page-header p,
.archive-description {
    max-width: 760px;
    margin: 12px 0 0;

    color: var(--ko-muted);

    font-size: 18px;
    line-height: 1.6;
}

.eyebrow {
    display: inline-flex;

    margin-bottom: 12px;
    padding: 6px 12px;

    background: #edf6ff;
    color: #176db4;

    border: 1px solid #d9edff;
    border-radius: 999px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

/* Post cards */
.post-list {
    display: grid;

    gap: 34px;
}

.post-card {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);

    gap: 34px;

    padding-bottom: 34px;

    border-bottom: 1px solid var(--ko-border);

    animation: koblog-card-in 0.42s ease both;
}

@keyframes koblog-card-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.post-card .post-thumbnail {
    align-self: start;

    display: block;

    overflow: hidden;

    background: var(--ko-soft);

    border-radius: 13px;
}

.post-card .post-thumbnail img {
    width: 100%;
    aspect-ratio: 1.55 / 1;

    object-fit: cover;

    transition: transform 0.35s ease;
}

.post-card .post-thumbnail:hover img {
    transform: scale(1.025);
}

.post-card__content {
    align-self: center;
}

.post-card__category {
    min-height: 18px;
    margin-bottom: 7px;

    color: var(--ko-orange-strong);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.post-card__category a {
    color: inherit;
    text-decoration: none;
}

.post-card__title {
    margin: 0 0 10px;

    font-size: clamp(21px, 2vw, 27px);
    line-height: 1.28;
}

.post-card__title a {
    color: #202226;
    text-decoration: none;
}

.post-card__title a:hover {
    color: var(--ko-orange-strong);
}

.post-card__excerpt,
.post-card__excerpt p {
    margin: 0;

    color: #555e68;

    font-size: 15px;
    line-height: 1.65;
}

.post-card__more {
    display: inline-flex;
    align-items: center;

    gap: 8px;

    margin-top: 15px;

    color: var(--ko-link);

    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.post-card__more span {
    transition: transform 0.2s ease;
}

.post-card__more:hover span {
    transform: translateX(4px);
}

/* Infinite loader and pagination */
.infinite-loader {
    display: flex;
    align-items: center;
    flex-direction: column;

    min-height: 110px;
    padding-top: 34px;
}

.load-more-button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;
    padding: 0 22px;

    background: var(--ko-orange-strong);
    color: var(--ko-white);

    border: 0;
    border-radius: 12px;
    box-shadow: 0 9px 22px rgba(241, 108, 0, 0.18);

    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.load-more-button:hover,
.button-link:hover {
    background: var(--ko-orange-dark);
    color: var(--ko-white);
}

.load-more-button:disabled {
    opacity: 0.68;
    cursor: wait;
}

.infinite-loader__status {
    margin: 11px 0 0;

    color: var(--ko-muted);

    font-size: 13px;
}

.navigation.pagination {
    margin-top: 38px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 42px;
    height: 42px;
    padding: 0 12px;

    background: var(--ko-soft);
    color: var(--ko-ink);

    border-radius: 10px;

    text-decoration: none;
}

.page-numbers.current,
.page-numbers:hover {
    background: var(--ko-orange-strong);
    color: var(--ko-white);
}

/* Sidebar */
.widget-area {
    min-width: 0;
    padding-left: 34px;

    border-left: 1px solid var(--ko-border);
}

.sidebar-brand {
    margin: 0 0 34px;
    padding: 4px 3px 7px;
}

.sidebar-brand__logo {
    display: block;

    width: min(100%, 220px);
    margin: 0 auto 20px;
}

.sidebar-brand__logo img {
    width: 100%;
}

.sidebar-brand p {
    margin: 0 0 19px;

    color: #454b52;

    font-size: 15px;
    line-height: 1.6;
}

.sidebar-brand__links {
    margin-bottom: 0;
}

.sidebar-section,
.widget {
    margin: 0 0 34px;
}

.sidebar-section__title,
.widget-title {
    margin: 0 0 14px;
    padding: 10px 14px;

    background: var(--ko-dark);
    color: var(--ko-white);

    border-left: 4px solid var(--ko-orange);
    border-radius: 3px;

    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-transform: uppercase;
}

.sidebar-links,
.widget ul,
.widget ol {
    margin: 0;
    padding-left: 24px;
}

.sidebar-links li,
.widget li {
    margin: 0 0 9px;
    padding-left: 2px;
}

.sidebar-links li::marker,
.widget li::marker {
    color: var(--ko-orange);
    font-size: 0.85em;
}

.sidebar-links a,
.widget a {
    color: var(--ko-link);

    font-size: 15px;
    line-height: 1.45;
}

/* Single entry */
.entry-header {
    margin-bottom: 25px;
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;

    gap: 6px 9px;

    margin-top: 13px;

    color: var(--ko-muted);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.025em;
}

.entry-featured {
    margin: 0 0 30px;

    overflow: hidden;

    background: var(--ko-soft);

    border-radius: 14px;
}

.entry-featured img {
    width: 100%;
}

.entry-content {
    color: #35383c;

    font-size: 17px;
    line-height: 1.82;
}

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

.entry-content p,
.entry-content ul,
.entry-content ol {
    margin-top: 0;
    margin-bottom: 1.35em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin: 1.55em 0 0.62em;

    color: #24262a;

    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.018em;
}

.entry-content h2 {
    font-size: clamp(26px, 2.7vw, 34px);
}

.entry-content h3 {
    font-size: clamp(22px, 2.2vw, 28px);
}

.entry-content h4 {
    font-size: 20px;
}

.entry-content blockquote {
    margin: 32px 0;
    padding: 23px 26px;

    background: #f3f8fd;

    border-left: 4px solid var(--ko-blue);
    border-radius: 0 12px 12px 0;
}

.entry-content blockquote p:last-child {
    margin-bottom: 0;
}

.entry-content img {
    border-radius: 10px;
}

.entry-content table {
    display: block;

    width: 100%;
    margin: 28px 0;

    overflow-x: auto;
    border-collapse: collapse;
}

.entry-content th,
.entry-content td {
    padding: 12px 14px;

    border: 1px solid var(--ko-border);

    text-align: left;
}

.entry-content th {
    background: var(--ko-soft);
}

.entry-footer {
    margin-top: 34px;
    padding-top: 20px;

    border-top: 1px solid var(--ko-border);
}

.tag-links {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;
}

.tag-links a {
    padding: 5px 10px;

    background: var(--ko-soft);

    border-radius: 8px;

    font-size: 12px;
    text-decoration: none;
}

/* Comments and empty states */
.comments-area {
    margin-top: 54px;
    padding-top: 32px;

    border-top: 1px solid var(--ko-border);
}

.comment-list {
    padding: 0;

    list-style: none;
}

.comment-list .comment-body {
    margin-bottom: 18px;
    padding: 20px;

    background: var(--ko-soft);

    border-radius: 12px;
}

.comment-form input:not([type="submit"]):not([type="checkbox"]),
.comment-form textarea {
    width: 100%;
    padding: 12px 14px;

    border: 1px solid #ccd3da;
    border-radius: 10px;
}

.comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.comment-form-cookies-consent input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    accent-color: var(--ko-orange-strong);
}

.comment-form-cookies-consent label {
    margin: 0;
    line-height: 1.55;
    cursor: pointer;
}

.comment-form input[type="submit"] {
    padding: 12px 20px;

    background: var(--ko-orange-strong);
    color: var(--ko-white);

    border: 0;
    border-radius: 10px;

    font-weight: 700;
    cursor: pointer;
}

.no-results,
.error-404 {
    max-width: 720px;
    margin: 30px auto;

    text-align: center;
}

.no-results .search-form,
.error-404 .search-form {
    margin-block: 26px;
}

.error-404__code {
    display: block;

    color: #e8f4ff;

    font-size: clamp(90px, 16vw, 180px);
    font-weight: 700;
    line-height: 0.9;
}

/* Footer */
.site-footer {
    background: #292c31;
    color: #d8dce0;
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 32px;

    padding-block: 42px 32px;
}

.site-footer__brand {
    color: var(--ko-white);

    font-size: 20px;
}

.site-footer p {
    margin: 4px 0 0;

    color: #acb3ba;

    font-size: 13px;
}

.footer-menu {
    display: flex;
    flex-wrap: wrap;

    gap: 10px 24px;
    padding: 0;
    margin: 0;

    list-style: none;
}

.footer-menu a {
    color: #e9ecef;

    font-size: 13px;
    text-decoration: none;
}

.site-footer__bottom {
    padding-block: 18px 28px;

    border-top: 1px solid rgba(255, 255, 255, 0.1);

    color: #929aa2;

    font-size: 12px;
}

/* Responsive */
@media (max-width: 1100px) {
    .primary-menu a {
        padding-inline: 14px;

        font-size: 12px;
    }

    .content-layout {
        grid-template-columns: minmax(0, 1fr) 300px;

        gap: 32px;
    }

    .widget-area {
        padding-left: 27px;
    }

    .post-card {
        grid-template-columns: 240px minmax(0, 1fr);

        gap: 25px;
    }
}

@media (max-width: 980px) {
    .site-header__main {
        min-height: 108px;
    }

    .menu-toggle {
        display: flex;
    }

    .main-navigation {
        display: none;

        max-height: calc(100vh - 108px);

        overflow-y: auto;
    }

    .main-navigation.is-open {
        display: block;
    }

    .primary-menu {
        display: block;

        min-height: 0;
        padding-block: 8px 16px;
    }

    .primary-menu > li {
        display: flex;
        flex-wrap: wrap;

        border-bottom: 1px solid var(--ko-border);
    }

    .primary-menu a {
        justify-content: flex-start;
        flex: 1;

        min-height: 48px;
        padding: 12px 5px;

        font-size: 13px;
        text-align: left;
    }

    .primary-menu .menu-item-has-children > a::after {
        display: none;
    }

    .submenu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;

        width: 48px;
        padding: 0;

        background: transparent;
        color: var(--ko-ink);

        border: 0;

        font-size: 20px;
    }

    .sub-menu {
        position: static;

        display: none;
        flex-basis: 100%;

        min-width: 0;
        padding: 0 0 10px 16px !important;

        border: 0;
        box-shadow: none;

        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .is-submenu-open > .sub-menu {
        display: block;
    }

    .content-layout {
        grid-template-columns: 1fr;
    }

    .widget-area {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 8px 28px;

        padding: 40px 0 0;

        border-top: 1px solid var(--ko-border);
        border-left: 0;
    }
}

@media (max-width: 720px) {
    .site-container {
        width: min(calc(100% - 32px), var(--ko-container));
    }

    .site-header__main {
        min-height: 96px;
        padding-block: 13px;
    }

    .site-branding img,
    .custom-logo {
        width: 205px;
        max-height: 51px;
    }

    .site-branding__slogan {
        margin-top: 5px;

        font-size: 12px;
    }

    .search-toggle,
    .menu-toggle {
        width: 40px;
        height: 40px;
    }

    .search-toggle svg {
        width: 24px;
        height: 24px;
    }

    .site-content {
        padding-block: 32px 58px;
    }

    .page-header {
        margin-bottom: 27px;
    }

    .page-header p {
        font-size: 16px;
    }

    .post-list {
        gap: 29px;
    }

    .post-card {
        grid-template-columns: 1fr;

        gap: 17px;
        padding-bottom: 29px;
    }

    .post-card .post-thumbnail img {
        aspect-ratio: 1.7 / 1;
    }

    .post-card__title {
        font-size: 23px;
    }

    .entry-content {
        font-size: 16px;
        line-height: 1.76;
    }

    .widget-area {
        grid-template-columns: 1fr;
    }

    .site-footer__inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 430px) {
    .site-branding img,
    .custom-logo {
        width: 170px;
    }

    .site-branding__slogan {
        max-width: 170px;

        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
