/*
 * KLT Theme — main stylesheet
 *
 * All visual styling for the theme. Color, typography, container width,
 * and breakpoints are driven by CSS custom properties set on :root by
 * the inline block in functions.php (klt_customizer_inline_css).
 * Override anything here in the Customizer; you generally shouldn't
 * need to edit this file directly.
 *
 * Section order:
 *   1. Reset & base
 *   2. Layout helpers (.klt-container, .klt-main, .klt-row)
 *   3. Header
 *   4. Primary navigation
 *   5. Footer
 *   6. Sidebar / widgets
 *   7. Content (entries, archives, single, page)
 *   8. Search results
 *   9. 404
 *  10. Comments
 *  11. Forms / buttons
 *  12. Visual editor compat
 *  13. Responsive (tablet & mobile)
 */


/* =========================================================
 * 1. Reset & base
 * ======================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background-color: var(--st-bg, #fff);
    color: var(--st-text, #222);
    font-family: var(--st-body-font, system-ui, sans-serif);
    font-size: var(--st-body-size, 16px);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video,
iframe {
    max-width: 100%;
    height: auto;
}

img {
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--st-head-font, inherit);
    color: var(--st-heading, #111);
    line-height: 1.2;
    margin: 0 0 0.6em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p {
    margin: 0 0 1em;
}

a {
    color: var(--st-link, #0073aa);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s ease;
}

a:hover,
a:focus {
    color: var(--st-link-hover, #005177);
}

hr {
    border: 0;
    border-top: 1px solid var(--st-border, #e5e5e5);
    margin: 2rem 0;
}

blockquote {
    margin: 1.5em 0;
    padding: 0.5em 1em;
    border-left: 4px solid var(--st-accent, #0073aa);
    background: rgba(0, 0, 0, 0.025);
    color: var(--st-muted, #666);
    font-style: italic;
}

code,
pre,
kbd,
samp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
}

pre {
    background: #1e1e1e;
    color: #f8f8f2;
    padding: 1em;
    overflow-x: auto;
    border-radius: 4px;
}

code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.15em 0.35em;
    border-radius: 3px;
}

pre code {
    background: transparent;
    padding: 0;
}

/* Accessibility */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100000;
    padding: 0.75em 1em;
    background: #fff;
    color: #000;
    text-decoration: none;
    font-weight: 600;
    border: 2px solid var(--st-accent, #0073aa);
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

:focus-visible {
    outline: 2px solid var(--st-accent, #0073aa);
    outline-offset: 2px;
}


/* =========================================================
 * 2. Layout helpers
 * ======================================================= */
.klt-container {
    width: 100%;
    max-width: var(--st-container, 1180px);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.klt-main {
    padding: 2rem 0;
}

/* full-page layout: no .klt-container is rendered, content is edge-to-edge */
.klt-main.klt-layout-full-page {
    padding: 0;
}

/* When sidebar is present we use a 2-column grid */
.klt-main .klt-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.klt-main.has-sidebar .klt-row {
    grid-template-columns: minmax(0, 1fr) 320px;
}

.klt-main.klt-layout-sidebar-left.has-sidebar .klt-row {
    grid-template-columns: 320px minmax(0, 1fr);
}

.klt-main.klt-layout-sidebar-left .klt-content {
    order: 2;
}

.klt-main.klt-layout-sidebar-left .klt-sidebar {
    order: 1;
}


/* =========================================================
 * 3. Header
 * ======================================================= */
.klt-site-header {
    background: var(--st-header-bg, #fff);
    color: var(--st-header-text, #111);
    border-bottom: 1px solid var(--st-border, #e5e5e5);
    position: relative;
    z-index: 50;
}

.klt-site-header.is-sticky {
    position: sticky;
    top: 0;
}

.klt-site-header .klt-header-inner {
    width: 100%;
    max-width: var(--st-container, 1180px);
    margin: 0 auto;
    padding: var(--st-header-padding, 20px) 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.klt-site-header.is-full-width .klt-header-inner {
    max-width: none;
}

.klt-site-branding {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.klt-site-branding .custom-logo-link {
    display: inline-block;
    line-height: 0;
}

.klt-site-branding .custom-logo {
    max-height: 60px;
    width: auto;
}

.klt-site-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--st-header-text, #111);
    text-decoration: none;
    line-height: 1.1;
}

.klt-site-tagline {
    font-size: 0.85rem;
    color: var(--st-muted, #666);
    margin: 0;
}

.klt-header-nav-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Layout variants */
.klt-site-header.layout-logo-right-menu-left .klt-header-inner {
    flex-direction: row-reverse;
}

.klt-site-header.layout-logo-center-menu-below .klt-header-inner {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.klt-site-header.layout-logo-center-menu-below .klt-header-nav-wrap {
    width: 100%;
    justify-content: center;
}

/* Search toggle in header */
.klt-search-toggle {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 0;
    border-radius: 4px;
}

.klt-search-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.klt-header-search {
    border-top: 1px solid var(--st-border, #e5e5e5);
    padding: 1rem 0;
    background: var(--st-header-bg, #fff);
}

.klt-header-search[hidden] {
    display: none;
}

.klt-header-search .klt-search-form {
    max-width: 600px;
    margin: 0 auto;
}

.klt-mobile-toggle {
    display: none; /* shown via media query */
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 0;
    border-radius: 4px;
}

.klt-mobile-toggle svg + svg {
    display: none;
}

body.menu-open .klt-mobile-toggle svg:first-child {
    display: none;
}

body.menu-open .klt-mobile-toggle svg + svg {
    display: inline-block;
}


/* =========================================================
 * 4. Primary navigation
 * ======================================================= */
.klt-primary-nav .klt-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.klt-primary-nav .klt-menu li {
    position: relative;
}

.klt-primary-nav .klt-menu a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    padding: 0.4rem 0;
    display: inline-block;
}

.klt-primary-nav .klt-menu a:hover,
.klt-primary-nav .klt-menu .current-menu-item > a {
    color: var(--st-accent, #0073aa);
}

/* Submenus (desktop) */
.klt-primary-nav .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    background: var(--st-header-bg, #fff);
    border: 1px solid var(--st-border, #e5e5e5);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
    z-index: 60;
}

.klt-primary-nav .sub-menu .sub-menu {
    top: 0;
    left: 100%;
}

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

.klt-primary-nav .sub-menu a {
    display: block;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

.klt-submenu-toggle {
    display: none; /* shown on mobile */
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    font-size: 1rem;
}

.klt-nav-empty {
    color: var(--st-muted, #666);
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px dashed var(--st-border, #e5e5e5);
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}


/* =========================================================
 * 5. Footer
 * ======================================================= */
.klt-site-footer {
    background: var(--st-footer-bg, #1a1a1a);
    color: var(--st-footer-text, #ccc);
    margin-top: 4rem;
    padding-top: 3rem;
}

.klt-site-footer a {
    color: var(--st-footer-text, #ccc);
}

.klt-site-footer a:hover {
    color: #fff;
}

.klt-footer-widgets {
    width: 100%;
    max-width: var(--st-container, 1180px);
    margin: 0 auto 2.5rem;
    padding: 0 1.25rem;
    display: grid;
    gap: 2rem;
}

.klt-site-footer.is-full-width .klt-footer-widgets {
    max-width: none;
}

.klt-footer-widgets[data-cols="1"] { grid-template-columns: 1fr; }
.klt-footer-widgets[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.klt-footer-widgets[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.klt-footer-widgets[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.klt-footer-col .widget-title {
    color: #fff;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

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

.klt-footer-col ul li {
    margin-bottom: 0.4rem;
}

.klt-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 0;
    font-size: 0.9rem;
}

.klt-footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.klt-footer-menu,
.klt-social-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.klt-footer-menu a,
.klt-social-menu a {
    text-decoration: none;
}


/* =========================================================
 * 6. Sidebar / widgets
 * ======================================================= */
.klt-sidebar {
    min-width: 0;
}

.klt-sidebar .widget {
    margin-bottom: 2rem;
}

.klt-sidebar .widget:last-child {
    margin-bottom: 0;
}

.klt-sidebar .widget-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--st-border, #e5e5e5);
}

.klt-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.klt-sidebar ul li {
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--st-border, #e5e5e5);
}

.klt-sidebar ul li:last-child {
    border-bottom: 0;
}


/* =========================================================
 * 7. Content
 * ======================================================= */
.klt-content {
    min-width: 0;
}

.klt-page-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--st-border, #e5e5e5);
}

.klt-page-title {
    margin: 0 0 0.5rem;
}

.klt-archive-description {
    color: var(--st-muted, #666);
    font-size: 1.05rem;
}

/* Loop layouts */
.klt-loop.layout-list .klt-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--st-border, #e5e5e5);
}

.klt-loop.layout-list .klt-card:first-child { padding-top: 0; }
.klt-loop.layout-list .klt-card:last-child { border-bottom: 0; }

.klt-loop.layout-list .klt-card:has(.klt-card-thumb) {
    grid-template-columns: 280px minmax(0, 1fr);
}

.klt-loop.layout-grid-2,
.klt-loop.layout-grid-3 {
    display: grid;
    gap: 2rem;
}

.klt-loop.layout-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.klt-loop.layout-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.klt-loop.layout-grid-2 .klt-card,
.klt-loop.layout-grid-3 .klt-card {
    background: #fff;
    border: 1px solid var(--st-border, #e5e5e5);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.klt-loop.layout-grid-2 .klt-card-body,
.klt-loop.layout-grid-3 .klt-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.klt-card-thumb {
    display: block;
    overflow: hidden;
    border-radius: 4px;
}

.klt-card-thumb img {
    transition: transform 0.3s ease;
    width: 100%;
}

.klt-card:hover .klt-card-thumb img {
    transform: scale(1.03);
}

.klt-card-title {
    margin: 0 0 0.4rem;
    font-size: 1.4rem;
    line-height: 1.25;
}

.klt-card-title a {
    color: var(--st-heading, #111);
    text-decoration: none;
}

.klt-card-title a:hover {
    color: var(--st-accent, #0073aa);
}

.klt-card-excerpt {
    color: var(--st-text, #222);
}

.klt-post-meta {
    color: var(--st-muted, #666);
    font-size: 0.9rem;
    margin: 0.5rem 0 1rem;
}

.klt-post-meta a {
    color: inherit;
}

.klt-meta-sep {
    margin: 0 0.4rem;
}

.klt-link-arrow {
    font-weight: 600;
    text-decoration: none;
}

.klt-link-arrow:hover {
    text-decoration: underline;
}

/* Single post / page */
.klt-single-post .klt-entry-header,
.klt-single-page .klt-entry-header {
    margin-bottom: 1.5rem;
}

.klt-entry-title {
    font-size: 2.4rem;
    line-height: 1.15;
    margin-bottom: 0.5rem;
}

.klt-featured-image {
    margin: 0 0 2rem;
}

.klt-featured-image img {
    width: 100%;
    border-radius: 6px;
}

.klt-entry-content > *:first-child { margin-top: 0; }
.klt-entry-content > *:last-child { margin-bottom: 0; }

.klt-entry-content h2 { margin-top: 1.8em; }
.klt-entry-content h3 { margin-top: 1.5em; }

.klt-entry-content ul,
.klt-entry-content ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
}

.klt-entry-content figure {
    margin: 1.5em 0;
}

.klt-entry-footer {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--st-border, #e5e5e5);
    font-size: 0.95rem;
    color: var(--st-muted, #666);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.klt-entry-footer a {
    color: inherit;
}

.klt-tag {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.15em 0.5em;
    border-radius: 3px;
    font-size: 0.85em;
}

/* Post navigation */
.post-navigation {
    margin: 3rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--st-border, #e5e5e5);
    border-bottom: 1px solid var(--st-border, #e5e5e5);
}

.post-navigation .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.post-navigation a {
    text-decoration: none;
    display: block;
}

.post-navigation .nav-direction {
    display: block;
    color: var(--st-muted, #666);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.post-navigation .nav-title {
    display: block;
    color: var(--st-heading, #111);
    font-weight: 600;
}

.post-navigation .nav-next {
    text-align: right;
}

/* Pagination */
.pagination,
.posts-navigation {
    margin: 2.5rem 0;
}

.pagination .nav-links,
.posts-navigation .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: #fff;
    border: 1px solid var(--st-border, #e5e5e5);
    border-radius: 4px;
    text-decoration: none;
    color: var(--st-text, #222);
}

.pagination .page-numbers.current {
    background: var(--st-accent, #0073aa);
    color: #fff;
    border-color: var(--st-accent, #0073aa);
}

.pagination .page-numbers:hover:not(.current) {
    background: rgba(0, 0, 0, 0.05);
}


/* =========================================================
 * 8. Search results
 * ======================================================= */
.klt-search-summary {
    color: var(--st-muted, #666);
}

.klt-search-form-inline {
    margin-top: 1rem;
}

.klt-search-result {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--st-border, #e5e5e5);
}

.klt-search-result-title {
    margin-bottom: 0.25rem;
    font-size: 1.3rem;
}

.klt-search-result-title a {
    color: var(--st-heading, #111);
    text-decoration: none;
}

.klt-search-result-title a:hover {
    color: var(--st-accent, #0073aa);
    text-decoration: underline;
}

.klt-search-result-permalink {
    color: var(--st-accent, #0073aa);
    font-size: 0.85rem;
    margin: 0 0 0.5rem;
    word-break: break-word;
}


/* =========================================================
 * 9. 404
 * ======================================================= */
.klt-404 {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
    padding: 3rem 0;
}

.klt-404-code {
    font-size: 7rem;
    font-weight: 800;
    line-height: 1;
    color: var(--st-accent, #0073aa);
    margin: 0 0 0.5rem;
    opacity: 0.85;
    letter-spacing: -0.05em;
}

.klt-404 .klt-page-header {
    border-bottom: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
}

.klt-404-message {
    font-size: 1.1rem;
    color: var(--st-muted, #666);
    margin-bottom: 2rem;
}

.klt-404-search {
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

.klt-404-actions {
    margin-bottom: 3rem;
}

.klt-404-recent {
    text-align: left;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    padding: 1.5rem;
}

.klt-404-recent h2 {
    font-size: 1.1rem;
    margin: 0 0 0.75rem;
}

.klt-404-recent ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.klt-404-recent li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--st-border, #e5e5e5);
}

.klt-404-recent li:last-child {
    border-bottom: 0;
}


/* =========================================================
 * 10. Comments
 * ======================================================= */
.klt-comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--st-border, #e5e5e5);
}

.klt-comments-title {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.klt-comment-list {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
}

.klt-comment-list .comment,
.klt-comment-list .pingback,
.klt-comment-list .trackback {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
}

.klt-comment-list .children {
    list-style: none;
    margin: 1rem 0 0;
    padding-left: 2rem;
}

.klt-comment-list .comment-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--st-muted, #666);
}

.klt-comment-list .avatar {
    border-radius: 50%;
}

.klt-comment-list .comment-author {
    font-weight: 600;
    color: var(--st-text, #222);
}

.comment-respond {
    margin-top: 2rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
}

.comment-form .comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-form .comment-form-cookies-consent label {
    margin-bottom: 0;
    font-weight: 400;
}


/* =========================================================
 * 11. Forms / buttons
 * ======================================================= */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
textarea,
select {
    width: 100%;
    max-width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--st-border, #e5e5e5);
    border-radius: 4px;
    background: #fff;
    color: var(--st-text, #222);
    font: inherit;
    font-size: 1rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--st-accent, #0073aa);
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
    outline: none;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

.klt-button,
button[type="submit"],
input[type="submit"],
.comment-form .submit {
    display: inline-block;
    padding: 0.7em 1.4em;
    background: var(--st-accent, #0073aa);
    color: #fff;
    border: 0;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.05s;
    line-height: 1.2;
}

.klt-button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
    background: var(--st-link-hover, #005177);
    color: #fff;
}

.klt-button:active,
button[type="submit"]:active {
    transform: translateY(1px);
}

/* Search form */
.klt-search-form {
    display: flex;
    gap: 0.5rem;
}

.klt-search-form .klt-search-field {
    flex: 1;
}

.klt-search-form .klt-search-submit {
    padding: 0 1rem;
    line-height: 0;
}


/* =========================================================
 * 12. Visual editor compat
 *
 * The plugin already injects its own reset CSS; these rules
 * are belt-and-brace to make doubly sure that landing pages
 * and editor views are not constrained by the theme.
 * ======================================================= */
.klt-no-chrome {
    background: #fff;
}

.klt-no-chrome .klt-main {
    padding: 0;
}

.klt-no-chrome .klt-content {
    width: 100%;
    max-width: none;
}

.klt-blank-canvas {
    margin: 0;
    padding: 0;
}

/* Make sure tve_editor wrappers from the plugin are full-bleed */
.klt-no-chrome #tve_editor {
    width: 100%;
    max-width: none;
}


/* =========================================================
 * 13. Responsive
 * ======================================================= */

/* Tablet */
@media (max-width: 1024px) {

    .klt-main.has-sidebar .klt-row,
    .klt-main.klt-layout-sidebar-left.has-sidebar .klt-row {
        grid-template-columns: 1fr;
    }

    .klt-main.klt-layout-sidebar-left .klt-content {
        order: 1;
    }

    .klt-main.klt-layout-sidebar-left .klt-sidebar {
        order: 2;
    }

    .klt-loop.layout-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .klt-footer-widgets[data-cols="3"],
    .klt-footer-widgets[data-cols="4"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* Mobile */
@media (max-width: 768px) {

    h1 { font-size: 1.85rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .klt-entry-title { font-size: 1.85rem; }

    /* Mobile menu toggle */
    .klt-mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Hide nav by default on mobile, show when menu-open */
    .klt-header-nav-wrap {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--st-header-bg, #fff);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.25rem;
        gap: 0.5rem;
        border-top: 1px solid var(--st-border, #e5e5e5);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    }

    body.menu-open .klt-header-nav-wrap {
        display: flex;
    }

    .klt-primary-nav .klt-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .klt-primary-nav .klt-menu li {
        border-bottom: 1px solid var(--st-border, #e5e5e5);
    }

    .klt-primary-nav .klt-menu li:last-child {
        border-bottom: 0;
    }

    .klt-primary-nav .klt-menu a {
        display: block;
        padding: 0.75rem 0;
    }

    /* Submenus on mobile become accordions */
    .klt-primary-nav .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 0 0 0 1rem;
        display: none;
    }

    .klt-primary-nav .menu-item-has-children > .sub-menu.is-open {
        display: block;
    }

    .klt-submenu-toggle {
        display: inline-block;
        position: absolute;
        right: 0;
        top: 0.6rem;
    }

    .klt-primary-nav .menu-item-has-children {
        position: relative;
        padding-right: 2rem;
    }

    /* Loop layouts collapse */
    .klt-loop.layout-list .klt-card,
    .klt-loop.layout-list .klt-card:has(.klt-card-thumb) {
        grid-template-columns: 1fr;
    }

    .klt-loop.layout-grid-2,
    .klt-loop.layout-grid-3 {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .klt-footer-widgets[data-cols="2"],
    .klt-footer-widgets[data-cols="3"],
    .klt-footer-widgets[data-cols="4"] {
        grid-template-columns: 1fr;
    }

    .klt-footer-bottom-inner {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .klt-footer-menu,
    .klt-social-menu {
        justify-content: center;
    }

    /* Post navigation stacks */
    .post-navigation .nav-links {
        grid-template-columns: 1fr;
    }

    .post-navigation .nav-next {
        text-align: left;
    }

    /* 404 */
    .klt-404-code {
        font-size: 5rem;
    }
}
