/* ============================================
   KNOWLEDGE / BLOG — Greenfield Partners
   Listing page + individual post page styles
   ============================================ */

/* ---------- PAGE BODY ---------- */
.knowledge-body {
    background: #f4f5f5;
    font-family: var(--font);
}

/* Blog post pages: nav starts with blue background (white page = no dark hero beneath it) */
.knowledge-post-body #nav {
    background: rgba(1, 17, 50, 0.97);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.knowledge-main {
    min-height: 100vh;
}

/* ============================================
   LISTING PAGE
   ============================================ */

/* ---------- FILTERS ---------- */
.kn-filters {
    background: #f4f5f5;
}

.kn-filters-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px var(--container-pad);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.kn-filters-inner::-webkit-scrollbar {
    display: none;
}

.kn-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1.5px solid #cad2d1;
    background: transparent;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #717b7a;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.kn-pill:hover {
    color: #010c33;
    border-color: #9aa5a4;
}

.kn-pill--active {
    border-color: #06c4a2;
    background: hsla(169, 94%, 40%, 0.08);
    color: #010c33;
}

/* ---------- HERO ---------- */
.kn-hero {
    position: relative;
    width: 100%;
    height: 36vh;
    min-height: 220px;
    background: var(--navy-deep);
    overflow: hidden;
    flex-shrink: 0;
}

/* Dot texture — matches portfolio & team pages */
.kn-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(255,255,255,0.18)'/%3E%3C/svg%3E");
    background-size: 28px 28px;
    opacity: 0.12;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, black 40%, transparent 100%);
}

/* Subtle blue glow — matches portfolio & team pages */
.kn-hero::after {
    content: '';
    position: absolute;
    top: -10%; right: -5%;
    width: 70%; height: 80%;
    background: radial-gradient(ellipse at 70% 30%, rgba(74, 144, 217, 0.06) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.kn-hero-inner {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding-top: 80px; /* offset for transparent nav */
    width: 100%;
    max-width: var(--container-max);
    padding-left: var(--container-pad);
    padding-right: var(--container-pad);
}

.kn-hero-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 300;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0;
}

.kn-hero-subtitle {
    font-size: clamp(0.875rem, 1.1vw, 1rem);
    font-weight: 300;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.7;
    margin: 0;
    max-width: 560px;
}

/* ---------- LISTING GRID ---------- */
.kn-listing {
    padding: clamp(48px, 6vh, 80px) var(--container-pad) clamp(64px, 8vh, 120px);
}

.kn-listing-inner {
    max-width: var(--container-max);
    margin: 0 auto;
}

.kn-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(20px, 2.5vw, 32px);
}

/* ---------- CARD ---------- */
.kn-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid rgba(1, 12, 51, 0.07);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.35s var(--ease-out-expo),
                box-shadow 0.35s var(--ease-out-expo),
                border-color 0.25s;
}

.kn-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 40px rgba(1, 12, 51, 0.1);
    border-color: rgba(6, 196, 162, 0.3);
}

.kn-card-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    background-color: #f0f1f3;
    transition: transform 0.5s var(--ease-out-expo);
}

.kn-card:hover .kn-card-cover {
    transform: scale(1.03);
}

.kn-card-body {
    padding: 20px 20px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.kn-card-category {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #06c4a2;
    margin-bottom: 10px;
}

.kn-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #010c33;
    letter-spacing: -0.02em;
    line-height: 1.35;
    margin: 0;
}

.kn-card-excerpt {
    font-size: 0.8125rem;
    font-weight: 400;
    color: rgba(1, 12, 51, 0.5);
    line-height: 1.6;
    margin: 8px 0 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kn-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(1, 12, 51, 0.06);
}

.kn-card-meta time {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(1, 12, 51, 0.35);
}

.kn-card-read {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(1, 12, 51, 0.3);
    transition: color 0.2s;
}

.kn-card:hover .kn-card-read {
    color: #06c4a2;
}

/* ---------- EMPTY STATE ---------- */
.kn-empty {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(1, 12, 51, 0.3);
    text-align: center;
    padding: 80px 0;
    font-style: italic;
}

/* ============================================
   POST / ARTICLE PAGE
   ============================================ */

/* ---------- POST HERO (two-column split) ---------- */
.kn-post-hero {
    background: var(--navy-deep, #000a1f);
    padding-top: 80px; /* nav offset */
}

.kn-post-hero-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 420px;
}

.kn-post-hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: clamp(32px, 4vh, 56px) var(--container-pad) clamp(32px, 4vh, 56px) var(--container-pad);
}

/* ---------- BREADCRUMB (sits above article body on white bg) ---------- */
.kn-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.kn-breadcrumb-link {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(1, 12, 51, 0.4);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

.kn-breadcrumb-link:hover {
    color: rgba(1, 12, 51, 0.8);
}

/* Category crumb — colored per category */
.kn-breadcrumb-cat[data-cat="Insights"]       { color: #06c4a2; }
.kn-breadcrumb-cat[data-cat="Portfolio"]       { color: #e8836b; }
.kn-breadcrumb-cat[data-cat="Growth Stories"]  { color: #4a90d9; }
.kn-breadcrumb-cat[data-cat="Market"]          { color: #a882d6; }
.kn-breadcrumb-cat:hover { opacity: 0.75; }

.kn-breadcrumb-sep {
    font-size: 0.8125rem;
    color: rgba(1, 12, 51, 0.2);
    flex-shrink: 0;
    user-select: none;
}

.kn-breadcrumb-current {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(1, 12, 51, 0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 360px;
}

/* Back link (in hero = light color) */
.kn-article-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.2s;
    margin-bottom: 8px;
}

.kn-article-back svg {
    stroke: currentColor;
}

.kn-article-back:hover {
    color: rgba(255, 255, 255, 0.85);
}

/* Category pill + reading time row */
.kn-post-hero-tagline {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kn-post-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Category pill colors */
.kn-cat-insights {
    background: rgba(6, 196, 162, 0.15);
    color: #06c4a2;
}

.kn-cat-portfolio {
    background: rgba(232, 131, 107, 0.15);
    color: #e8836b;
}

.kn-cat-growth {
    background: rgba(74, 144, 217, 0.15);
    color: #4a90d9;
}

.kn-cat-market {
    background: rgba(168, 130, 214, 0.15);
    color: #a882d6;
}

.kn-post-readtime {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
}

/* Post hero title */
.kn-post-hero-title {
    font-size: clamp(1.5rem, 2.8vw, 2.25rem);
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0;
}

/* Author cards */
.kn-authors {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 4px;
}

.kn-author-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kn-author-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.kn-author-photo--placeholder {
    background: rgba(255, 255, 255, 0.08);
}

.kn-author-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.kn-author-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #ffffff;
}

.kn-author-role {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
}

/* Published date */
.kn-post-hero-date {
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
    margin: 4px 0 0;
}

/* Cover image (right column) */
.kn-post-hero-cover {
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.03);
    min-height: 100%;
}

/* ---------- ARTICLE WRAPPER ---------- */
.kn-article {
    max-width: 860px;
    margin: 32px auto;
    padding: clamp(40px, 5vh, 64px) var(--container-pad) clamp(64px, 8vh, 120px);
    background: #ffffff;
    border-radius: 16px;
}

/* ---------- BACK LINK (bottom of article) ---------- */
.kn-article-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(1, 12, 51, 0.4);
    text-decoration: none;
    transition: color 0.2s;
}

.kn-article-back-btn:hover {
    color: #010c33;
}

/* ---------- ARTICLE BODY (Rich text) ---------- */
.kn-article-body {
    font-size: 1.0625rem;
    font-weight: 400;
    color: #1a1a2e;
    line-height: 1.8;
}

.kn-article-body h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #010c33;
    letter-spacing: -0.02em;
    margin: 48px 0 16px;
    line-height: 1.3;
}

.kn-article-body h3 {
    font-size: 1.1875rem;
    font-weight: 700;
    color: #010c33;
    letter-spacing: -0.01em;
    margin: 36px 0 12px;
    line-height: 1.35;
}

.kn-article-body h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #010c33;
    margin: 28px 0 10px;
}

.kn-article-body p {
    margin: 0 0 20px;
}

.kn-article-body strong {
    font-weight: 700;
    color: #010c33;
}

.kn-article-body a {
    color: #06c4a2;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.kn-article-body a:hover {
    color: #011132;
}

.kn-article-body ul,
.kn-article-body ol {
    margin: 0 0 20px;
    padding-left: 24px;
}

.kn-article-body li {
    margin-bottom: 8px;
}

.kn-article-body li strong {
    color: #010c33;
}

.kn-article-body blockquote {
    margin: 32px 0;
    padding: 20px 24px;
    border-left: 3px solid #06c4a2;
    background: rgba(6, 196, 162, 0.04);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: rgba(1, 12, 51, 0.65);
}

.kn-article-body blockquote p {
    margin: 0;
}

.kn-article-body code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    background: rgba(1, 12, 51, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: #011132;
}

.kn-article-body pre {
    margin: 24px 0;
    padding: 20px 24px;
    background: #011132;
    border-radius: 10px;
    overflow-x: auto;
}

.kn-article-body pre code {
    background: none;
    padding: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8125rem;
    line-height: 1.7;
}

.kn-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 24px auto;
    display: block;
}

.kn-article-body hr {
    border: none;
    height: 1px;
    background: rgba(1, 12, 51, 0.08);
    margin: 40px 0;
}

.kn-article-body em {
    font-style: italic;
}

/* ---------- ARTICLE FOOTER ---------- */
.kn-article-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid rgba(1, 12, 51, 0.08);
}

/* ============================================
   RELATED ARTICLES (bottom of post pages)
   ============================================ */

.kn-related {
    background: linear-gradient(180deg, #01102e 0%, var(--navy-deep, #000a1f) 100%);
    padding: clamp(56px, 7vh, 88px) var(--container-pad) clamp(64px, 8vh, 96px);
    margin: 0;
}

.kn-related-inner {
    max-width: var(--container-max);
    margin: 0 auto;
}

/* Header row: title + button */
.kn-related-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: clamp(32px, 4vh, 48px);
}

.kn-related-title {
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    font-weight: 300;
    color: #ffffff;
    letter-spacing: -0.03em;
    margin: 0;
}

.kn-related-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    border-radius: 999px;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: border-color 0.25s, color 0.25s, background 0.25s;
}

.kn-related-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.kn-related-btn svg {
    flex-shrink: 0;
}

/* Card grid — 3 columns */
.kn-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(20px, 2.5vw, 32px);
}

/* Cards on dark background — override border for contrast */
.kn-related-card {
    border-color: rgba(255, 255, 255, 0.06);
}

.kn-related-card:hover {
    border-color: rgba(6, 196, 162, 0.35);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

/* ── SCALED DISPLAY FIX — Knowledge page ── */
@media (min-width: 1025px) and (max-width: 1439px) {

    .kn-hero {
        height: 44vh;
        min-height: 280px;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 960px) {
    .kn-grid,
    .kn-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kn-post-hero-inner {
        grid-template-columns: 1fr;
    }

    .kn-post-hero-cover {
        height: 280px;
        order: -1; /* image on top on tablet */
    }
}

@media (max-width: 600px) {
    .kn-grid,
    .kn-related-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }

    .kn-related-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .kn-post-hero-cover {
        height: 220px;
    }

    .kn-post-hero-title {
        font-size: 1.4rem;
    }

    .kn-article-body {
        font-size: 1rem;
    }

    .kn-article-body h2 {
        font-size: 1.3rem;
    }

    .kn-article-body h3 {
        font-size: 1.1rem;
    }
}
