/**
 * Research Cluster Ecosystem — Full-Width 4-Column Card Grid
 * Monochrome Editorial Layout | Black & White Gradient Bento Wrapper
 * 4 Cards Per Straight Line | 8 Cards Default (2 Rows of 4)
 * Dynamic 'See More' Only When Above 8 Cards
 * White Card Outlines | Pure White Internal Typography & Numbers
 * v15.0
 */

/* ══════════════════════════════════════════
   SECTION WRAPPER (Full-Width)
══════════════════════════════════════════ */
.cluster-pin-section {
    position: relative;
    width: 100%;
    padding: 5.5rem clamp(1rem, 3vw, 3.5rem) 6.5rem;
    background: #E8F6F3 !important; /* Section 2 background: #E8F6F3 */
    color: #042C2E;
    overflow: hidden;
    box-sizing: border-box;
}

/* Ambient glow blobs & vector arcs removed for clean background */
.cluster-bg-glow {
    display: none !important;
}

.cluster-bg-vector-arcs {
    display: none !important;
}

/* ══════════════════════════════════════════
   SECTION INNER CONTAINER (Full-Width)
══════════════════════════════════════════ */
.cluster-section-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

/* ══════════════════════════════════════════
   SECTION HEADER
══════════════════════════════════════════ */
.cluster-section-top-header {
    text-align: center;
    margin-bottom: 3.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
}

.cluster-hero-gradient-title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2rem, 3.4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.18;
    color: #042C2E;
    margin: 0;
}

.cluster-section-sub {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.98rem;
    font-weight: 500;
    color: #2D5856;
    max-width: 700px;
    margin: 0;
    line-height: 1.65;
}

/* ══════════════════════════════════════════
   BENTO WRAPPER — Background Removed as Requested
══════════════════════════════════════════ */
.cluster-bento-wrapper {
    width: 100%;
    box-sizing: border-box;
    background: transparent !important; /* Background part removed */
    border: none !important;
    box-shadow: none !important;
    border-radius: 0;
    padding: 0;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ══════════════════════════════════════════
   CARD GRID — 4 Cards in One Straight Line
══════════════════════════════════════════ */
.cluster-pin-grid {
    display: grid;
    margin-top:-18px;
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* 4 cards per row */
    gap: 1.25rem;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
}

/* ══════════════════════════════════════════
   CARD BASE — White Cards with Crisp Shadow
══════════════════════════════════════════ */
.cluster-pin-card {
    position: relative;
    background: #ffffff !important; /* Pure white card background */
    border: 1px solid rgba(64, 160, 160, 0.2) !important;
    border-radius: 18px;
    padding: 1.85rem 1.45rem;
    text-decoration: none;
    color: #042C2E !important; /* Solid dark green text */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 270px;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(7, 63, 67, 0.07), 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1),
                border-color 280ms ease,
                box-shadow 280ms ease,
                background-color 280ms ease;
    cursor: pointer;
}

.cluster-pin-card::before {
    display: none !important;
}

.cluster-pin-card:hover,
.cluster-pin-card:focus-visible {
    background: #ffffff !important;
    border-color: #40A0A0 !important;
    box-shadow: 0 16px 36px rgba(7, 63, 67, 0.12), 0 0 16px rgba(64, 160, 160, 0.18) !important;
    transform: translateY(-5px);
    outline: none;
}

.cluster-pin-card:hover::before,
.cluster-pin-card:focus-visible::before {
    opacity: 1;
}

/* Hidden state for cards above 8 when collapsed */
.cluster-card-hidden {
    display: none !important;
}

/* ══════════════════════════════════════════
   CARD TOP ROW
══════════════════════════════════════════ */
.cluster-card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
}

.cluster-card-title-col {
    flex: 1 1 auto;
    min-width: 0;
}

.cluster-card-eyebrow {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 800;
    color: #042C2E !important; /* Solid dark green */
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.4rem;
    opacity: 0.85;
}

/* CLUSTER NAME AS BIG SIZE — SOLID DARK GREEN (WRAPS PROPERLY WHEN LONG) */
.cluster-card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.12rem, 1.35vw, 1.4rem);
    font-weight: 800;
    line-height: 1.3;
    color: #042C2E !important; /* Solid dark green text */
    margin: 0;
    letter-spacing: -0.015em;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: manual;
    text-wrap: balance;
    transition: color 240ms ease;
}

.cluster-pin-card:hover .cluster-card-title {
    color: #042C2E !important;
    text-shadow: none;
}

/* Top-Right Corner Container */
.cluster-card-top-right {
    flex-shrink: 0;
}

/* Small Image shown at Top-Right Corner */
.cluster-card-corner-img-wrap {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    overflow: hidden;
    background: #f4f4f5;
    border: 1.5px solid #000000;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 240ms ease, box-shadow 240ms ease;
}

.cluster-card-corner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cluster-pin-card:hover .cluster-card-corner-img-wrap {
    transform: scale(1.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* Interactive Black Arrow Badge when image is absent */
.cluster-card-arrow-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #000000;
    border: 1.5px solid #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 240ms ease;
}

.cluster-pin-card:hover .cluster-card-arrow-badge {
    background: #27272a;
    color: #ffffff;
    transform: translate(2px, -2px);
    box-shadow: 0 0 14px rgba(0, 0, 0, 0.35);
}

/* ══════════════════════════════════════════
   CARD CENTER: DEPARTMENT NUMBER — SOLID DARK GREEN
══════════════════════════════════════════ */
.cluster-card-stat-block {
    margin: 1.5rem 0 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cluster-card-dept-number-wrap {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.cluster-card-dept-number {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.6rem, 3.6vw, 3.6rem);
    font-weight: 800;
    line-height: 1;
    color: #042C2E !important; /* SOLID DARK GREEN */
    letter-spacing: -0.045em;
    margin: 0;
    text-shadow: none;
    transition: color 240ms ease;
}

.cluster-pin-card:hover .cluster-card-dept-number {
    color: #042C2E !important;
    text-shadow: none;
}

.cluster-card-dept-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    color: #042C2E !important; /* SOLID DARK GREEN */
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.45rem;
    opacity: 0.85;
}

/* ══════════════════════════════════════════
   CARD BOTTOM / FOOTER — SOLID BLACK ACCENTS
══════════════════════════════════════════ */
.cluster-card-footer {
    border-top: 1px solid #e4e4e7;
    padding-top: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
}

.cluster-card-depts-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.cluster-dept-chip {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    background: #f0fdf9;
    border: 1px solid rgba(4, 44, 46, 0.15);
    color: #042C2E;
    padding: 0.28rem 0.6rem;
    border-radius: 7px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.35;
    transition: all 200ms ease;
}

.cluster-dept-chip.chip-more {
    color: #ffffff;
    border-color: #042C2E;
    background: #042C2E;
    font-weight: 700;
}

.cluster-pin-card:hover .cluster-dept-chip {
    border-color: rgba(4, 44, 46, 0.3);
    background: #e6f7f4;
}

.cluster-card-depts-empty {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    color: #2D5856;
    font-style: italic;
    line-height: 1.4;
}

.cluster-card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    color: #042C2E !important; /* SOLID DARK GREEN */
    letter-spacing: 0.03em;
    transition: all 220ms ease;
}

.cluster-card-action span {
    color: #042C2E !important;
}

.cluster-card-action svg {
    stroke: #000000 !important;
    transition: transform 220ms ease;
}

.cluster-pin-card:hover .cluster-card-action svg {
    transform: translateX(6px);
}

.cluster-empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
    color: rgba(4, 44, 46, 0.7);
    font-size: 0.95rem;
    grid-column: 1 / -1;
}

/* ══════════════════════════════════════════
   SEE MORE / SEE LESS BUTTON CONTAINER
══════════════════════════════════════════ */
.cluster-see-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 2.4rem;
    padding-top: 1.8rem;
    border-top: 1px solid rgba(64, 160, 160, 0.25);
    width: 100%;
}

.cluster-see-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    background: #042C2E;
    border: 1.5px solid #042C2E;
    border-radius: 999px;
    padding: 0.95rem 2.4rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(4, 44, 46, 0.16);
    transition: all 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.cluster-see-more-btn:hover,
.cluster-see-more-btn:focus-visible {
    background: #40A0A0;
    border-color: #40A0A0;
    color: #ffffff;
    box-shadow: 0 10px 28px rgba(64, 160, 160, 0.35);
    transform: translateY(-3px);
    outline: none;
}

.cluster-see-more-btn svg {
    transition: transform 240ms ease;
    stroke: currentColor;
}

.cluster-see-more-btn:hover svg {
    transform: translateY(2px);
}

.cluster-grid-expanded .cluster-pin-card {
    animation: clusterCardSlideDown 340ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes clusterCardSlideDown {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ══════════════════════════════════════════
   RESPONSIVE DESIGN
══════════════════════════════════════════ */
@media (max-width: 1200px) {
    .cluster-pin-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.15rem;
    }
}

@media (max-width: 640px) {
    .cluster-pin-section {
        padding: 4rem 1rem 4.5rem;
    }
    .cluster-bento-wrapper {
        padding: 0;
    }
    .cluster-pin-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .cluster-pin-card {
        min-height: auto;
        padding: 1.5rem 1.25rem;
    }
    .cluster-card-dept-number {
        font-size: 2.6rem;
    }
    .cluster-card-title {
        font-size: 1.2rem;
    }
}
