:root {
    --ke-red: #ba0c2f;
    --ke-red-dark: #850921;
    --ke-black: #101114;
    --ke-charcoal: #1d2025;
    --ke-gray-900: #282b31;
    --ke-gray-700: #5a5f69;
    --ke-gray-300: #d9dce1;
    --ke-gray-100: #f3f4f6;
    --ke-white: #ffffff;
    --ke-width: 1240px;
    --ke-radius: 14px;
    --ke-shadow: 0 14px 38px rgba(16, 17, 20, .09);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ke-gray-900);
    background: var(--ke-white);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.65;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--ke-red);
}

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

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

.ke-content-width {
    max-width: 850px;
}

.site-header {
    position: relative;
    z-index: 20;
    background: var(--ke-white);
    border-bottom: 1px solid var(--ke-gray-300);
}

.site-header-inner {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.site-branding {
    flex: 0 1 auto;
}

.custom-logo {
    max-width: 220px;
    max-height: 70px;
    width: auto;
}

.site-name {
    display: block;
    color: var(--ke-black);
    font-size: 28px;
    font-weight: 900;
    line-height: 1.05;
    text-decoration: none;
}

.site-description {
    display: block;
    margin-top: 4px;
    color: var(--ke-gray-700);
    font-size: 12px;
}

.primary-navigation ul,
.ke-fallback-menu {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-navigation a {
    color: var(--ke-black);
    font-weight: 700;
    text-decoration: none;
}

.primary-navigation a:hover {
    color: var(--ke-red);
}

.ke-menu-toggle {
    display: none;
    padding: 9px 14px;
    color: var(--ke-white);
    background: var(--ke-black);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

.ke-hero {
    padding: 94px 0;
    color: var(--ke-white);
    background:
        radial-gradient(circle at 85% 20%, rgba(186, 12, 47, .4), transparent 32%),
        linear-gradient(120deg, #0d0e11 0%, #1d2025 70%, #27040d 100%);
}

.ke-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .65fr);
    align-items: center;
    gap: 60px;
}

.ke-hero h1 {
    max-width: 760px;
    margin: 8px 0 22px;
    font-size: clamp(44px, 7vw, 78px);
    line-height: 1;
    letter-spacing: -.04em;
}

.ke-hero p {
    max-width: 710px;
    margin: 0;
    color: #e1e3e7;
    font-size: 19px;
}

.ke-eyebrow {
    display: inline-block;
    color: var(--ke-red);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.ke-hero .ke-eyebrow {
    color: #ff708d;
}

.ke-hero-panel {
    padding: 30px;
    color: var(--ke-black);
    background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: var(--ke-radius);
    box-shadow: 0 25px 70px rgba(0, 0, 0, .25);
}

.ke-panel-label {
    color: var(--ke-red);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.ke-hero-panel h2 {
    margin: 6px 0 20px;
    font-size: 30px;
    line-height: 1.15;
}

.ke-model-links {
    display: grid;
    gap: 9px;
}

.ke-model-links a {
    padding: 11px 14px;
    color: var(--ke-black);
    background: var(--ke-gray-100);
    border-left: 4px solid transparent;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
}

.ke-model-links a:hover {
    border-left-color: var(--ke-red);
}

.ke-engine-search {
    display: flex;
    max-width: 720px;
    margin: 30px 0;
}

.ke-engine-search input {
    min-width: 0;
    flex: 1;
    padding: 16px 18px;
    color: var(--ke-black);
    background: var(--ke-white);
    border: 0;
    border-radius: 8px 0 0 8px;
    outline: none;
}

.ke-engine-search button {
    padding: 16px 22px;
    color: var(--ke-white);
    background: var(--ke-red);
    border: 0;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-weight: 900;
}

.ke-engine-search button:hover {
    background: var(--ke-red-dark);
}

.ke-button {
    display: inline-flex;
    min-height: 48px;
    padding: 12px 22px;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-weight: 900;
    text-decoration: none;
}

.ke-button-primary {
    color: var(--ke-white);
    background: var(--ke-red);
}

.ke-button-primary:hover {
    background: var(--ke-red-dark);
}

.ke-button-secondary {
    color: var(--ke-black);
    background: var(--ke-white);
}

.ke-button-light {
    color: var(--ke-black);
    background: #301da6;
}

.ke-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ke-section {
    padding: 72px 0;
}

.ke-section-muted {
    background: var(--ke-gray-100);
}

.ke-section-heading {
    display: flex;
    margin-bottom: 30px;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.ke-section-heading h2 {
    margin: 4px 0 0;
    color: var(--ke-black);
    font-size: 38px;
    line-height: 1.1;
}

.ke-engine-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.ke-engine-card {
    overflow: hidden;
    background: var(--ke-white);
    border: 1px solid var(--ke-gray-300);
    border-radius: var(--ke-radius);
    box-shadow: var(--ke-shadow);
}

.ke-engine-card-image {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background:
        radial-gradient(circle at 70% 20%, rgba(186, 12, 47, .28), transparent 32%),
        linear-gradient(135deg, #1d2025, #0b0c0f);
}

.ke-engine-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.ke-engine-card:hover .ke-engine-card-image img {
    transform: scale(1.035);
}

.ke-no-photo {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--ke-white);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: .04em;
}

.ke-engine-card-body {
    padding: 24px;
}

.ke-engine-card h2 {
    margin: 7px 0 12px;
    font-size: 24px;
    line-height: 1.2;
}

.ke-engine-card h2 a {
    color: var(--ke-black);
    text-decoration: none;
}

.ke-engine-card h2 a:hover {
    color: var(--ke-red);
}

.ke-engine-code {
    color: var(--ke-red);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.ke-engine-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.ke-engine-card-meta span {
    padding: 5px 9px;
    color: var(--ke-gray-700);
    background: var(--ke-gray-100);
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
}

.ke-text-link {
    font-weight: 800;
    text-decoration: none;
}

.ke-info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 25px;
}

.ke-info-card {
    position: relative;
    padding: 32px;
    overflow: hidden;
    background: var(--ke-white);
    border: 1px solid var(--ke-gray-300);
    border-radius: var(--ke-radius);
}

.ke-card-number {
    position: absolute;
    top: 10px;
    right: 18px;
    color: rgba(186, 12, 47, .1);
    font-size: 70px;
    font-weight: 900;
    line-height: 1;
}

.ke-info-card h2 {
    position: relative;
    margin-top: 0;
}

.ke-info-card a {
    position: relative;
    font-weight: 800;
    text-decoration: none;
}

.ke-page-header {
    padding: 62px 0;
    color: var(--ke-white);
    background:
        radial-gradient(circle at 85% 0%, rgba(186, 12, 47, .4), transparent 28%),
        var(--ke-black);
}

.ke-page-header h1 {
    max-width: 950px;
    margin: 6px 0 12px;
    font-size: clamp(40px, 6vw, 66px);
    line-height: 1.06;
    letter-spacing: -.035em;
}

.ke-page-header p,
.ke-term-description {
    max-width: 780px;
    color: #d7d9dd;
    font-size: 18px;
}

.ke-engine-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 48px;
}

.ke-engine-featured-image {
    margin-bottom: 36px;
}

.ke-engine-featured-image img {
    width: 100%;
    border-radius: var(--ke-radius);
}

.ke-content-section {
    margin-top: 42px;
}

.ke-content-section h2 {
    color: var(--ke-black);
    font-size: 30px;
    line-height: 1.2;
}

.ke-disclaimer {
    padding: 24px;
    background: #fff8e7;
    border-left: 5px solid #d7a21a;
    border-radius: 6px;
}

.ke-specification-panel,
.ke-sidebar-cta {
    padding: 26px;
    margin-bottom: 25px;
    background: var(--ke-white);
    border: 1px solid var(--ke-gray-300);
    border-radius: var(--ke-radius);
    box-shadow: var(--ke-shadow);
}

.ke-specification-panel h2,
.ke-sidebar-cta h2 {
    margin-top: 0;
}

.ke-specification-panel dl {
    margin: 0;
}

.ke-specification-panel dl div {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--ke-gray-300);
}

.ke-specification-panel dl div:last-child {
    border-bottom: 0;
}

.ke-specification-panel dt {
    font-weight: 800;
}

.ke-specification-panel dd {
    margin: 0;
    text-align: right;
}

.ke-sidebar-cta {
    color: var(--ke-white);
    background: var(--ke-black);
    border-color: var(--ke-black);
}

.ke-karking-ad {
    position: relative;
    overflow: hidden;
    padding: 42px;
    color: var(--ke-white);
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .13), transparent 27%),
        linear-gradient(115deg, var(--ke-red-dark), var(--ke-red) 48%, #1a1c21);
    border-radius: var(--ke-radius);
    box-shadow: var(--ke-shadow);
}

.ke-karking-ad h2 {
    max-width: 720px;
    margin: 6px 0 10px;
    font-size: 34px;
    line-height: 1.15;
}

.ke-karking-ad p {
    max-width: 720px;
    color: #f5dfe4;
}

.ke-ad-label {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ke-empty-state {
    padding: 42px;
    text-align: center;
    background: var(--ke-gray-100);
    border: 1px dashed #b6bac2;
    border-radius: var(--ke-radius);
}

.ke-standard-post {
    padding: 28px 0;
    border-bottom: 1px solid var(--ke-gray-300);
}

.ke-standard-post h2 {
    margin-top: 0;
}

.ke-standard-post h2 a {
    color: var(--ke-black);
    text-decoration: none;
}

.ke-pagination {
    margin-top: 40px;
}

.ke-error-page {
    min-height: 65vh;
    display: flex;
    align-items: center;
}

.site-footer {
    padding-top: 58px;
    color: #d5d7da;
    background: var(--ke-black);
}

.site-footer h2 {
    color: var(--ke-white);
}

.site-footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-footer a {
    color: var(--ke-white);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr .7fr;
    gap: 42px;
}

.footer-bottom {
    padding: 18px 0;
    margin-top: 48px;
    background: #08090b;
    font-size: 13px;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 920px) {
    .ke-menu-toggle {
        display: inline-flex;
    }

    .primary-navigation {
        display: none;
        position: absolute;
        top: 82px;
        left: 20px;
        right: 20px;
        padding: 18px;
        background: var(--ke-white);
        border: 1px solid var(--ke-gray-300);
        border-radius: 10px;
        box-shadow: var(--ke-shadow);
    }

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

    .primary-navigation ul,
    .ke-fallback-menu {
        align-items: stretch;
        flex-direction: column;
        gap: 5px;
    }

    .primary-navigation a {
        display: block;
        padding: 10px;
    }

    .ke-hero-grid,
    .ke-engine-layout {
        grid-template-columns: 1fr;
    }

    .ke-engine-grid,
    .ke-info-grid,
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ke-container {
        width: min(calc(100% - 24px), var(--ke-width));
    }

    .site-header-inner {
        min-height: 74px;
    }

    .primary-navigation {
        top: 74px;
        left: 12px;
        right: 12px;
    }

    .site-description {
        display: none;
    }

    .ke-hero {
        padding: 58px 0;
    }

    .ke-section {
        padding: 52px 0;
    }

    .ke-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .ke-engine-grid,
    .ke-info-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .ke-engine-search {
        display: grid;
        gap: 8px;
    }

    .ke-engine-search input,
    .ke-engine-search button {
        border-radius: 7px;
    }

    .ke-karking-ad {
        padding: 28px;
    }
}

/* Kia Engines branding */
.ke-brand-logo {
    display: block;
    width: min(360px, 48vw);
    text-decoration: none;
}

.ke-brand-logo img {
    display: block;
    width: 100%;
    height: auto;
}

.ke-engine-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ke-default-engine-image {
    margin-bottom: 36px;
    overflow: hidden;
    border-radius: var(--ke-radius);
    box-shadow: var(--ke-shadow);
}

.ke-default-engine-image img {
    width: 100%;
    height: auto;
}

@media (max-width: 640px) {
    .ke-brand-logo {
        width: min(255px, 66vw);
    }
}

/* Corrected desktop header sizing */
.site-header-inner {
    min-height: 88px;
    gap: 28px;
}

.site-branding {
    flex: 0 0 auto;
}

.ke-brand-logo {
    width: 390px;
    max-width: 100%;
}

.ke-brand-logo img {
    width: 100%;
    height: auto;
}

.primary-navigation {
    margin-left: auto;
}

.primary-navigation ul,
.ke-fallback-menu {
    gap: 25px;
}

.primary-navigation a {
    font-size: 16px;
    white-space: nowrap;
}

@media (max-width: 1250px) {
    .ke-brand-logo {
        width: 330px;
    }

    .primary-navigation ul,
    .ke-fallback-menu {
        gap: 17px;
    }

    .primary-navigation a {
        font-size: 15px;
    }
}

@media (max-width: 1020px) {
    .ke-brand-logo {
        width: 300px;
    }
}

@media (max-width: 920px) {
    .site-header-inner {
        min-height: 78px;
    }

    .ke-brand-logo {
        width: 285px;
    }

    .primary-navigation {
        top: 78px;
    }
}

@media (max-width: 640px) {
    .ke-brand-logo {
        width: 245px;
    }
}

/* =========================================================
   Center the complete website inside a 1200px container
   ========================================================= */

:root {
    --ke-width: 1200px;
}

html {
    background: #eceef1;
}

body {
    background: #eceef1;
}

/*
 * Header, page content and footer all share the same
 * centered maximum width.
 */
.site-header,
.site-main,
.site-footer {
    width: 100%;
    max-width: 1200px;
    margin-right: auto;
    margin-left: auto;
}

/* White site surface */
.site-header,
.site-main {
    background: var(--ke-white);
}

/*
 * Inner content uses the available width while maintaining
 * comfortable left and right padding.
 */
.ke-container {
    width: 100%;
    max-width: 1200px;
    padding-right: 30px;
    padding-left: 30px;
    margin-right: auto;
    margin-left: auto;
}

/* Keep the header inside the same 1200px boundary */
.site-header-inner {
    width: 100%;
    max-width: 1200px;
}

/* Prevent wide media from escaping the site container */
.site-main img,
.site-footer img {
    max-width: 100%;
}

/* Add a subtle edge around the complete desktop site */
@media (min-width: 1201px) {
    .site-header,
    .site-main,
    .site-footer {
        border-right: 1px solid #d9dce1;
        border-left: 1px solid #d9dce1;
    }

    .site-header {
        margin-top: 12px;
        border-top: 1px solid #d9dce1;
        border-radius: 14px 14px 0 0;
    }

    .site-footer {
        margin-bottom: 12px;
        border-radius: 0 0 14px 14px;
    }
}

/* Tablet spacing */
@media (max-width: 920px) {
    .ke-container {
        padding-right: 22px;
        padding-left: 22px;
    }
}

/* Mobile spacing */
@media (max-width: 640px) {
    .ke-container {
        padding-right: 16px;
        padding-left: 16px;
    }

    .site-header {
        margin-top: 0;
        border-radius: 0;
    }

    .site-footer {
        margin-bottom: 0;
        border-radius: 0;
    }
}

/* =========================================================
   Prevent header navigation from leaving the 1200px container
   ========================================================= */

.site-header-inner {
    display: flex;
    width: 100%;
    max-width: 1200px;
    min-width: 0;
    padding-right: 24px;
    padding-left: 24px;
    gap: 22px;
}

.site-branding {
    min-width: 0;
    flex: 0 1 360px;
}

.ke-brand-logo {
    width: 100%;
    max-width: 360px;
}

.primary-navigation {
    min-width: 0;
    flex: 1 1 auto;
    margin-left: auto;
}

.primary-navigation ul,
.ke-fallback-menu {
    justify-content: flex-end;
    gap: clamp(12px, 1.25vw, 22px);
}

.primary-navigation li {
    flex: 0 0 auto;
}

.primary-navigation a {
    font-size: clamp(14px, 1.05vw, 16px);
    white-space: nowrap;
}

/*
 * Switch to the menu button before the desktop navigation
 * becomes wider than the available space.
 */
@media (max-width: 1120px) {
    .ke-menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .primary-navigation {
        display: none;
        position: absolute;
        top: 88px;
        right: 24px;
        left: 24px;
        width: auto;
        padding: 18px;
        background: var(--ke-white);
        border: 1px solid var(--ke-gray-300);
        border-radius: 10px;
        box-shadow: var(--ke-shadow);
    }

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

    .primary-navigation ul,
    .ke-fallback-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .primary-navigation a {
        display: block;
        padding: 10px 12px;
        font-size: 16px;
    }
}

@media (max-width: 640px) {
    .site-header-inner {
        padding-right: 16px;
        padding-left: 16px;
    }

    .site-branding {
        flex-basis: 250px;
    }

    .ke-brand-logo {
        max-width: 250px;
    }

    .primary-navigation {
        top: 78px;
        right: 16px;
        left: 16px;
    }
}

/* About page cards */
.ke-about-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
}

.ke-about-card {
    position: relative;
    min-height: 260px;
    padding: 34px;
    overflow: hidden;
    background: var(--ke-white);
    border: 1px solid var(--ke-gray-300);
    border-radius: var(--ke-radius);
    box-shadow: var(--ke-shadow);
}

.ke-about-card:first-child {
    grid-column: span 2;
}

.ke-about-card h2 {
    position: relative;
    margin: 0 0 18px;
    color: var(--ke-black);
    font-size: 30px;
    line-height: 1.2;
}

.ke-about-card p {
    position: relative;
    max-width: 820px;
    margin: 0 0 16px;
    color: var(--ke-gray-700);
}

.ke-about-card-number {
    position: absolute;
    top: 16px;
    right: 24px;
    color: rgba(186, 12, 47, .09);
    font-size: 76px;
    font-weight: 900;
    line-height: 1;
}

.ke-about-card-featured {
    color: var(--ke-white);
    background:
        radial-gradient(
            circle at 85% 15%,
            rgba(255, 255, 255, .12),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            var(--ke-red-dark),
            var(--ke-red) 55%,
            var(--ke-black)
        );
    border-color: transparent;
}

.ke-about-card-featured h2,
.ke-about-card-featured p {
    color: var(--ke-white);
}

.ke-about-card-featured .ke-about-card-number {
    color: rgba(255, 255, 255, .12);
}

.ke-about-card-featured .ke-button {
    margin-top: 10px;
}

@media (max-width: 760px) {
    .ke-about-grid {
        grid-template-columns: 1fr;
    }

    .ke-about-card:first-child {
        grid-column: auto;
    }

    .ke-about-card {
        min-height: 0;
        padding: 26px;
    }
}
