/* ==========================================================================
   Resources Hub — unified Blogs / Case Studies / Articles page
   ========================================================================== */

.resources-hub {
    --rh-card-bg: var(--secondary);
    --rh-border: rgba(255, 255, 255, 0.08);
    --rh-muted: rgba(255, 255, 255, 0.45);
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px 80px;
    color: var(--text-color);
}

body.lightmode .resources-hub {
    --rh-border: rgba(0, 0, 0, 0.08);
    --rh-muted: rgba(0, 0, 0, 0.45);
}
body.lightmode .rh-card-title {
    color: #1a1a1a;
}
body.lightmode .rh-card:hover .rh-card-title {
    color: #1a1a1a;
}

@media (max-width: 600px) {
    .resources-hub {
        padding: 0 14px 60px;
    }
}

@media (max-width: 400px) {
    .resources-hub {
        padding: 0 10px 48px;
    }
}

/* ---------- Hero / search ---------- */
.rh-hero {
    text-align: center;
    padding: 48px 0 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

@media (max-width: 600px) {
    .rh-hero {
        padding: 32px 0 24px;
        gap: 14px;
    }
    .rh-hero p {
        font-size: 13px;
    }
}

@media (max-width: 400px) {
    .rh-hero p {
        font-size: 12px;
    }
}

.rh-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(244, 129, 32, 0.3);
    background: rgba(244, 129, 32, 0.08);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-color);
}

.rh-hero p {
    max-width: 560px;
    color: var(--rh-muted);
    font-size: 15px;
    line-height: 1.6;
}

.rh-search {
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--rh-card-bg);
    border: 1px solid var(--rh-border);
    border-radius: 16px;
    padding: 12px 18px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

@media (max-width: 600px) {
    .rh-search {
        padding: 10px 14px;
        border-radius: 14px;
    }
    .rh-search input {
        font-size: 13px;
    }
}

.rh-search:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(244, 129, 32, 0.12);
}

.rh-search i {
    color: var(--rh-muted);
    font-size: 14px;
}

.rh-search input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text-color);
    font-family: var(--global-font);
    font-size: 14px;
}

.rh-search input::placeholder {
    color: var(--rh-muted);
}

.rh-search button {
    background: transparent;
    border: 0;
    color: var(--rh-muted);
    cursor: pointer;
    font-size: 13px;
}

.rh-search button:hover {
    color: var(--text-color);
}

.rh-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 14px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rh-muted);
}

@media (max-width: 600px) {
    .rh-stats {
        gap: 8px;
        font-size: 9.5px;
    }
    .rh-stats span.rh-sep {
        height: 10px;
    }
}

.rh-stats b {
    color: var(--text-color);
    font-weight: 700;
    margin-right: 4px;
}

.rh-stats span.rh-sep {
    width: 1px;
    height: 12px;
    background: var(--rh-border);
}

/* ---------- Filter bar ---------- */
.rh-filterbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    background: var(--rh-card-bg);
    border: 1px solid var(--rh-border);
    border-radius: 18px;
    padding: 10px;
    margin: 28px 0 8px;
}

@media (max-width: 600px) {
    .rh-filterbar {
        padding: 8px;
        gap: 6px;
        border-radius: 14px;
        margin: 20px 0 6px;
    }
}

.rh-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    color: var(--rh-muted);
    font-family: var(--global-font);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 9px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: color .2s ease, background .2s ease;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .rh-tab {
        font-size: 10px;
        padding: 8px 10px;
        gap: 4px;
        border-radius: 10px;
        flex: 1 1 auto;
        justify-content: center;
        min-width: 0;
        white-space: nowrap;
    }
    .rh-tab i {
        font-size: 10px;
    }
}

@media (max-width: 400px) {
    .rh-filterbar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        padding: 6px;
        margin: 16px 0 4px;
    }
    .rh-tab {
        font-size: 9.5px;
        padding: 7px 8px;
        justify-content: center;
        text-align: center;
    }
    .rh-tab i {
        display: none;
    }
    .rh-tab span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
    }
    .rh-filterbar-spacer {
        display: none;
    }
}

.rh-tab i {
    font-size: 12px;
}

.rh-tab:hover {
    color: var(--text-color);
}

.rh-tab.active {
    background: var(--accent-color);
    color: #fff;
}

.rh-filterbar-spacer {
    flex: 1;
}

.rh-results {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rh-muted);
    padding: 9px 14px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .rh-results {
        font-size: 9px;
        padding: 6px 10px;
    }
}

/* ---------- Category chips ---------- */
.rh-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 36px;
}

.rh-chip {
    border: 1px solid var(--rh-border);
    background: transparent;
    color: var(--rh-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all .2s ease;
}

.rh-chip:hover {
    border-color: var(--accent-color);
    color: var(--text-color);
}

.rh-chip.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

/* ---------- Section headers ---------- */
.rh-section {
    margin-bottom: 64px;
}

/* Add a bit more vertical breathing room for each resources section head */
.rh-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

/* Keep section title content properly aligned (prevents cramped/shifted layout) */
.rh-section-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-family: var(--global-font);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-color);
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
}

@media (max-width: 600px) {
    .rh-section-head {
        gap: 8px;
        margin-bottom: 16px;
    }
    .rh-section-title {
        font-size: 14px;
        gap: 6px;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        flex-shrink: 1;
    }
    .rh-section-icon {
        width: 24px;
        height: 24px;
        font-size: 11px;
        flex-shrink: 0;
    }
    .rh-section-count {
        font-size: 9px;
        padding: 1px 7px;
        flex-shrink: 0;
    }
}

/* Specifically expand “Recently Published” so cards don’t feel cramped */
#rh-recent {
    padding-top: 24px;
    padding-bottom: 36px;
    min-height: 430px;
}

#rh-recent .rh-section-head {
    margin-bottom: 34px;
}

#rh-recent .rh-featured-layout {
    min-height: 340px;
    align-items: stretch;
}

#rh-recent .rh-card--featured {
    min-height: 340px;
}

#rh-recent .rh-featured-col {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding-top: 6px;
    margin-top: -6px;
    overflow: visible;
}

#rh-recent .rh-compact-carousel {
    height: 100%;
    min-height: 340px;
}


.rh-section-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #fff;
}

.rh-section-count {
    font-size: 10px;
    font-weight: 700;
    color: var(--rh-muted);
    background: var(--rh-card-bg);
    border: 1px solid var(--rh-border);
    padding: 2px 9px;
    border-radius: 999px;
}

.rh-scroll-btns {
    display: flex;
    gap: 6px;
}

@media (max-width: 600px) {
    .rh-scroll-btns {
        display: none;
    }
}

.rh-scroll-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--rh-border);
    background: var(--rh-card-bg);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s ease, opacity .2s ease;
}

.rh-scroll-btn:hover {
    border-color: var(--accent-color);
}

.rh-scroll-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.rh-section-desc {
    font-size: 13px;
    color: var(--rh-muted);
    margin: -12px 0 18px;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .rh-section-desc {
        font-size: 12px;
        margin: -8px 0 14px;
    }
}

/* ---------- Carousel track ---------- */
.rh-track {
    display: flex;
    align-items: stretch;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.rh-track::-webkit-scrollbar {
    display: none;
}

.rh-track .rh-card {
    min-width: 270px;
    max-width: 310px;
    min-height: 300px;
    width: 80vw;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .rh-track {
        gap: 12px;
    }
    .rh-track .rh-card {
        min-width: 220px;
        max-width: 260px;
        min-height: 270px;
        width: 72vw;
    }
}

@media (max-width: 400px) {
    .rh-track .rh-card {
        min-width: 180px;
        max-width: 220px;
        width: 65vw;
    }
}

/* ---------- Grids ---------- */
.rh-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

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

@media (max-width: 600px) {
    .rh-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Featured layout ---------- */
.rh-featured-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .rh-featured-layout {
        grid-template-columns: 1fr;
    }
}

.rh-compact-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

/* ---------- Card ---------- */
.rh-card {
    position: relative;
    display: block;
    background: var(--rh-card-bg);
    border: 1px solid var(--rh-border);
    border-radius: 18px;
    overflow: hidden;
    text-align: left;
    text-decoration: none;
    color: var(--text-color);
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.rh-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
}

.rh-card-banner {
    position: relative;
    aspect-ratio: 16 / 9;
    height: auto;
    flex-shrink: 0;
    overflow: hidden;
    background-image:
        radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.22), transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(0, 0, 0, 0.25), transparent 50%);
}

.rh-card-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px);
    background-size: 14px 14px;
    opacity: 0.15;
}

.rh-card-banner i.rh-banner-icon {
    position: absolute;
    right: -8px;
    bottom: -10px;
    font-size: 72px;
    color: rgba(255, 255, 255, 0.14);
}

.rh-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transition: transform .3s ease;
}

.rh-card:hover .rh-card-img {
    transform: scale(1.06);
}

.rh-card-banner.has-image::before {
    background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.55) 100%);
    background-size: auto;
    opacity: 1;
}

.rh-card-banner.has-image i.rh-banner-icon {
    display: none;
}

.rh-card-type {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
}

.rh-card-tag {
    position: absolute;
    left: 10px;
    bottom: 10px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 3px 9px;
    border-radius: 999px;
}

.rh-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

@media (max-width: 600px) {
    .rh-card-body {
        padding: 14px;
    }
}

.rh-card-title {
    font-family: var(--global-font);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.4;
    text-transform: uppercase;
    margin: 0 0 8px;
    min-height: 40px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s ease;
}

@media (max-width: 600px) {
    .rh-card-title {
        font-size: 12px;
        min-height: 34px;
    }
}

.rh-card:hover .rh-card-title {
    color: var(--accent-color);
}

.rh-card-excerpt {
    font-size: 12px;
    line-height: 1.55;
    color: var(--rh-muted);
    margin: 0 0 14px;
    min-height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 600px) {
    .rh-card-excerpt {
        font-size: 11px;
        min-height: 32px;
    }
}

.rh-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--rh-border);
    margin-top: auto;
}

.rh-card-meta {
    font-size: 10px;
    color: var(--rh-muted);
    display: flex;
    gap: 6px;
}

.rh-card-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent-color);
}

/* ---------- Compact carousel wrapper ---------- */
.rh-compact-carousel {
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.rh-compact-track {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    will-change: transform;
}

.rh-compact-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
}

.rh-compact-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 10px 0 4px;
    flex-shrink: 0;
}

.rh-compact-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: none;
    background: var(--rh-border);
    cursor: pointer;
    padding: 0;
    display: block;
    /* width is animated by GSAP */
}

.rh-compact-dot.active {
    background: var(--accent-color);
    width: 24px; /* initial state for CSS, GSAP takes over */
}

/* ---------- Compact card variant (bento: banner top, title below) ---------- */
.rh-card.rh-card--compact {
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    width: 100%;
}

.rh-card--compact .rh-card-banner {
    width: 100%;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
}

.rh-card--compact .rh-card-banner i.rh-banner-icon {
    font-size: 48px;
    right: -6px;
    bottom: -6px;
}

.rh-card--compact .rh-card-body {
    padding: 14px 18px 16px;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
}

.rh-card--compact .rh-card-title {
    font-size: 13px;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    min-height: unset;
    flex: none;
    margin: 0;
    text-align: left;
}

.rh-card--compact .rh-card-excerpt {
    font-size: 11px;
    -webkit-line-clamp: 2;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Featured card variant ---------- */
/* Full-width featured image with text below. */
.rh-card--featured {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 180px 1fr;
    align-items: stretch;
    height: 100%;
}

.rh-card--featured .rh-card-body {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    padding: 26px 30px;
    justify-content: center;
    align-items: stretch;
}

.rh-card--featured .rh-card-banner {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    height: 180px;
    align-self: stretch;
}

.rh-card--featured .rh-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.rh-card--featured {
    box-shadow: inset 0 3px 0 0 var(--accent-color);
}

.rh-card--featured .rh-card-title {
    font-size: 22px;
    line-height: 1.35;
    margin: 0 0 14px;
    -webkit-line-clamp: 2;
    text-align: left;
}

.rh-card--featured .rh-card-excerpt {
    font-size: 14px;
    line-height: 1.65;
    margin: 0 0 18px;
    -webkit-line-clamp: 2;
    text-align: left;
}

@media (max-width: 700px) {
    .rh-card--featured {
        grid-template-columns: 1fr;
        grid-template-rows: 160px 1fr;
    }

    .rh-card--featured .rh-card-banner {
        height: 160px;
    }
}

@media (max-width: 600px) {
    .rh-card--featured .rh-card-body {
        padding: 18px 20px;
    }
    .rh-card--featured .rh-card-title {
        font-size: 17px;
    }
    .rh-card--featured .rh-card-excerpt {
        font-size: 12px;
    }
    .rh-compact-stack {
        gap: 8px;
    }
}

/* ---------- Gradient swatches (category color) ---------- */
.rh-grad-orange {
    background: linear-gradient(135deg, #f48120, #ff6b35);
}

.rh-grad-blue {
    background: linear-gradient(135deg, #2563eb, #6366f1);
}

.rh-grad-teal {
    background: linear-gradient(135deg, #0d9488, #0ea5e9);
}

.rh-grad-purple {
    background: linear-gradient(135deg, #7c3aed, #4338ca);
}

.rh-grad-rose {
    background: linear-gradient(135deg, #e11d48, #db2777);
}

.rh-badge-orange {
    background: rgba(244, 129, 32, 0.12);
    color: #f48120;
    border: 1px solid rgba(244, 129, 32, 0.25);
}

.rh-badge-blue {
    background: rgba(37, 99, 235, 0.12);
    color: #5b8def;
    border: 1px solid rgba(37, 99, 235, 0.25);
}

.rh-badge-teal {
    background: rgba(13, 148, 136, 0.12);
    color: #2dd4bf;
    border: 1px solid rgba(13, 148, 136, 0.25);
}

.rh-badge-purple {
    background: rgba(124, 58, 237, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(124, 58, 237, 0.25);
}

.rh-badge-rose {
    background: rgba(225, 29, 72, 0.12);
    color: #fb7185;
    border: 1px solid rgba(225, 29, 72, 0.25);
}

/* ---------- No results ---------- */
.rh-empty {
    text-align: center;
    padding: 80px 0;
    color: var(--rh-muted);
}

.rh-empty i {
    font-size: 26px;
    margin-bottom: 14px;
    display: block;
}

.rh-empty button {
    margin-top: 10px;
    background: transparent;
    border: 0;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
}

/* ---------- Footer nav block ---------- */
.rh-footer-nav {
    margin-top: 24px;
    padding-top: 40px;
    border-top: 1px solid var(--rh-border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

@media (max-width: 800px) {
    .rh-footer-nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 400px) {
    .rh-footer-nav {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding-top: 24px;
    }
}

.rh-footer-col h4 {
    font-family: var(--global-font);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 14px;
    color: var(--text-color);
}

.rh-footer-col button,
.rh-footer-col a {
    display: block;
    background: none;
    border: 0;
    text-align: left;
    width: 100%;
    color: var(--rh-muted);
    font-size: 12px;
    padding: 5px 0;
    cursor: pointer;
    text-decoration: none;
}

.rh-footer-col button:hover,
.rh-footer-col a:hover {
    color: var(--accent-color);
}

.rh-footer-col .rh-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    padding: 5px 0;
    color: var(--rh-muted);
}

.rh-footer-col .rh-stat-row b {
    color: var(--text-color);
}

.rh-footer-bottom {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--rh-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.rh-footer-bottom p {
    font-size: 12px;
    color: var(--rh-muted);
    margin: 0;
}

.rh-back-top {
    background: none;
    border: 0;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}