
/* =========================================================
   ML CPA — KNOWLEDGE CENTRE
   Editorial directory layout — no cards.
   Designed for the existing Gutenberg block structure.
   ========================================================= */

/* 1. FOUNDATION */
:is(.knowledge-page-hero, .knowledge-learning-section,
    .knowledge-final-cta, .knowledge-disclaimer) {
    --kc-navy: var(--navy, #0b1f3a);
    --kc-orange: var(--orange, #e87524);
    --kc-muted: #536176;
    --kc-border: #dfe5ed;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

:is(.knowledge-page-hero, .knowledge-learning-section,
    .knowledge-final-cta, .knowledge-disclaimer) > .container {
    position: relative;
    width: min(100% - 48px, var(--container-width, 1200px));
    margin-inline: auto;
}

/* 2. HERO — ORIGINAL NAVY DESIGN */
.knowledge-page-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(90px, 9vw, 136px) 0;
    color: #fff;
    background:
        radial-gradient(ellipse at 100% 0%, rgba(232,117,36,.13), transparent 48%),
        linear-gradient(125deg, #091a31 0%, #102c4b 100%);
}

.knowledge-page-hero::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -160px;
    width: 420px;
    height: 420px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

.knowledge-page-hero .section-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 24px;
    color: #ffb87a;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .17em;
    text-transform: uppercase;
}

.knowledge-page-hero .section-label::before,
.knowledge-learning-section .section-heading::before {
    content: "";
    display: inline-block;
    flex-shrink: 0;
    width: 30px;
    height: 8px;
    background:
        linear-gradient(var(--kc-orange), var(--kc-orange)) center top / 30px 2px no-repeat,
        linear-gradient(var(--kc-orange), var(--kc-orange)) center bottom / 30px 2px no-repeat;
}

.knowledge-subpage-hero .section-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 24px;
    color: #ffb87a;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .17em;
    text-transform: uppercase;
}


.section-label::before {
    content: "";

    /* Customizable orange */
    --kc-orange: var(--orange, #e87524);

    display: inline-block;
    flex-shrink: 0;

    /* Decoration dimensions */
    width: 30px;
    height: 8px;

    /* Two horizontal orange lines */
    background:
        linear-gradient(
            var(--kc-orange),
            var(--kc-orange)
        ) center top / 30px 2px no-repeat,

        linear-gradient(
            var(--kc-orange),
            var(--kc-orange)
        ) center bottom / 30px 2px no-repeat;
}

.knowledge-page-hero h1 {
    max-width: 960px;
    margin: 0 0 24px;
    color: #fff;
    font-family: "Times New Roman", Georgia, serif;
    font-size: clamp(2.7rem, 5.2vw, 5rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -.035em;
    -webkit-text-stroke: 0;
    text-shadow: none;
}

.knowledge-page-hero .container > p:not(.section-label) {
    max-width: 760px;
    margin: 0 0 12px;
    color: rgba(255,255,255,.88);
    font-size: clamp(1rem, 1.25vw, 1.1rem);
    line-height: 1.75;
}

.knowledge-page-hero .container > p:last-child {
    margin-bottom: 0;
    color: rgba(255,255,255,.72);
}

/* 3. HIDE THE OLD JS-GENERATED NAVIGATION/FILTERS.
   The obsolete JS should also be removed later. */
.kc-quick-nav,
.kc-filter { display: none !important; }

/* 4. EDITORIAL DIRECTORY — TWO-PART COMPOSITION */
.knowledge-learning-section {
    padding: clamp(85px, 8vw, 126px) 0;
    background: #f8fafc;
}

.knowledge-learning-section > .container {
    display: grid;
    grid-template-columns: minmax(250px, .9fr) minmax(0, 1.7fr);
    align-items: start;
    column-gap: clamp(45px, 6vw, 105px);
}

/* Left: editorial heading + introduction */
.knowledge-learning-section .section-heading {
    position: sticky;
    top: 120px;
    max-width: 390px;
    margin: 0;
    text-align: left;
}

.knowledge-learning-section .section-heading::before {
    margin-bottom: 26px;
}

.knowledge-learning-section .section-heading h2 {
    margin: 0 0 22px;
    color: var(--kc-navy);
    font-family: "Times New Roman", Georgia, serif;
    font-size: clamp(2.35rem, 3.6vw, 3.7rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -.03em;
    -webkit-text-stroke: 0;
}

.knowledge-learning-section .section-heading p {
    max-width: 350px;
    margin: 0;
    color: var(--kc-muted);
    font-size: 1.03rem;
    line-height: 1.85;
}

/* Right: full-width typographic directory, NOT a card grid */
.knowledge-learning-section .knowledge-learning-grid.knowledge-directory-grid {
    display: block;
    min-width: 0;
    margin: 0;
    counter-reset: kc-directory;
}

.knowledge-directory-grid > .knowledge-learning-card {
    counter-increment: kc-directory;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: start;
    column-gap: 18px;
    min-width: 0;
    margin: 0;
    padding: 34px 0 38px;
    background: transparent;
    border: 0;
    border-top: 1px solid #cbd4df;
    border-radius: 0;
    box-shadow: none;
}

.knowledge-directory-grid > .knowledge-learning-card:last-child {
    border-bottom: 1px solid #cbd4df;
}

/* Automatically numbers the four existing Gutenberg Groups 01–04 */
.knowledge-directory-grid > .knowledge-learning-card::before {
    content: counter(kc-directory, decimal-leading-zero);
    display: block;
    grid-column: 1;
    grid-row: 1;
    width: auto;
    height: auto;
    margin: 6px 0 0;
    background: none;
    color: var(--kc-orange);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: .86rem;
    font-weight: 750;
    line-height: 1.5;
    letter-spacing: .12em;
}

.knowledge-directory-grid > .knowledge-learning-card h3 {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    margin: 0;
    color: var(--kc-navy);
    font-family: "Times New Roman", Georgia, serif;
    font-size: clamp(1.7rem, 2.15vw, 2.25rem);
    font-weight: 600;
    line-height: 1.22;
    letter-spacing: -.02em;
}

.knowledge-directory-grid > .knowledge-learning-card p {
    grid-column: 2;
    margin: 13px 0 0;
    max-width: 560px;
    color: var(--kc-muted);
    font-size: .97rem;
    line-height: 1.8;
}

/* Links come from Gutenberg's heading block; no invented URLs */
.knowledge-directory-grid > .knowledge-learning-card h3 a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    color: inherit;
    text-decoration: none;
    transition: color .2s ease;
}

.knowledge-directory-grid > .knowledge-learning-card h3 a::after {
    content: "↗";
    display: inline-block;
    flex-shrink: 0;
    color: var(--kc-orange);
    font-family: Arial, sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1;
    transition: transform .2s ease;
}

.knowledge-directory-grid > .knowledge-learning-card h3 a:hover,
.knowledge-directory-grid > .knowledge-learning-card h3 a:focus-visible {
    color: #bd5c17;
}

.knowledge-directory-grid > .knowledge-learning-card h3 a:hover::after,
.knowledge-directory-grid > .knowledge-learning-card h3 a:focus-visible::after {
    transform: translate(3px, -3px);
}

.knowledge-directory-grid > .knowledge-learning-card h3 a:focus-visible {
    outline: 2px solid var(--kc-orange);
    outline-offset: 6px;
}

/* 5. FINAL CALL TO ACTION — KEEP THE EXISTING IMAGE */
.knowledge-final-cta {
    position: relative;
    padding: clamp(76px, 7vw, 110px) 0;
    background-color: #0b1f3a;
    color: #fff;
    text-align: center;
}

.knowledge-final-cta h2 {
    max-width: 780px;
    margin: 0 auto;
    color: #fff;
    font-family: "Times New Roman", Georgia, serif;
    font-size: clamp(2rem, 3.8vw, 3.25rem);
    font-weight: 600;
    line-height: 1.15;
    -webkit-text-stroke: 0;
}

.knowledge-final-cta p {
    max-width: 710px;
    margin: 20px auto 0;
    color: rgba(255,255,255,.82);
    font-size: 1.025rem;
    line-height: 1.75;
}

.knowledge-final-cta__actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 30px;
}

.knowledge-final-cta__actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 650;
    text-decoration: none;
    transition: background-color .2s ease, transform .2s ease;
}

.knowledge-final-cta__actions .button--primary {
    background: var(--kc-orange);
    color: #fff;
}

.knowledge-final-cta__actions .button--outline-light {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,.72);
}

.knowledge-final-cta__actions .button:hover { transform: translateY(-2px); }
.knowledge-final-cta__actions .button--primary:hover { background: var(--orange-dark, #c95f16); }
.knowledge-final-cta__actions .button--outline-light:hover { background: rgba(255,255,255,.09); }

/* 6. DISCLAIMER */
.knowledge-disclaimer {
    padding: 28px 0;
    background: #fff;
    border-top: 1px solid var(--kc-border);
}

.knowledge-disclaimer p {
    max-width: 1000px;
    margin: 0;
    color: var(--kc-muted);
    font-size: .8rem;
    line-height: 1.7;
}

/* 7. LEGACY RESOURCE STYLES — RETAINED FOR OTHER SUBPAGES */
.knowledge-featured-grid,
.knowledge-resource-list,
.knowledge-tool-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 18px;
}
.knowledge-tool-list { grid-template-columns: repeat(4, minmax(0,1fr)); }
.knowledge-resource-list,
.knowledge-tool-list { list-style: none; margin: 0; padding: 0; }
.knowledge-resource-list li,
.knowledge-tool-list li {
    min-width: 0;
    padding: 22px 20px;
    background: #fff;
    border: 1px solid #dfe5ed;
    border-radius: 12px;
    color: var(--navy, #0b1f3a);
}
.knowledge-featured-section,
.knowledge-resources-section,
.knowledge-tools-section { padding: clamp(76px,7vw,110px) 0; }
.knowledge-resources-section { background: #f2f5fa; }
.knowledge-tools-section,
.knowledge-featured-section { background: #fff; }

/* 8. SCROLL REVEAL — FOR THE EXISTING THEME SCRIPT */
.kc-reveal {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity .5s ease, transform .5s ease;
}
.kc-reveal.kc-visible { opacity: 1; transform: none; }

/* 9. RESPONSIVE LAYOUT */
@media (max-width: 980px) {
    .knowledge-learning-section > .container {
        display: block;
    }
    .knowledge-learning-section .section-heading {
        position: static;
        max-width: 720px;
        margin-bottom: 46px;
    }
    .knowledge-learning-section .section-heading p { max-width: 650px; }
    .knowledge-featured-grid,
    .knowledge-tool-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 700px) {
    :is(.knowledge-page-hero, .knowledge-learning-section,
        .knowledge-final-cta, .knowledge-disclaimer) > .container {
        width: min(100% - 32px, var(--container-width,1200px));
    }
    .knowledge-learning-section { padding: 68px 0; }
    .knowledge-learning-section .section-heading { margin-bottom: 34px; }
    .knowledge-page-hero::after { display: none; }
    .knowledge-directory-grid > .knowledge-learning-card {
        grid-template-columns: 38px minmax(0,1fr);
        column-gap: 12px;
        padding: 27px 0 30px;
    }
    .knowledge-directory-grid > .knowledge-learning-card h3 {
        font-size: clamp(1.55rem, 6vw, 2rem);
    }
    .knowledge-directory-grid > .knowledge-learning-card p { font-size: .95rem; }
    .knowledge-featured-grid,
    .knowledge-resource-list,
    .knowledge-tool-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .kc-reveal, .kc-reveal.kc-visible {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .knowledge-directory-grid h3 a,
    .knowledge-directory-grid h3 a::after,
    .knowledge-final-cta__actions .button {
        transform: none !important;
        transition: none !important;
    }
}

/* 10. SIMPLE DOWNLOAD MONITOR — RETAIN ORIGINAL BUTTON STYLE */
.kc-sdm-library {
    --sdm-orange: #e87524;
    --sdm-orange-hover: #c65a16;
    --sdm-radius: 8px;
}
.kc-sdm-library .sdm_download_item a.sdm_download,
.kc-sdm-library .sdm_download_link a.sdm_download {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 22px;
    background: var(--sdm-orange) !important;
    background-image: none !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--sdm-radius) !important;
    font-size: .95rem;
    font-weight: 700;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    transition: background-color .25s ease, transform .25s ease;
}
.kc-sdm-library .sdm_download_item a.sdm_download:hover,
.kc-sdm-library .sdm_download_item a.sdm_download:focus-visible,
.kc-sdm-library .sdm_download_link a.sdm_download:hover,
.kc-sdm-library .sdm_download_link a.sdm_download:focus-visible {
    background: var(--sdm-orange-hover) !important;
    color: #fff !important;
    transform: translateY(-2px);
}


