/* Keep ColorMag's identity; reconcile builder, block and widget styles. */
body { --kreslenie-ink: #2d2640; --kreslenie-purple: #7054c8; --kreslenie-line: #e7e2f0; }
.cm-entry-title, .mzb-post-title, .cm-footer-builder .mzb-post-title { text-transform: none !important; }
.cm-entry-title, .mzb-post-title a { overflow-wrap: anywhere; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #7054c8; outline-offset: 4px; }
.cm-header-builder .cm-header-main-row { padding-block: 18px !important; }
.cm-header-builder .cm-header-top-row { font-size: 12px; }
.cm-header-builder .cm-site-title { font-size: 32px; line-height: 1.2; margin: 0; }
.cm-header-builder .cm-site-title a { font-size: inherit !important; line-height: inherit; }
.cm-header-builder .custom-logo { width: 112px; height: auto; }
.cm-header-builder .cm-primary-nav a { color: #2d2640; }
.cm-header-builder .cm-search-box input { background: #f7f5fc; color: #2d2640; }
.cm-header-builder .cm-search-box svg { fill: #7054c8; }
.cm-header-builder .cm-mobile-nav .cm-mobile-header-row,
.cm-header-builder .cm-mobile-nav .cm-mobile-menu { background: #fff !important; }
.cm-header-builder .cm-mobile-nav li { background: #fff !important; border-color: #e7e2f0 !important; }
.cm-header-builder .cm-mobile-nav li a { color: #2d2640 !important; text-transform: none; }
.cm-header-builder .cm-mobile-nav li.current-menu-item > a,
.cm-header-builder .cm-mobile-nav li a:hover { background: #f1edf9; color: #7054c8 !important; }
.home #cm-content { padding-top: 0; }
.home .cm-entry-summary { padding: 0; }
/* Original homepage blocks and queries remain intact. */
.home .cm-entry-summary > .mzb-section { margin-block: 28px !important; background: #fff !important; }
.home .mzb-post { min-width: 0; }
.home .mzb-post-title, .home .mzb-post-title a { color: #2d2640 !important; text-transform: none !important; }
.home .mzb-post-title a { font: inherit !important; -webkit-line-clamp: unset !important; line-clamp: unset !important; }
.home .mzb-heading-text { color: #2d2640 !important; }
.home .mzb-overlay { display: none !important; }
.home .mzb-featured-image { box-sizing: border-box; border-radius: 5px; }
.home .mzb-banner-posts .mzb-posts { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; grid-template-rows: auto !important; grid-auto-rows: auto; gap: 24px !important; }
.home .mzb-banner-posts .mzb-post { display: flex !important; flex-direction: column; grid-column: auto !important; grid-row: auto !important; height: auto !important; min-height: 0 !important; }
.home .mzb-banner-posts .mzb-featured-image { position: relative; height: 220px !important; flex-shrink: 0; min-height: 0 !important; width: 100% !important; border: 1px solid #eeeaf3; background: #fff; overflow: hidden; }
/* Simply Static can export the image beside its anchor. Keep both structures
   visible and make the entire thumbnail a link without consuming image space. */
.home .mzb-banner-posts .mzb-featured-image > a { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; pointer-events: auto; }
.home .mzb-banner-posts .mzb-featured-image img { width: 100% !important; height: 100% !important; object-fit: contain; }
.home .mzb-banner-posts .mzb-post-content { display: block !important; position: static !important; background: none !important; width: auto !important; height: auto !important; padding: 14px 0 0 !important; }
.home .mzb-banner-posts .mzb-post-title { font: 500 21px/1.4 'IBM Plex Serif', Georgia, serif !important; margin: 8px 0; }
.home .mzb-banner-posts .mzb-post-entry-meta, .home .mzb-banner-posts .mzb-post-entry-meta a { color: #625d70 !important; font-size: 12px !important; }
.home .mzb-banner-posts .mzb-post-categories a { background: #7054c8 !important; }
.home .mzb-slider .mzb-post-content { display: block !important; position: static !important; height: auto !important; background: none !important; padding: 12px 0 !important; }
.home .mzb-slider .mzb-featured-image { position: relative !important; height: 190px !important; overflow: hidden; }
.home .mzb-slider .mzb-featured-image a { display: block; height: 100%; }
.home .mzb-slider .mzb-featured-image img { position: static !important; width: 100% !important; height: 100% !important; object-fit: cover; }
.home .mzb-slider .mzb-post { background: #fff !important; }
.home .mzb-slider .mzb-post-title { font: 500 17px/1.45 'IBM Plex Serif', Georgia, serif !important; }
.home .mzb-slider .mzb-post-entry-meta, .home .mzb-slider .mzb-post-entry-meta a { color: #625d70 !important; }
.home .mzb-slider .swiper-slide { height: auto !important; }
.home .mzb-featured-image::after, .home .mzb-featured-image::before,
.home .mzb-featured-image a::after, .home .mzb-featured-image a::before,
.home .mzb-slider .swiper-slide::after, .home .mzb-slider .swiper-slide::before { background: none !important; }
.home .mzb-section-3f6c0d66 .mzb-column, .home .mzb-section-video-section-sk .mzb-column { background: #fff !important; }
.home .mzb-grid-module .mzb-post-content { display: block !important; position: static !important; height: auto !important; background: none !important; padding: 12px 0 !important; }
.home .mzb-grid-module .mzb-post-title { font: 500 18px/1.45 'IBM Plex Serif', Georgia, serif !important; }
.home .mzb-grid-module .mzb-featured-image { height: 180px !important; }
.home .mzb-grid-module .mzb-posts { grid-template-rows: auto !important; grid-auto-rows: auto; gap: 24px !important; }
.home .mzb-grid-module .mzb-post { height: auto !important; }
.home .mzb-column-8996e247 .mzb-post-list .mzb-post-title { font: 500 16px/1.45 'IBM Plex Serif', Georgia, serif !important; }
.home .mzb-grid-module .mzb-post-entry-meta a { color: #625d70 !important; }
.home .mzb-view-more a, .home .mzb-view-more p { color: #7054c8 !important; }
.home .mzb-post-heading:has(.mzb-view-more) { flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.home .mzb-post-heading:has(.mzb-view-more) .mzb-heading-text { flex: 0 0 auto; width: auto !important; max-width: 100%; margin-bottom: 0; }
.home .mzb-post-heading .mzb-view-more { flex: 0 0 auto; margin-left: auto; }
.home .mzb-post-heading .mzb-view-more a { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.home .mzb-post-heading .mzb-view-more p { margin: 0; }
.kreslenie-article-heading { padding: 24px 28px 20px; }
.kreslenie-article-heading .cm-entry-title { margin: 0 0 12px; font-size: clamp(28px, 3vw, 36px); line-height: 1.25; }
.single-post .kreslenie-article-heading .cm-entry-title { font-family: 'IBM Plex Serif', Georgia, serif; font-weight: 500; }
.kreslenie-article-heading .cm-entry-meta { margin: 0; }
.single-post .cm-featured-image img { max-height: 420px; width: 100%; object-fit: contain; background: #fff; }
.single-post .cm-entry-summary { font-size: 17px; line-height: 1.8; }
.single-post .cm-entry-summary h2 { margin-top: 32px; line-height: 1.35; }
.single-post .cm-entry-summary img { max-width: 100%; height: auto; }
.single-post .cm-entry-summary iframe.kreslenie-responsive-video { display: block; max-width: 100%; height: auto; }
.cm-search-page #pagefind-search .pagefind-ui__search-input::placeholder { color: #625d70; opacity: 1; }
.single-post #cm-content { padding-top: 24px; }
.cm-footer-builder .cm-main-row { grid-template-columns: 1.2fr .65fr 1fr 1fr !important; gap: 40px; }
.cm-footer-builder .cm-main-row > div:empty { display: none; }
.cm-footer-builder .cm-main-row { padding-block: 36px !important; }
.cm-footer-builder .widget p { line-height: 1.9; }
.cm-footer-builder .widget .wp-block-heading { font-size: 21px; margin-bottom: 18px; }
.cm-footer-builder .widget .mzb-post-list .mzb-post-title { text-transform: none !important; font-size: 15px !important; line-height: 1.5 !important; }
.cm-footer-builder .widget .mzb-post-list .mzb-featured-image { width: 64px !important; min-width: 64px !important; height: 64px !important; }
.cm-footer-builder .widget .mzb-post-list .mzb-post { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 14px; }
.cm-footer-builder .widget .mzb-post-list .mzb-post-content { padding: 0 !important; flex: 1; }
@media (max-width: 768px) {
    .cm-header-builder .cm-mobile-row .cm-header-main-row { padding-block: 14px !important; }
    .cm-header-builder .cm-mobile-row .cm-main-row { grid-template-columns: 1fr auto !important; gap: 12px; }
    .cm-header-builder .cm-mobile-row .cm-main-row > .cm-header-center-col { display: none; }
    .cm-header-builder .cm-mobile-row .cm-main-row .cm-header-left-col { flex-direction: row; justify-content: flex-start; align-items: center; gap: 10px; }
    .cm-header-builder .cm-mobile-row .cm-main-row .cm-header-right-col { justify-content: center; }
    .cm-header-builder .cm-mobile-row .cm-site-title { font-size: 25px; margin: 0 !important; }
    .cm-header-builder .cm-mobile-row .custom-logo { width: 62px; max-width: 62px; }
    .cm-header-builder .cm-mobile-row .cm-header-bottom-row { display: none; }
    .cm-header-builder .cm-mobile-row .cm-menu-toggle { width: 44px; height: 44px; display: grid; place-items: center; color: #2d2640; }
    .cm-header-builder .cm-mobile-row .cm-menu-toggle svg { width: 25px; height: 25px; }
    .cm-header-builder .cm-mobile-nav.cm-mobile-open-container { width: calc(100vw - 32px); left: auto; right: 0; }
    .cm-header-builder .cm-mobile-nav .cm-mobile-header-row { border: 1px solid #e7e2f0; padding: 14px; border-radius: 6px; }
    .home #cm-content { padding-top: 0; }
    .cm-header-builder .cm-mobile-row .cm-header-top-row { display: none; }
    .home .cm-entry-summary > .mzb-section { margin-block: 24px !important; }
    .home .mzb-banner-posts .mzb-posts { grid-template-columns: 1fr !important; gap: 20px !important; }
    .home .mzb-banner-posts .mzb-post-title { font-size: 19px !important; }
    .home .mzb-banner-posts .mzb-post:not(:first-child) { display: grid !important; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; }
    .home .mzb-banner-posts .mzb-post:not(:first-child) .mzb-featured-image { height: 110px !important; grid-column: 1; grid-row: 1; }
    .home .mzb-banner-posts .mzb-post:not(:first-child) .mzb-post-content { padding: 0 !important; grid-column: 2; grid-row: 1; }
    .home .mzb-banner-posts .mzb-post:not(:first-child) .mzb-post-title { font-size: 17px !important; }
    .home .mzb-grid-module .mzb-posts { display: grid !important; grid-template-columns: 1fr !important; gap: 20px !important; }
    .home .mzb-grid-module .mzb-post { display: grid !important; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; }
    .home .mzb-grid-module .mzb-featured-image { height: 100px !important; width: 110px !important; grid-column: 1 !important; grid-row: 1 !important; }
    .home .mzb-grid-module .mzb-post-content { padding: 0 !important; grid-column: 2 !important; grid-row: 1 !important; }
    .home .mzb-grid-module .mzb-post-title { font-size: 17px !important; }
    .kreslenie-article-heading { padding: 20px 20px 16px; }
    .single-post .cm-featured-image img { max-height: 260px; }
    .single-post .cm-entry-summary { font-size: 16px; }
    .single-post #cm-content { padding-top: 20px; }
    .cm-footer-builder .cm-main-row { grid-template-columns: 1fr !important; gap: 24px; padding-block: 28px !important; }
}

/* Reading typography: override the theme's explicit 14px paragraph rule. */
.single-post .cm-entry-summary p,
.single-post .cm-entry-summary li {
    font-size: inherit;
    line-height: 1.75;
}
.single-post .cm-entry-summary p:not(:has(img, iframe)) { text-align: left !important; }
.single-post .cm-entry-summary .kreslenie-lesson-details p { font-size: 15px; }
.single-post .cm-entry-summary h2 { font: 500 28px/1.35 'IBM Plex Serif', Georgia, serif; }
.single-post .cm-entry-summary h3 { font: 500 23px/1.4 'IBM Plex Serif', Georgia, serif; }

/* Keep every sidebar widget and link, with consistent, quieter typography. */
#cm-secondary .widget { margin-bottom: 28px; }
#cm-secondary .widget-title,
#cm-secondary .wp-block-heading,
#cm-secondary .mzb-heading-text {
    font: 500 19px/1.4 'IBM Plex Serif', Georgia, serif !important;
    color: #2d2640 !important;
    background: transparent !important;
    padding: 0 0 9px !important;
    margin: 0 0 16px !important;
    border-bottom: 1px solid #e7e2f0;
}
#cm-secondary .mzb-heading-inner { border: 0; }
#cm-secondary .block-title { border: 0; margin: 0; }
#cm-secondary .block-title .wp-block-heading { display: block; }
#cm-secondary .wp-block-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;
    line-height: 1.5;
}
#cm-secondary .wp-block-tag-cloud a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px !important;
    line-height: 1.6;
    padding: 5px 9px;
    border: 1px solid #e7e2f0;
    border-radius: 5px;
    color: #574a73;
    background: #faf8fe;
}
#cm-secondary .wp-block-tag-cloud .tag-link-count { color: #716979; font-size: 11px; }
#cm-secondary .wp-block-tag-cloud a:hover { color: #513a91; border-color: #b8a9dc; background: #f1edf9; }
#cm-secondary .mzb-post-list .mzb-post-title {
    font: 500 16px/1.45 'IBM Plex Serif', Georgia, serif !important;
    margin: 0 0 6px;
}
#cm-secondary .mzb-post-list .mzb-post-title a { color: #2d2640; font: inherit !important; }
#cm-secondary .wp-block-latest-posts__post-title { color: #2d2640; font: 500 16px/1.45 'IBM Plex Serif', Georgia, serif; }
#cm-secondary .wp-block-latest-posts__featured-image { width: 75px; height: 65px; border: 1px solid #eeeaf3; border-radius: 4px; background: #fff; overflow: hidden; }
#cm-secondary .wp-block-latest-posts__featured-image a { display: block; width: 100%; height: 100%; }
#cm-secondary .wp-block-latest-posts__featured-image img { width: 100%; height: 100%; max-width: none !important; max-height: none !important; object-fit: contain; }
#cm-secondary .mzb-post-list .mzb-featured-image { border: 1px solid #eeeaf3; border-radius: 4px; background: #fff; }
#cm-secondary .mzb-post-list .mzb-featured-image img { width: 100%; height: 100%; object-fit: contain; }
#cm-secondary .mzb-slider .swiper-slide { display: flex !important; flex-direction: column; height: auto !important; }
#cm-secondary .mzb-slider .mzb-featured-image { position: relative !important; height: 180px !important; flex-shrink: 0; overflow: hidden; border: 1px solid #eeeaf3; border-radius: 5px; background: #fff; }
#cm-secondary .mzb-slider .mzb-featured-image a { display: block; height: 100%; }
#cm-secondary .mzb-slider .mzb-featured-image img { position: static !important; width: 100% !important; height: 100% !important; object-fit: contain; }
#cm-secondary .mzb-slider .mzb-post-content { display: block !important; position: static !important; height: auto !important; background: transparent !important; padding: 12px 0 0 !important; }
#cm-secondary .mzb-slider .mzb-post-title { font: 500 17px/1.45 'IBM Plex Serif', Georgia, serif !important; margin: 8px 0; }
#cm-secondary .mzb-slider .mzb-post-title a { color: #2d2640 !important; font: inherit !important; display: block; -webkit-line-clamp: unset !important; line-clamp: unset !important; overflow: visible; }
#cm-secondary .mzb-slider .mzb-post-entry-meta a { color: #625d70 !important; }
#cm-secondary .mzb-slider .mzb-post-categories a { background: #7054c8 !important; }
#cm-secondary .mzb-slider .swiper-pagination { position: static; margin-top: 12px; }
#cm-secondary .mzb-slider .swiper-slide::before,
#cm-secondary .mzb-slider .swiper-slide::after,
#cm-secondary .mzb-slider .mzb-featured-image::before,
#cm-secondary .mzb-slider .mzb-featured-image::after,
#cm-secondary .mzb-slider .mzb-featured-image a::before,
#cm-secondary .mzb-slider .mzb-featured-image a::after { background: none !important; }

/* Archive/search cards keep their existing queries, ordering and lead card. */
:is(.archive, .search) #cm-primary .cm-posts { align-items: stretch; gap: 24px; }
:is(.archive, .search) #cm-primary .cm-posts > article {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid #e7e2f0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
:is(.archive, .search) #cm-primary .cm-featured-image { width: 100%; margin: 0; background: #faf9fc; }
:is(.archive, .search) #cm-primary .cm-featured-image a { display: block; height: 230px; }
:is(.archive, .search) #cm-primary .cm-featured-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
:is(.archive, .search) #cm-primary .cm-posts > article:first-child .cm-featured-image a { height: 300px; }
:is(.archive, .search) #cm-primary .cm-post-content { display: flex; flex-direction: column; flex: 1; padding: 20px; }
:is(.archive, .search) #cm-primary .cm-entry-title { font: 500 23px/1.35 'IBM Plex Serif', Georgia, serif; margin-bottom: 12px; }
:is(.archive, .search) #cm-primary .cm-entry-title a { font: inherit; color: #2d2640; }
:is(.archive, .search) #cm-primary .cm-entry-title a:hover { color: #7054c8; }
:is(.archive, .search) #cm-primary .cm-below-entry-meta { font-size: 12px; line-height: 1.6; margin-bottom: 10px; }
:is(.archive, .search) #cm-primary .cm-entry-summary { display: flex; flex-direction: column; flex: 1; margin-top: 0; }
:is(.archive, .search) #cm-primary .cm-entry-summary p { font-size: 15px; line-height: 1.7; margin: 0 0 18px; }
:is(.archive, .search) #cm-primary .cm-entry-button {
    align-self: flex-start;
    margin-top: auto;
    padding: 8px 13px;
    border: 1px solid #ded5ef;
    border-radius: 4px;
    background: #f4f0fb;
    color: #513a91;
    font-size: 13px;
    font-weight: 500;
}
:is(.archive, .search) #cm-primary .cm-entry-button:hover { background: #eae2f7; border-color: #b8a9dc; }
:is(.archive, .search) #cm-primary .cm-entry-button span { font: inherit; padding: 0; border: 0; background: transparent !important; color: inherit !important; }
@media (max-width: 768px) {
    .single-post .cm-entry-summary h2 { font-size: 24px; }
    .single-post .cm-entry-summary h3 { font-size: 21px; }
    :is(.archive, .search) #cm-primary .cm-entry-title { font-size: 22px; }
    :is(.archive, .search) #cm-primary .cm-featured-image a,
    :is(.archive, .search) #cm-primary .cm-posts > article:first-child .cm-featured-image a { height: 210px; }
    :is(.archive, .search) #cm-primary .cm-post-content { padding: 18px; }
}
