/* ==========================================================================
   BLOG LISTING — page-scoped styles
   Editorial lead + filterable grid. Same light palette and card vocabulary as
   knowledge.css and ceo.css. Loaded only on /blog.
   ========================================================================== */

.bl-page {
    --bl-ink: var(--gf-navy);
    --bl-ink-soft: rgba(48, 68, 79, 0.74);
    --bl-ink-faint: rgba(48, 68, 79, 0.55);
    --bl-line: rgba(94, 179, 70, 0.24);
    --bl-card: #ffffff;
    --bl-shadow: 0 14px 34px rgba(48, 68, 79, 0.1);

    font-family: "Poppins", sans-serif;
    background: linear-gradient(to right, #f1f6f7, #d5f1f1);
}

/* The theme sets a global `img, svg { border-radius: 15px }`; media here is
   clipped by its own wrapper instead. Scoped, not removed globally. */
.bl-page img {
    border-radius: 0;
}

.bl-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- shared ---------- */
.bl-eyebrow {
    display: inline-block;
    margin-bottom: 0.85rem;
    padding: 0.38rem 1rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gf-green-dark);
    background: rgba(94, 179, 70, 0.1);
    border: 1px solid var(--bl-line);
}

.bl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.78rem 1.55rem;
    border-radius: 100px;
    font-size: 0.87rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bl-btn--solid {
    color: #ffffff;
    background: linear-gradient(90deg, var(--gf-green), var(--gf-green-dark));
    box-shadow: 0 10px 24px rgba(94, 179, 70, 0.3);
}

.bl-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.7rem;
    font-size: 0.75rem;
    color: var(--bl-ink-faint);
}

.bl-dot {
    opacity: 0.6;
}

/* Stand-in for posts with no featured image. */
.bl-media-blank {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background:
        radial-gradient(ellipse 70% 70% at 50% 40%, rgba(94, 179, 70, 0.16), transparent 70%),
        linear-gradient(135deg, #eef5ea, #dcebe4);
}

.bl-media-blank i {
    font-size: 1.9rem;
    color: rgba(94, 179, 70, 0.75);
}

/* ==========================================================================
   HEAD
   ========================================================================== */
.bl-head {
    position: relative;
    overflow: hidden;
    /* The site header is position:fixed at 72px, so this has to clear it. */
    padding: calc(72px + clamp(1.5rem, 4vw, 3rem)) 0 clamp(1.5rem, 3vw, 2.5rem);
}

.bl-head-aurora {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bl-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.bl-blob--a {
    top: -20%;
    left: 6%;
    width: 28rem;
    height: 28rem;
    background: rgba(94, 179, 70, 0.2);
    animation: blDriftA 24s ease-in-out infinite alternate;
}

.bl-blob--b {
    top: -10%;
    right: -4%;
    width: 26rem;
    height: 26rem;
    background: rgba(90, 196, 180, 0.18);
    animation: blDriftB 29s ease-in-out infinite alternate;
}

@keyframes blDriftA {
    to { transform: translate3d(5rem, 2.5rem, 0) scale(1.1); }
}

@keyframes blDriftB {
    to { transform: translate3d(-4rem, 3rem, 0) scale(0.92); }
}

.bl-head-inner {
    position: relative;
    z-index: 1;
    max-width: 46rem;
    margin: 0 auto;
    text-align: center;
}

.bl-title {
    margin: 0 0 1rem;
    font-weight: 700;
    font-size: clamp(2rem, 4.6vw, 3.2rem);
    line-height: 1.12;
    letter-spacing: -0.028em;
    color: var(--bl-ink);
}

.bl-title span {
    color: var(--gf-green);
}

.bl-lead {
    max-width: 34rem;
    margin: 0 auto 1.8rem;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--bl-ink-soft);
}

/* ---------- search ---------- */
.bl-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 32rem;
    margin: 0 auto 1rem;
    padding: 0.4rem 0.4rem 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--bl-line);
    border-radius: 100px;
    box-shadow: var(--bl-shadow);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.bl-search:focus-within {
    border-color: var(--gf-green);
    box-shadow: 0 16px 36px rgba(94, 179, 70, 0.22);
}

.bl-search > i {
    flex: none;
    font-size: 0.9rem;
    color: var(--gf-green-dark);
}

.bl-search-input {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.2rem;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--bl-ink);
    background: transparent;
    border: none;
    outline: none;
}

.bl-search-btn {
    flex: none;
    padding: 0.6rem 1.35rem;
    border: none;
    border-radius: 100px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    background: linear-gradient(90deg, var(--gf-green), var(--gf-green-dark));
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.bl-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(94, 179, 70, 0.35);
}

.bl-result-line {
    margin: 0;
    font-size: 0.86rem;
    color: var(--bl-ink-soft);
}

.bl-result-line--muted {
    color: var(--bl-ink-faint);
}

.bl-clear {
    margin-left: 0.6rem;
    font-weight: 600;
    color: var(--gf-green-dark);
    text-decoration: underline;
}

/* ==========================================================================
   FEATURED
   ========================================================================== */
.bl-featured {
    padding: clamp(1rem, 2vw, 1.5rem) 0 clamp(1.5rem, 3vw, 2.2rem);
}

.bl-feature {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    overflow: hidden;
    text-decoration: none;
    background: var(--bl-card);
    border: 1px solid rgba(94, 179, 70, 0.2);
    border-radius: 26px;
    box-shadow: var(--bl-shadow);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease,
        border-color 0.35s ease;
}

.bl-feature:hover {
    transform: translateY(-6px);
    border-color: rgba(94, 179, 70, 0.5);
    box-shadow: 0 26px 52px -20px rgba(94, 179, 70, 0.45), var(--bl-shadow);
}

.bl-feature-media {
    position: relative;
    overflow: hidden;
    min-height: 20rem;
    background: #e3ece6;
}

.bl-feature-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.bl-feature:hover .bl-feature-media img {
    transform: scale(1.05);
}

/* Right-aligned: several featured images have their own title text burned into
   the top-left, which a badge there sits straight on top of. */
.bl-feature-flag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    padding: 0.32rem 0.85rem;
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #ffffff;
    background: var(--gf-green);
    box-shadow: 0 8px 18px rgba(94, 179, 70, 0.4);
}

.bl-feature-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(1.5rem, 3vw, 2.6rem);
}

.bl-feature-title {
    margin: 0 0 0.8rem;
    font-size: clamp(1.25rem, 2.1vw, 1.7rem);
    font-weight: 700;
    line-height: 1.28;
    color: var(--bl-ink);
    transition: color 0.25s ease;
}

.bl-feature:hover .bl-feature-title {
    color: var(--gf-green-dark);
}

.bl-feature-excerpt {
    margin-bottom: 1.5rem;
    font-size: 0.93rem;
    line-height: 1.78;
    color: var(--bl-ink-soft);
}

/* ==========================================================================
   LISTING
   ========================================================================== */
.bl-listing {
    padding: 0 0 clamp(2rem, 4vw, 3rem);
}

.bl-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.bl-filter {
    padding: 0.52rem 1.15rem;
    border-radius: 100px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--bl-ink-soft);
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--bl-line);
    transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease,
        transform 0.25s ease;
}

.bl-filter:hover {
    transform: translateY(-2px);
    border-color: var(--gf-green);
}

.bl-filter.is-active {
    color: #ffffff;
    background: linear-gradient(90deg, var(--gf-green), var(--gf-green-dark));
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(94, 179, 70, 0.3);
}

.bl-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.3rem;
}

.bl-card {
    display: flex;
    opacity: 1;
    transform: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    /* Vanishing point for the shared tilt in services-tilt.js. */
    perspective: 900px;
}

.bl-card[hidden] {
    display: none;
}

.bl-card.is-leaving {
    opacity: 0;
    transform: scale(0.94) translateY(6px);
}

.bl-card.is-entering {
    opacity: 0;
    transform: translateY(14px);
}

.bl-card-link {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    text-decoration: none;
    background: var(--bl-card);
    border: 1px solid rgba(94, 179, 70, 0.2);
    border-radius: 20px;
    box-shadow: var(--bl-shadow);
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease,
        border-color 0.35s ease;
}

.bl-card-link:hover {
    transform: translateY(-7px);
    border-color: rgba(94, 179, 70, 0.5);
    box-shadow: 0 24px 46px -20px rgba(94, 179, 70, 0.45), var(--bl-shadow);
}

/* While the tilt script drives the rotation it owns the transform outright. */
.bl-card-link.is-tilting {
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

/* ---------- moving border ring ----------
   Same construction as the CEO and Knowledge Centre cards: a conic gradient
   masked to a 2px rim with its start angle animated. Declared here too because
   the page stylesheets are never loaded together. */
@property --bl-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes blRingSpin {
    to { --bl-angle: 360deg; }
}

.bl-card-link,
.bl-feature {
    --bl-angle: 0deg;
}

.bl-card-link::before,
.bl-feature::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: inherit;
    padding: 2px;
    background: conic-gradient(from var(--bl-angle),
        #4a9e3c 0deg,
        #4a9e3c 265deg,
        #8ed157 310deg,
        #d9f5b4 332deg,
        #8ed157 352deg,
        #4a9e3c 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    animation: blRingSpin 3.5s linear infinite;
    animation-play-state: paused;
}

.bl-card-link:hover::before,
.bl-card-link:focus-visible::before,
.bl-feature:hover::before,
.bl-feature:focus-visible::before {
    opacity: 1;
    animation-play-state: running;
}

/* Cursor-follow glow, fed --mx/--my by the shared tilt loop. */
.bl-card-link::after,
.bl-feature::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%),
        rgba(94, 179, 70, 0.16), transparent 60%);
    transition: opacity 0.35s ease;
}

.bl-card-link:hover::after,
.bl-feature:hover::after {
    opacity: 1;
}

.bl-card-media,
.bl-card-body,
.bl-feature-media,
.bl-feature-body {
    position: relative;
    z-index: 1;
}

.bl-card-media {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #e3ece6;
}

.bl-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.bl-card-link:hover .bl-card-media img {
    transform: scale(1.06);
}

/* A light sweep across the artwork on hover. */
.bl-card-media::after,
.bl-feature-media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 35%,
        rgba(255, 255, 255, 0.38) 50%, transparent 65%);
    transform: translateX(-120%);
    transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.bl-card-link:hover .bl-card-media::after,
.bl-feature:hover .bl-feature-media::after {
    transform: translateX(120%);
}

.bl-card-arrow {
    position: absolute;
    right: 0.8rem;
    bottom: 0.8rem;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    font-size: 0.78rem;
    color: #ffffff;
    background: var(--gf-green);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.bl-card-link:hover .bl-card-arrow,
.bl-card-link:focus-visible .bl-card-arrow {
    opacity: 1;
    transform: translateY(0);
}

.bl-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.2rem 1.3rem 1.4rem;
}

.bl-card-title {
    margin: 0 0 0.55rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.42;
    color: var(--bl-ink);
    transition: color 0.25s ease;
}

.bl-card-link:hover .bl-card-title {
    color: var(--gf-green-dark);
}

.bl-card-excerpt {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    line-height: 1.68;
    color: var(--bl-ink-soft);
}

.bl-card-more {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gf-green-dark);
}

.bl-card-more i {
    transition: transform 0.25s ease;
}

.bl-card-link:hover .bl-card-more i {
    transform: translateX(4px);
}

.bl-no-match,
.bl-empty {
    grid-column: 1 / -1;
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.95rem;
    color: var(--bl-ink-soft);
}

.bl-no-match a,
.bl-empty a {
    margin-left: 0.4rem;
    font-weight: 600;
    color: var(--gf-green-dark);
    text-decoration: underline;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.bl-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0 1rem clamp(3rem, 6vw, 4.5rem);
}

.bl-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--bl-ink);
    background: #ffffff;
    border: 1px solid var(--bl-line);
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.bl-page-btn:hover {
    color: var(--gf-green-dark);
    border-color: var(--gf-green);
    transform: translateY(-2px);
}

.bl-page-btn.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.bl-page-list {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bl-page-list a {
    display: grid;
    place-items: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 0.5rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--bl-ink-soft);
    transition: color 0.25s ease, background 0.25s ease;
}

.bl-page-list a:hover {
    color: var(--gf-green-dark);
    background: rgba(94, 179, 70, 0.12);
}

.bl-page-list a.is-current {
    color: #ffffff;
    background: linear-gradient(90deg, var(--gf-green), var(--gf-green-dark));
    box-shadow: 0 8px 18px rgba(94, 179, 70, 0.32);
}

.bl-gap {
    padding: 0 0.2rem;
    color: var(--bl-ink-faint);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media only screen and (max-width: 991px) {
    .bl-grid { grid-template-columns: repeat(2, 1fr); }
    .bl-feature { grid-template-columns: 1fr; }
    .bl-feature-media { min-height: 15rem; }
}

@media only screen and (max-width: 575px) {
    .bl-grid { grid-template-columns: 1fr; }
    .bl-search {
        flex-wrap: wrap;
        padding: 0.8rem;
        border-radius: 22px;
    }
    .bl-search-input { flex-basis: 70%; }
    .bl-search-btn { width: 100%; }
    .bl-page-btn span { display: none; }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .bl-page *,
    .bl-page *::before,
    .bl-page *::after {
        animation: none !important;
        transition: none !important;
    }
    .bl-blob { transform: none !important; }
    .bl-card-arrow { opacity: 1; transform: none; }
}
