/* ============================================
   CGB — Custom Gutenberg Blocks
   Block 1: Hero Banner
   ============================================ */

/* ---------- Wrapper ---------- */
.cgb-hero {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    position: relative;
    overflow: hidden;
}

/* ---------- Cover block overrides ---------- */
.cgb-hero__cover.wp-block-cover {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10vh;
    background-color: #808080; /* fallback until image is set */
    background-size: cover;
    background-position: center top;
    position: relative;
}

/* subtle dark gradient at bottom so text stays readable on any photo */
.cgb-hero__cover.wp-block-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0)   55%,
        rgba(0,0,0,0.45) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.cgb-hero__cover .wp-block-cover__inner-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    padding: 0 24px;
}

/* ---------- Text ---------- */
.cgb-hero__text {
    font-family: 'Montserrat', sans-serif !important;
    font-size: clamp(1.125rem, 2.2vw, 1.5rem) !important;
    font-weight: 600 !important;
    font-style: italic !important;
    line-height: 1.55 !important;
    color: #ffffff !important;
    text-align: center !important;
    text-shadow: 0 1px 4px rgba(0,0,0,0.35);
    margin: 0 !important;
}

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,600;1,400;1,600&display=swap');

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .cgb-hero__cover.wp-block-cover {
        min-height: 70vh;
        padding-bottom: 8vh;
    }
    .cgb-hero__text {
        font-size: 1rem !important;
    }
}

@media (max-width: 480px) {
    .cgb-hero__cover.wp-block-cover {
        min-height: 60vh;
    }
}

/* ============================================
   Block 2: Numbered List with Logo
   ============================================ */

.cgb-numlist {
    max-width: 1248px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 60px 40px 80px !important;
    background: #ffffff;
}

/* Logo */
.cgb-numlist__logo {
    text-align: center;
    margin-bottom: 60px !important;
}

.cgb-numlist__logo img {
    max-width: 320px;
    height: auto;
    display: inline-block;
}

/* Items wrapper */
.cgb-numlist__items {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
}

/* Single item row */
.cgb-numlist__item.wp-block-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 32px !important;
    padding: 40px 0 !important;
    border-bottom: 1px solid #e8e8e8;
}

.cgb-numlist__item.wp-block-group:last-child {
    border-bottom: none;
}

/* Number */
.cgb-numlist__num {
    font-family: 'Montserrat', sans-serif !important;
    font-size: clamp(3.5rem, 7vw, 5.5rem) !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    color: #cccccc !important;
    min-width: 110px !important;
    margin: 0 !important;
    padding-top: 4px;
    flex-shrink: 0;
}

/* Content area */
.cgb-numlist__content.wp-block-group {
    flex: 1 !important;
    padding: 0 !important;
}

/* Heading */
.cgb-numlist__heading {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #111111 !important;
    margin: 0 0 16px 0 !important;
    line-height: 1.3 !important;
}

/* Body text */
.cgb-numlist__text {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.7 !important;
    color: #444444 !important;
    margin: 0 !important;
}

/* Responsive */
@media (max-width: 600px) {
    .cgb-numlist {
        padding: 40px 20px 60px !important;
    }

    .cgb-numlist__item.wp-block-group {
        flex-direction: column !important;
        gap: 8px !important;
    }

    .cgb-numlist__num {
        font-size: 3rem !important;
        min-width: unset !important;
    }
}

/* ============================================
   Block 3: Services Tabs (cgb/services-tabs)
   ============================================ */

.cgb-st {
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    background: transparent;
    padding: 0;
    position: relative;
    box-sizing: border-box;
}

/* Kill padding/margin of any Gutenberg wrapper that contains the block.
   Modern browsers; JS in wp_footer does the same as a fallback. */
.wp-block-group:has(> .cgb-st),
.wp-block-group:has(> .wp-block-group > .cgb-st) {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
    background: transparent !important;
    background-color: transparent !important;
}

/* Kill the theme's outer content margin when our block is the first/last child.
   This handles `#content.cs-main-content { margin-top: 48px }` from theme `revision`. */
#content:has(> .wp-block-group:first-child > .cgb-st),
#content:has(> .wp-block-group:first-child > .wp-block-group > .cgb-st),
#content:has(> .cgb-st:first-child),
.cs-main-content:has(> .wp-block-group:first-child > .cgb-st),
.cs-main-content:has(> .wp-block-group:first-child > .wp-block-group > .cgb-st),
.cs-main-content:has(> .cgb-st:first-child),
.site-main:has(> .wp-block-group:first-child > .cgb-st),
.site-main:has(> .wp-block-group:first-child > .wp-block-group > .cgb-st),
.site-main:has(> .cgb-st:first-child) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

#content:has(> .wp-block-group:last-child > .cgb-st),
#content:has(> .wp-block-group:last-child > .wp-block-group > .cgb-st),
#content:has(> .cgb-st:last-child),
.cs-main-content:has(> .wp-block-group:last-child > .cgb-st),
.cs-main-content:has(> .wp-block-group:last-child > .wp-block-group > .cgb-st),
.cs-main-content:has(> .cgb-st:last-child),
.site-main:has(> .wp-block-group:last-child > .cgb-st),
.site-main:has(> .wp-block-group:last-child > .wp-block-group > .cgb-st),
.site-main:has(> .cgb-st:last-child) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* ---- Grid ---- */
.cgb-st .cgb-st__grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    grid-template-rows: auto auto !important;
    align-items: start;
    width: 100%;
    max-width: 1248px;
    margin: 0 auto;
}

/* ---- Title cell ---- */
.cgb-st .cgb-st__title-cell {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: center;
    padding: 52px 44px;
    background: transparent;
    min-height: 300px;
}

/* ---- Cards row ---- */
.cgb-st .cgb-st__cards-row {
    grid-column: 2 / 4 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    align-items: stretch;
    width: 100%;
}

.cgb-st .cgb-st__cards-row > .cgb-st__card {
    width: auto !important;
    max-width: none !important;
    min-width: 0;
}

.cgb-st__title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.85rem, 2.8vw, 2.75rem);
    font-weight: 800;
    line-height: 1.1;
    color: #1a1a2e;
    letter-spacing: -0.02em;
    margin: 0;
}

.cgb-st__title em {
    font-style: normal;
    color: #C0162C;
}

/* ---- Tab cards ---- */
.cgb-st .cgb-st__card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px;
    min-height: 300px;
    box-sizing: border-box;
    transition: transform .25s ease, box-shadow .25s ease;
}

.cgb-st .cgb-st__card--gray {
    background: linear-gradient(180deg, #4a4a4a 0%, #1f1f1f 100%);
}

.cgb-st .cgb-st__card--red {
    background: linear-gradient(180deg, #a31818 0%, #7a0c0c 100%);
}

.cgb-st .cgb-st__card:not(.is-active):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

.cgb-st .cgb-st__card:not(.is-active):hover .cgb-st__card-plus {
    border-color: #fff;
    background: rgba(255, 255, 255, .12);
}

.cgb-st .cgb-st__card.is-active {
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .92);
}

.cgb-st .cgb-st__card.is-active .cgb-st__card-plus {
    background: #fff;
    color: #1a1a2e;
    border-color: #fff;
    transform: rotate(45deg);
}

.cgb-st .cgb-st__card-plus {
    transition: transform .25s ease, background .25s ease, color .25s ease, border-color .25s ease;
}

.cgb-st__card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.cgb-st__card--gray .cgb-st__card-bg {
    filter: grayscale(100%);
}

.cgb-st__card-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.cgb-st__card--gray .cgb-st__card-overlay {
    background: linear-gradient(180deg, rgba(15,15,15,.18) 0%, rgba(15,15,15,.70) 100%);
}

.cgb-st__card--red .cgb-st__card-overlay {
    background: linear-gradient(180deg, rgba(155,12,12,.45) 0%, rgba(155,12,12,.88) 100%);
}

.cgb-st__card-logo {
    width: 52px;
    height: auto;
    display: block;
    position: relative;
    z-index: 2;
}

.cgb-st__card-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    position: relative;
    z-index: 2;
}

.cgb-st__card-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.5;
    max-width: 175px;
    margin: 0;
}

.cgb-st__card-plus {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border: 1.5px solid rgba(255,255,255,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1;
}

/* ---- Joanna photo cell ---- */
.cgb-st .cgb-st__photo-cell {
    grid-column: 1 !important;
    grid-row: 2 !important;
    overflow: hidden;
    align-self: start;
    background: #c0c0c0;
    min-height: 200px;
}

.cgb-st__photo-cell img {
    width: 100%;
    height: auto;
    display: block;
}

/* ---- Content cell ---- */
.cgb-st .cgb-st__content-cell {
    grid-column: 2 / 4 !important;
    grid-row: 2 !important;
    background: #f0f0f0;
}

.cgb-st__panel {
    display: none;
    flex-direction: column;
    padding: 44px 52px 48px;
}

.cgb-st__panel.is-active {
    display: flex;
}

/* ---- Tab body (RichText output) ---- */
.cgb-st__tab-body {
    flex: 1;
    margin-bottom: 32px;
}

.cgb-st__tab-body p {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(.88rem, 1.4vw, 1.05rem);
    font-weight: 700;
    line-height: 1.7;
    color: #1a1a2e;
    margin: 0 0 16px;
}

.cgb-st__tab-body p:last-child {
    margin-bottom: 0;
}

.cgb-st__tab-body em {
    font-style: normal;
    color: #C0162C;
}

.cgb-st__tab-body p:first-child {
    margin-bottom: 32px;
}

.cgb-st__tab-body h2,
.cgb-st__tab-body h3,
.cgb-st__tab-body h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #1a1a2e !important;
    line-height: 1.35 !important;
    margin: 24px 0 8px !important;
}

.cgb-st__tab-body h2:first-child,
.cgb-st__tab-body h3:first-child,
.cgb-st__tab-body h4:first-child {
    margin-top: 0 !important;
}

.cgb-st__tab-body ul,
.cgb-st__tab-body ol {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 16px !important;
}

.cgb-st__tab-body li {
    position: relative;
    padding-left: 16px;
    font-family: 'Montserrat', sans-serif;
    font-size: .875rem;
    line-height: 1.65;
    color: #444;
    margin-bottom: 5px;
}

.cgb-st__tab-body li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 5px;
    height: 5px;
    background: #C0162C;
    flex-shrink: 0;
}

/* ---- Signature ---- */
.cgb-st__signature {
    display: block;
    height: auto;
    max-height: 48px;
    width: auto;
    max-width: 260px;
    mix-blend-mode: multiply;
}

/* ---- Responsive: mobile accordion ---- */
@media (max-width: 800px) {
    .cgb-st {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .cgb-st .cgb-st__grid         { display: block !important; }
    .cgb-st .cgb-st__title-cell   {
        display: block !important;
        padding: 32px 20px !important;
        min-height: 0 !important;
    }
    .cgb-st .cgb-st__title        { width: 100% !important; }
    .cgb-st .cgb-st__cards-row    { display: block !important; }
    .cgb-st .cgb-st__card         { min-height: 180px; }

    /* Hide Joanna photo and the original content cell on mobile */
    .cgb-st .cgb-st__photo-cell,
    .cgb-st .cgb-st__content-cell { display: none !important; }

    /* Mobile accordion: panel becomes a sibling of card (moved by JS) */
    .cgb-st.is-mobile .cgb-st__panel {
        display: none;
        background: #f0f0f0;
        padding: 28px 24px 32px;
    }
    .cgb-st.is-mobile .cgb-st__panel.is-active {
        display: flex;
        flex-direction: column;
    }
}

/* ============================================
   Editor — Services Tabs (Spectra-style UX)
   ============================================ */

.cgb-st-editor {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 28px 28px 24px;
}

.cgb-st-editor__title.wp-block,
.cgb-st-editor__title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.6rem, 2.4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.15;
    color: #1a1a2e;
    letter-spacing: -0.02em;
    margin: 0 0 20px !important;
}

.cgb-st-editor__title em { font-style: normal; color: #C0162C; }

/* ---- Visible media row in editor (Joanna + signature) ---- */
.cgb-st-editor__media-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 0 0 22px;
    padding: 14px;
    background: #f7f7f8;
    border: 1px dashed #d0d0d5;
    border-radius: 6px;
}

.cgb-st-editor__media-slot { min-width: 0; }

.cgb-st-editor__media-lbl {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1e1e1e;
    margin: 0 0 8px !important;
}

/* ---- Tab navigation (mimics frontend cards) ---- */
.cgb-st-editor__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 18px;
    align-items: stretch;
}

.cgb-st-nav-btn {
    position: relative;
    flex: 1 1 0;
    min-width: 200px;
    min-height: 90px;
    padding: 16px 18px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-color: #4a4a4a;
    overflow: hidden;
    text-align: left;
    color: #fff;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.cgb-st-nav-btn--gray { background-color: #4a4a4a; }
.cgb-st-nav-btn--red  { background-color: #a31818; }

.cgb-st-nav-btn__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.cgb-st-nav-btn--gray .cgb-st-nav-btn__overlay {
    background: linear-gradient(180deg, rgba(15,15,15,.18) 0%, rgba(15,15,15,.78) 100%);
}
.cgb-st-nav-btn--red .cgb-st-nav-btn__overlay {
    background: linear-gradient(180deg, rgba(155,12,12,.45) 0%, rgba(155,12,12,.88) 100%);
}

.cgb-st-nav-btn__lbl {
    position: relative;
    z-index: 2;
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    line-height: 1.4;
    text-shadow: 0 1px 8px rgba(0,0,0,0.55);
}

.cgb-st-nav-btn.is-active {
    border-color: #C0162C;
    box-shadow: 0 4px 14px rgba(192,22,44,0.2);
    transform: translateY(-1px);
}

.cgb-st-nav-add {
    flex: 0 0 auto;
    background: #f0f0f1;
    color: #1e1e1e;
    border: 1px dashed #b3b3b3;
    padding: 0 22px;
    cursor: pointer;
    font-weight: 600;
    border-radius: 6px;
    min-height: 90px;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    transition: background 0.12s, border-color 0.12s;
}

.cgb-st-nav-add:hover {
    background: #e8e8eb;
    border-color: #1e1e1e;
}

/* ---- Active panel container ---- */
.cgb-st-editor__panels {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 20px 24px;
    min-height: 120px;
}

/* Hide all child tab blocks except the active one */
.cgb-st-editor__panels > .block-editor-inner-blocks > .block-editor-block-list__layout > * {
    display: none;
}
.cgb-st-editor__panels[data-active-tab="0"] > .block-editor-inner-blocks > .block-editor-block-list__layout > *:nth-child(1),
.cgb-st-editor__panels[data-active-tab="1"] > .block-editor-inner-blocks > .block-editor-block-list__layout > *:nth-child(2),
.cgb-st-editor__panels[data-active-tab="2"] > .block-editor-inner-blocks > .block-editor-block-list__layout > *:nth-child(3),
.cgb-st-editor__panels[data-active-tab="3"] > .block-editor-inner-blocks > .block-editor-block-list__layout > *:nth-child(4),
.cgb-st-editor__panels[data-active-tab="4"] > .block-editor-inner-blocks > .block-editor-block-list__layout > *:nth-child(5),
.cgb-st-editor__panels[data-active-tab="5"] > .block-editor-inner-blocks > .block-editor-block-list__layout > *:nth-child(6) {
    display: block;
}

/* ---- Child tab edit panel ---- */
.cgb-st-tab-edit {
    background: transparent;
}

.cgb-st-tab-edit__meta {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.cgb-st-tab-edit__lbl-input {
    margin-bottom: 12px !important;
}

.cgb-st-tab-edit__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.cgb-st-tab-edit__hdr {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
    margin: 0 0 10px !important;
}

.cgb-st-tab-edit__content {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 14px 18px;
}

/* ---- Sidebar helpers ---- */
.cgb-panel-lbl {
    font-size: 11px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 12px 0 4px !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cgb-ipk { margin-bottom: 4px; }
.cgb-ipk__thumb {
    max-width: 100%;
    max-height: 72px;
    display: block;
    margin-bottom: 6px;
    border-radius: 2px;
}

/* ============================================
   Block 4: Blog (cgb/blog)
   ============================================ */

.cgb-blog {
    position: relative;
    width: 100%;
    max-width: 1248px;
    margin: 0 auto;
    padding: 0 0 80px;
    background: transparent;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

/* Neutralize Gutenberg wrapper around our block */
.wp-block-group:has(> .cgb-blog),
.wp-block-group:has(> .wp-block-group > .cgb-blog) {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
    background: transparent !important;
    background-color: transparent !important;
}

#content:has(> .wp-block-group:first-child > .cgb-blog),
#content:has(> .wp-block-group:first-child > .wp-block-group > .cgb-blog),
#content:has(> .cgb-blog:first-child),
.cs-main-content:has(> .wp-block-group:first-child > .cgb-blog),
.cs-main-content:has(> .wp-block-group:first-child > .wp-block-group > .cgb-blog),
.cs-main-content:has(> .cgb-blog:first-child),
.site-main:has(> .wp-block-group:first-child > .cgb-blog),
.site-main:has(> .wp-block-group:first-child > .wp-block-group > .cgb-blog),
.site-main:has(> .cgb-blog:first-child) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

#content:has(> .wp-block-group:last-child > .cgb-blog),
#content:has(> .wp-block-group:last-child > .wp-block-group > .cgb-blog),
#content:has(> .cgb-blog:last-child),
.cs-main-content:has(> .wp-block-group:last-child > .cgb-blog),
.cs-main-content:has(> .wp-block-group:last-child > .wp-block-group > .cgb-blog),
.cs-main-content:has(> .cgb-blog:last-child),
.site-main:has(> .wp-block-group:last-child > .cgb-blog),
.site-main:has(> .wp-block-group:last-child > .wp-block-group > .cgb-blog),
.site-main:has(> .cgb-blog:last-child) {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* ---- Decoration "Blog" ---- */
.cgb-blog__decor {
    position: absolute;
    top: 0;
    left: 0;
    width: 44%;
    max-width: 580px;
    min-width: 380px;
    height: auto;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

/* ---- Content (shifted right) ---- */
.cgb-blog__content {
    position: relative;
    z-index: 1;
    margin-left: 22%;
    padding-top: 220px;
}

/* ---- Title ---- */
.cgb-blog__title {
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    font-size: clamp(1.1rem, 1.7vw, 1.5rem);
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #1a1a2e;
    margin: 0 0 50px;
}

/* ---- Grid ---- */
.cgb-blog__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.cgb-blog--cols-4 .cgb-blog__grid {
    grid-template-columns: repeat(4, 1fr);
}

/* ---- Card ---- */
.cgb-blog__card {
    display: flex;
    flex-direction: column;
    background: transparent;
    margin: 0;
}

.cgb-blog__image-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #eee;
}

.cgb-blog__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.cgb-blog__card:hover .cgb-blog__image-wrap img {
    transform: scale(1.04);
}

.cgb-blog__image-empty {
    display: block;
    width: 100%;
    height: 100%;
    background: #e6e6e6;
}

.cgb-blog__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 22px 0 8px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888;
}

.cgb-blog__meta-item + .cgb-blog__meta-item::before {
    content: '·';
    margin-right: 10px;
    color: #c0c0c0;
}

.cgb-blog__cat {
    color: #C0162C;
}

.cgb-blog__card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1a1a2e;
    margin: 28px 0 18px;
}

.cgb-blog__card:has(.cgb-blog__meta) .cgb-blog__card-title {
    margin-top: 6px;
}

.cgb-blog__card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cgb-blog__card-title a:hover {
    color: #C0162C;
}

.cgb-blog__excerpt {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    line-height: 1.85;
    color: #6a6a6a;
    margin: 0 0 32px;
    flex: 1;
}

/* ---- Button ---- */
.cgb-blog__btn {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    min-width: 180px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    box-sizing: border-box;
}

.cgb-blog__btn--outlined {
    background: transparent;
    border: 1px solid #1a1a2e;
    color: #1a1a2e;
}

.cgb-blog__btn--outlined:hover,
.cgb-blog__btn--outlined:focus-visible {
    background: #C0162C;
    border-color: #C0162C;
    color: #fff;
    outline: none;
}

.cgb-blog__btn--filled {
    background: #C0162C;
    border: 1px solid #C0162C;
    color: #fff;
}

.cgb-blog__btn--filled:hover,
.cgb-blog__btn--filled:focus-visible {
    background: #1a1a2e;
    border-color: #1a1a2e;
    color: #fff;
    outline: none;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .cgb-blog { padding: 0 28px 60px; }
    .cgb-blog__decor {
        width: 50%;
        max-width: 420px;
        min-width: 280px;
    }
    .cgb-blog__content {
        margin-left: 18%;
        padding-top: 180px;
    }
    .cgb-blog__grid,
    .cgb-blog--cols-4 .cgb-blog__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 640px) {
    .cgb-blog { padding: 0 20px 50px; }
    .cgb-blog__decor {
        width: 70%;
        max-width: 320px;
        min-width: 220px;
        left: -10px;
        top: 0;
    }
    .cgb-blog__content {
        margin-left: 0;
        padding-top: 150px;
    }
    .cgb-blog__title {
        margin: 0 0 36px;
        font-size: 1rem;
        letter-spacing: 0.18em;
    }
    .cgb-blog__grid,
    .cgb-blog--cols-4 .cgb-blog__grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .cgb-blog__card-title {
        margin: 22px 0 14px;
        font-size: 0.9rem;
    }
    .cgb-blog__excerpt {
        margin-bottom: 24px;
    }
    .cgb-blog__btn {
        align-self: stretch;
        min-width: 0;
    }
}

/* ============================================
   Editor — Blog (cgb/blog)
   ============================================ */

.cgb-blog-editor {
    position: relative;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 24px 28px 28px;
    overflow: hidden;
}

.cgb-blog-editor__decor {
    position: absolute;
    top: 0;
    left: 0;
    width: 38%;
    max-width: 420px;
    min-width: 240px;
    height: auto;
    pointer-events: none;
    user-select: none;
    opacity: 0.95;
    z-index: 0;
}

.cgb-blog-editor__content {
    position: relative;
    z-index: 1;
    margin-left: 18%;
    padding-top: 160px;
}

.cgb-blog-editor__title {
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #1a1a2e;
    margin: 0 0 32px !important;
}

.cgb-blog-editor__loading,
.cgb-blog-editor__empty {
    padding: 40px 20px;
    text-align: center;
    color: #888;
    font-size: 13px;
    background: #fafafa;
    border: 1px dashed #d4d4d4;
    border-radius: 4px;
}

.cgb-blog-editor__loading { display: flex; align-items: center; justify-content: center; gap: 8px; }

.cgb-blog-editor__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.cgb-blog-editor--cols-4 .cgb-blog-editor__grid {
    grid-template-columns: repeat(4, 1fr);
}

.cgb-blog-editor__card {
    display: flex;
    flex-direction: column;
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 4px;
    overflow: hidden;
}

.cgb-blog-editor__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #e6e6e6;
}

.cgb-blog-editor__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cgb-blog-editor__image-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #aaa;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.cgb-blog-editor__card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1a1a2e;
    margin: 16px 14px 10px !important;
}

.cgb-blog-editor__excerpt {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    line-height: 1.65;
    color: #6a6a6a;
    margin: 0 14px 14px;
    flex: 1;
}

.cgb-blog-editor__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 14px 16px;
    padding: 10px 18px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    box-sizing: border-box;
    align-self: flex-start;
}

.cgb-blog-editor__btn--outlined {
    background: transparent;
    border: 1px solid #1a1a2e;
    color: #1a1a2e;
}

.cgb-blog-editor__btn--filled {
    background: #C0162C;
    border: 1px solid #C0162C;
    color: #fff;
}

.cgb-blog-cats {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 8px 10px;
    background: #fafafa;
    margin-bottom: 14px;
}

.cgb-blog-cats .components-checkbox-control {
    margin-bottom: 4px;
}

/* ============================================
   Block: CTA — Kontakt (cgb/cta-contact)
   ============================================ */

.cgb-cta {
    max-width: 1248px;
    margin: 0 auto;
    background: transparent;
    padding: 48px 0;
    font-family: 'Montserrat', sans-serif;
    color: #1a1a2e;
}

.cgb-cta__grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
    gap: 56px;
    align-items: center;
}
.cgb-cta__grid--single {
    grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
}

.cgb-cta__title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.85rem, 2.7vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #1a1a2e;
    margin: 0;
}

.cgb-cta__title-accent {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.85rem, 2.7vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: #C0162C;
    margin-top: 0;
}

.cgb-cta__right {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.cgb-cta__text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    color: #1a1a2e;
    margin: 0;
}

.cgb-cta__buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.cgb-cta__buttons--single {
    grid-template-columns: 1fr;
}

.cgb-cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    background: #C0162C;
    color: #fff;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: background-color 0.25s ease;
}
.cgb-cta__btn:hover,
.cgb-cta__btn:focus-visible {
    background: #9b0c0c;
    color: #fff;
    outline: none;
    text-decoration: none;
}
.cgb-cta__btn:visited {
    color: #fff;
}

@media (max-width: 800px) {
    .cgb-cta {
        padding: 32px 0;
    }
    .cgb-cta__grid,
    .cgb-cta__grid--single {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .cgb-cta__buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ----- Editor preview ----- */
.cgb-cta--editor {
    outline: 1px dashed #c0c0c0;
    outline-offset: 4px;
    position: relative;
}
.cgb-cta__editor-hint {
    background: #f0f0f0;
    color: #555;
    font-size: 12px;
    padding: 8px 12px;
    margin-bottom: 16px;
    border-left: 3px solid #C0162C;
    font-family: 'Montserrat', sans-serif;
}
.cgb-cta__placeholder {
    color: #b0b0b0;
    font-style: italic;
    font-weight: 400;
}
.cgb-cta__btn--preview {
    cursor: default;
    pointer-events: none;
}

/* ============================================================
   BLOCK: WHY I DO (cgb/why-i-do)
   ============================================================ */
.cgb-why {
    max-width: 1248px;
    margin: 0 auto;
    background: transparent;
    padding: 48px 0;
}

.cgb-why__grid {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
    gap: 40px;
    align-items: center;
}

.cgb-why--right .cgb-why__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
}
.cgb-why--right .cgb-why__media {
    order: 2;
    justify-content: flex-end;
    margin-left: 0;
    margin-right: 0;
}
.cgb-why--right .cgb-why__content {
    order: 1;
}

.cgb-why__media {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-left: 0;
}
.cgb-why__media img {
    display: block;
    width: 105%;
    max-width: none;
    height: auto;
}

.cgb-why__content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cgb-why__title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.5rem, 2vw, 1.85rem);
    font-weight: 800;
    line-height: 1.2;
    color: #1a1a2e;
    margin: 0 0 6px;
}

.cgb-why__lead {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.55;
    color: #1a1a2e;
    margin: 0;
}
.cgb-why__lead em {
    font-style: normal;
    color: #C0162C;
}

.cgb-why__body {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1.6;
    color: #1a1a2e;
}
.cgb-why__body p {
    margin: 0 0 10px;
}
.cgb-why__body p:last-child {
    margin-bottom: 0;
}

@media (max-width: 800px) {
    .cgb-why {
        padding: 32px 0;
    }
    .cgb-why__grid,
    .cgb-why--right .cgb-why__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    /* #10: text first, image second on mobile */
    .cgb-why__content,
    .cgb-why--right .cgb-why__content {
        order: 1 !important;
        padding: 0 16px;
    }
    .cgb-why__media,
    .cgb-why--right .cgb-why__media {
        order: 2 !important;
        margin-left: 0;
        margin-right: 0;
        justify-content: center;
    }
    .cgb-why__media img {
        width: auto;
        max-width: 320px;
    }
}

/* ----- Editor preview ----- */
.cgb-why--editor {
    outline: 1px dashed #c0c0c0;
    outline-offset: 4px;
}
.cgb-why__media-empty {
    width: 100%;
    min-height: 220px;
    background: #f0f0f0;
    border: 1px dashed #c0c0c0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
}
.cgb-why__media-pick {
    margin-top: 8px;
}
.cgb-why--editor .cgb-why__media {
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
}
.cgb-why--editor .cgb-why__media img {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
}

/* ====================================================================
   THREE PILLARS — 3 colored cards with logo + title + subtitle
   ==================================================================== */
.cgb-tp {
    background: transparent;
    margin-left: calc(50% - 50vw);
    width: 100vw;
}

.cgb-tp__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    max-width: 1248px;
    margin: 0 auto;
}

.cgb-tp__grid--cols-1 { grid-template-columns: 1fr; }
.cgb-tp__grid--cols-2 { grid-template-columns: 1fr 1fr; }
.cgb-tp__grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

.cgb-tp__card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 36px 44px;
    min-height: 320px;
    color: #fff;
    transition: transform 0.25s ease;
}

.cgb-tp__card:hover { transform: translateY(-2px); }

.cgb-tp__card--gray { background: #8a8a8c; }
.cgb-tp__card--dark { background: #2f2f31; }
.cgb-tp__card--red  { background: #C0162C; }

.cgb-tp__card-logo {
    width: 64px;
    height: auto;
    display: block;
    margin: 0 0 auto 0;
}

.cgb-tp__card-content { margin-top: 96px; }

.cgb-tp__card-title {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
    color: #fff;
    margin: 0 0 22px 0;
    max-width: 240px;
}

.cgb-tp__card-sub {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
    max-width: 240px;
    margin: 0;
}

.cgb-tp__card--dark .cgb-tp__card-sub { color: rgba(255, 255, 255, 0.62); }
.cgb-tp__card--red  .cgb-tp__card-sub { color: rgba(255, 255, 255, 0.85); }

@media (max-width: 800px) {
    .cgb-tp { margin-left: 0; width: 100%; }
    .cgb-tp__grid,
    .cgb-tp__grid--cols-1,
    .cgb-tp__grid--cols-2,
    .cgb-tp__grid--cols-4 { grid-template-columns: 1fr; }
    .cgb-tp__card { min-height: 220px; padding: 32px 28px 36px; }
    .cgb-tp__card-content { margin-top: 64px; }
}

/* ---------- editor ---------- */
.cgb-tp-editor {
    background: #f5f5f7;
    padding: 16px;
    border: 1px dashed #cfcfd3;
}

.cgb-tp-editor__logo-slot {
    background: #fff;
    border: 1px solid #e3e3e6;
    padding: 10px 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cgb-tp-editor__media-lbl {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #555;
    margin: 0;
    font-weight: 700;
}

.cgb-tp-editor__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.cgb-tp-editor__grid > .block-editor-inner-blocks,
.cgb-tp-editor__grid > .block-editor-inner-blocks > .block-editor-block-list__layout {
    display: contents;
}

.cgb-tp-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 32px 28px 36px;
    min-height: 280px;
    color: #fff;
}

.cgb-tp-card.cgb-tp-card--gray { background: #8a8a8c; }
.cgb-tp-card.cgb-tp-card--dark { background: #2f2f31; }
.cgb-tp-card.cgb-tp-card--red  { background: #C0162C; }

.cgb-tp-card .cgb-tp-card__logo {
    width: 56px;
    height: auto;
    display: block;
    margin: 0 0 auto 0;
}

.cgb-tp-card .cgb-tp-card__content { margin-top: 72px; }

.cgb-tp-card .cgb-tp-card__title {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
    color: #fff;
    margin: 0 0 18px 0;
    max-width: 240px;
}

.cgb-tp-card .cgb-tp-card__sub {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
    max-width: 240px;
    margin: 0;
}

.cgb-tp-card.cgb-tp-card--dark .cgb-tp-card__sub { color: rgba(255, 255, 255, 0.62); }
.cgb-tp-card.cgb-tp-card--red  .cgb-tp-card__sub { color: rgba(255, 255, 255, 0.85); }

@media (max-width: 800px) {
    .cgb-tp-editor__grid { grid-template-columns: 1fr; }
}

/* ============================================
   Block: Quote Banner (cgb/quote-banner)
   ============================================ */
.cgb-qb {
    position: relative;
    max-width: 1248px;
    margin: 0 auto;
    overflow: hidden;
    background: transparent;
}

.cgb-qb__bg {
    display: block;
    width: 100%;
    height: auto;
}

.cgb-qb__overlay {
    position: absolute;
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 640px;
    padding: 0 24px;
    text-align: center;
    color: #fff;
    pointer-events: none;
}

.cgb-qb__quote {
    font-family: 'Montserrat', sans-serif;
    font-style: italic;
    font-weight: 600;
    font-size: clamp(0.95rem, 1.4vw, 1.15rem);
    line-height: 1.45;
    color: #fff;
    margin: 0 auto 18px;
    max-width: 480px;
    text-shadow: 0 1px 12px rgba(0,0,0,0.25);
}

.cgb-qb__sign {
    display: block;
    height: clamp(34px, 4vw, 48px);
    width: auto;
    margin: 0 auto;
    opacity: 0.95;
}

@media (max-width: 800px) {
    .cgb-qb {
        aspect-ratio: 4 / 5;
    }
    .cgb-qb__bg {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 30% center;
    }
    .cgb-qb__overlay {
        bottom: 6%;
        max-width: 92%;
        padding: 0 12px;
    }
    .cgb-qb__quote {
        font-size: 0.92rem;
        line-height: 1.5;
        max-width: 100%;
        margin-bottom: 14px;
    }
    .cgb-qb__sign {
        height: 32px;
    }
}

/* ---- Editor-only ---- */
.cgb-qb--editor {
    position: relative;
}
.cgb-qb__bg-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1897 / 949;
    background: #d8d8d8;
    color: #666;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.cgb-qb__bg-pick {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
}
.cgb-qb__sign-empty {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 auto 8px;
}
.cgb-qb__sign-pick {
    margin-top: 8px;
    display: flex;
    justify-content: center;
    pointer-events: auto;
}
.cgb-qb--editor .cgb-qb__overlay {
    pointer-events: auto;
}

/* ============================================================
   DARK THEME — overrides for all cgb blocks
   Theme uses [data-scheme="dark"] on html and/or body
   ============================================================ */

/* SERVICES TABS — content panel is dark, text becomes light */
[data-scheme="dark"] .cgb-st__title,
[data-scheme="dark"] .cgb-st__tab-body,
[data-scheme="dark"] .cgb-st__tab-body h2,
[data-scheme="dark"] .cgb-st__tab-body h3,
[data-scheme="dark"] .cgb-st__tab-body h4,
[data-scheme="dark"] .cgb-st__tab-body p,
[data-scheme="dark"] .cgb-st__tab-body li,
[data-scheme="dark"] .cgb-st__tab-body ul,
[data-scheme="dark"] .cgb-st__tab-body strong {
    color: #f0f0f0 !important;
}
[data-scheme="dark"] .cgb-st__panel,
[data-scheme="dark"] .cgb-st__tab-body,
[data-scheme="dark"] .cgb-st__content-cell {
    background: transparent !important;
}
[data-scheme="dark"] .cgb-st__signature {
    -webkit-filter: brightness(0) invert(1) !important;
    filter: brightness(0) invert(1) !important;
    mix-blend-mode: normal !important;
}

/* WHY-I-DO — title, lead, body text → light */
[data-scheme="dark"] .cgb-why__title,
[data-scheme="dark"] .cgb-why__lead,
[data-scheme="dark"] .cgb-why__body,
[data-scheme="dark"] .cgb-why__body p {
    color: #f0f0f0 !important;
}

/* CTA — heading and body text */
[data-scheme="dark"] .cgb-cta,
[data-scheme="dark"] .cgb-cta__title,
[data-scheme="dark"] .cgb-cta__heading,
[data-scheme="dark"] .cgb-cta__text,
[data-scheme="dark"] .cgb-cta__body,
[data-scheme="dark"] .cgb-cta__lead,
[data-scheme="dark"] .cgb-cta__subtitle {
    color: #f0f0f0 !important;
}
[data-scheme="dark"] .cgb-cta__title em,
[data-scheme="dark"] .cgb-cta__heading em,
[data-scheme="dark"] .cgb-cta__title-accent {
    color: #ff5e72 !important;
}

/* BLOG */
[data-scheme="dark"] .cgb-blog__heading,
[data-scheme="dark"] .cgb-blog__title,
[data-scheme="dark"] .cgb-blog__card-title,
[data-scheme="dark"] .cgb-blog__lead {
    color: #f0f0f0 !important;
}
[data-scheme="dark"] .cgb-blog__excerpt,
[data-scheme="dark"] .cgb-blog__meta,
[data-scheme="dark"] .cgb-blog__date {
    color: #b0b0b0 !important;
}
[data-scheme="dark"] .cgb-blog__card {
    background: transparent !important;
}
[data-scheme="dark"] .cgb-blog__btn--outlined {
    border-color: #f0f0f0 !important;
    color: #f0f0f0 !important;
}
[data-scheme="dark"] .cgb-blog__btn--outlined:hover,
[data-scheme="dark"] .cgb-blog__btn--outlined:focus-visible {
    background: #C0162C !important;
    border-color: #C0162C !important;
    color: #fff !important;
}

/* NUMBERED LIST */
[data-scheme="dark"] .cgb-numlist__heading,
[data-scheme="dark"] .cgb-numlist__text {
    color: #f0f0f0 !important;
}
[data-scheme="dark"] .cgb-numlist {
    background: transparent !important;
}
[data-scheme="dark"] .cgb-numlist__item.wp-block-group {
    border-bottom-color: #3a3a3a !important;
}

/* QUOTE BANNER (cgb-qb) — already has dark/colored bg, just ensure text stays white */
[data-scheme="dark"] .cgb-qb__quote,
[data-scheme="dark"] .cgb-qb__author {
    color: #fff !important;
}

/* THREE PILLARS — cards already have own bg/color, leave as-is */

/* Note: logo gallery dark inversion is handled by Customizer rule with higher specificity
   (body[data-scheme="dark"] .wp-block-uagb-image-gallery img). Keeping in Customizer. */

/* Kill any white wp-block-group / page-builder background panels on home in dark theme */
[data-scheme="dark"].home main.site-main .wp-block-group.has-background,
body.home[data-scheme="dark"] main.site-main .wp-block-group.has-background {
    background-color: transparent !important;
}

/* Light gray decorative backgrounds inside cgb blocks → transparent on dark */
[data-scheme="dark"] .cgb-blog__card,
[data-scheme="dark"] .cgb-cta--editor,
[data-scheme="dark"] .cgb-cta__cell,
[data-scheme="dark"] .cgb-cta__panel,
[data-scheme="dark"] .cgb-blog,
[data-scheme="dark"] .cgb-numlist {
    background: transparent !important;
}

/* ============================================================
   FONT ALIGNMENT — use theme's font variables instead of hardcoded
   ============================================================ */
.cgb-st__title,
.cgb-st__panel-content h2,
.cgb-st__panel-content h3,
.cgb-why__title,
.cgb-cta__title,
.cgb-cta__heading,
.cgb-blog__title,
.cgb-blog__card-title,
.cgb-blog__heading,
.cgb-numlist__heading,
.cgb-tp__card-title,
.cgb-qb__quote {
    font-family: var(--cs-font-headings-family, 'Montserrat'), sans-serif !important;
}

.cgb-why__lead,
.cgb-why__body,
.cgb-why__body p,
.cgb-cta__lead,
.cgb-cta__body,
.cgb-cta__subtitle,
.cgb-blog__excerpt,
.cgb-blog__meta,
.cgb-numlist__text,
.cgb-numlist__num,
.cgb-st__panel-content,
.cgb-st__panel-content p,
.cgb-st__panel-content li,
.cgb-tp__card-sub,
.cgb-cta__btn {
    font-family: var(--cs-font-base-family, 'Montserrat'), sans-serif !important;
}

/* Empathy Letter (theme subscribe form) — adapt to dark */
[data-scheme="dark"] .cs-subscribe,
[data-scheme="dark"] .cs-subscribe__inner,
[data-scheme="dark"] .cs-subscribe__form,
[data-scheme="dark"] .cs-subscribe__form .cs-form-box {
    background: transparent !important;
}
[data-scheme="dark"] .cs-subscribe__heading,
[data-scheme="dark"] .cs-subscribe__description {
    color: #f0f0f0 !important;
}
[data-scheme="dark"] .cs-subscribe__form input[type="email"] {
    background: #2a2a2a !important;
    color: #f0f0f0 !important;
    border: 1px solid #444 !important;
}
[data-scheme="dark"] .cs-subscribe__form input[type="email"]::placeholder {
    color: #888 !important;
}

/* ============================================================
   DARK THEME — also apply when data-scheme="auto" + system prefers dark
   (theme defaults to data-scheme="auto"; without this block, our overrides
    only fire when user explicitly toggles the dark switch)
   ============================================================ */
@media (prefers-color-scheme: dark) {
    [data-scheme="auto"] .cgb-st__title,
    [data-scheme="auto"] .cgb-st__tab-body,
    [data-scheme="auto"] .cgb-st__tab-body h2,
    [data-scheme="auto"] .cgb-st__tab-body h3,
    [data-scheme="auto"] .cgb-st__tab-body h4,
    [data-scheme="auto"] .cgb-st__tab-body p,
    [data-scheme="auto"] .cgb-st__tab-body li,
    [data-scheme="auto"] .cgb-st__tab-body ul,
    [data-scheme="auto"] .cgb-st__tab-body strong,
    [data-scheme="auto"] .cgb-why__title,
    [data-scheme="auto"] .cgb-why__lead,
    [data-scheme="auto"] .cgb-why__body,
    [data-scheme="auto"] .cgb-why__body p,
    [data-scheme="auto"] .cgb-cta,
    [data-scheme="auto"] .cgb-cta__title,
    [data-scheme="auto"] .cgb-cta__heading,
    [data-scheme="auto"] .cgb-cta__text,
    [data-scheme="auto"] .cgb-cta__body,
    [data-scheme="auto"] .cgb-cta__lead,
    [data-scheme="auto"] .cgb-cta__subtitle,
    [data-scheme="auto"] .cgb-blog__heading,
    [data-scheme="auto"] .cgb-blog__title,
    [data-scheme="auto"] .cgb-blog__card-title,
    [data-scheme="auto"] .cgb-blog__lead,
    [data-scheme="auto"] .cgb-numlist__heading,
    [data-scheme="auto"] .cgb-numlist__text,
    [data-scheme="auto"] .cs-subscribe__heading,
    [data-scheme="auto"] .cs-subscribe__description {
        color: #f0f0f0 !important;
    }
    [data-scheme="auto"] .cgb-cta__title em,
    [data-scheme="auto"] .cgb-cta__heading em,
    [data-scheme="auto"] .cgb-cta__title-accent {
        color: #ff5e72 !important;
    }
    [data-scheme="auto"] .cgb-blog__excerpt,
    [data-scheme="auto"] .cgb-blog__meta,
    [data-scheme="auto"] .cgb-blog__date {
        color: #b0b0b0 !important;
    }
    [data-scheme="auto"] .cgb-st__panel,
    [data-scheme="auto"] .cgb-st__tab-body,
    [data-scheme="auto"] .cgb-st__content-cell,
    [data-scheme="auto"] .cgb-blog__card,
    [data-scheme="auto"] .cgb-cta--editor,
    [data-scheme="auto"] .cgb-cta__cell,
    [data-scheme="auto"] .cgb-cta__panel,
    [data-scheme="auto"] .cgb-blog,
    [data-scheme="auto"] .cgb-numlist,
    [data-scheme="auto"] .cs-subscribe,
    [data-scheme="auto"] .cs-subscribe__inner,
    [data-scheme="auto"] .cs-subscribe__form,
    [data-scheme="auto"] .cs-subscribe__form .cs-form-box {
        background: transparent !important;
    }
    body.home[data-scheme="auto"] main.site-main .wp-block-group.has-background {
        background-color: transparent !important;
    }
    [data-scheme="auto"] .cs-subscribe__form input[type="email"] {
        background: #2a2a2a !important;
        color: #f0f0f0 !important;
        border: 1px solid #444 !important;
    }
    [data-scheme="auto"] .cs-subscribe__form input[type="email"]::placeholder {
        color: #888 !important;
    }
    [data-scheme="auto"] .cgb-numlist__item.wp-block-group {
        border-bottom-color: #3a3a3a !important;
    }
    /* Logo inversion in auto + dark system — needs to beat Customizer body.home rule (loaded later) */
    html[data-scheme="auto"] body .wp-block-uagb-image-gallery img,
    html[data-scheme="auto"] body .spectra-image-gallery img,
    body[data-scheme="auto"].home .wp-block-uagb-image-gallery img,
    body[data-scheme="auto"].home .spectra-image-gallery img {
        -webkit-filter: invert(1) grayscale(100%) brightness(200%) !important;
        filter: invert(1) grayscale(100%) brightness(200%) !important;
        opacity: 1 !important;
    }
    /* Signature in cgb-st tab body — invert for dark */
    [data-scheme="auto"] .cgb-st__signature {
        -webkit-filter: brightness(0) invert(1) !important;
        filter: brightness(0) invert(1) !important;
        mix-blend-mode: normal !important;
    }
    /* Outlined "Czytaj więcej" button — dark border on dark bg invisible */
    [data-scheme="auto"] .cgb-blog__btn--outlined {
        border-color: #f0f0f0 !important;
        color: #f0f0f0 !important;
    }
    [data-scheme="auto"] .cgb-blog__btn--outlined:hover,
    [data-scheme="auto"] .cgb-blog__btn--outlined:focus-visible {
        background: #C0162C !important;
        border-color: #C0162C !important;
        color: #fff !important;
    }
}
