/**
* Top Companies Page Styles
*
* Follows Palomarr design system:
* - P-shaped corners (border-radius: 1rem 1rem 1rem 0)
* - Dark background: #122C23
* - Accent greens: #daff98, #99f682, #22b49c
* - Light background: #fcfff6
*
* @package Palomarr
* @since 2025-12-15
*/

/* =============================================================================
VARIABLES & RESETS
============================================================================= */

#header-space {
    display: none !important;
}

.container-wrap {
    padding-top: 0 !important;
}

/* Override Salient's body overflow to enable sticky positioning */
body:has(.top-companies-page) {
    overflow: visible !important;
}

/* =============================================================================
SALIENT ROW STRUCTURE - FULL WIDTH BACKGROUNDS
============================================================================= */
body[data-col-gap="50px"] .vc_row-fluid .span_12 {
    margin: 0;
}

.top-companies-page {
    padding-bottom: 0 !important;
}

.top-companies-page .row-bg-wrap {
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: -50vw;
    margin-left: calc(-50vw + var(--scroll-bar-w, 0) / 2);
    width: 100vw;
    width: calc(100vw - var(--scroll-bar-w, 0));
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.top-companies-page .row-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.top-companies-page .row_col_wrap_12 {
    display: flex;
    float: none;
    position: relative;
    z-index: 1;
}

/* Section-specific backgrounds */
.top-companies-hero .row-bg {
    background: #112B23;
}

.top-companies-promo-section {
    background: var(--color-light);
}

.top-companies-cta-footer {
    position: relative;
}

.top-companies-cta-footer .row-bg {
    background: #2e3c38;
}

.top-companies-cta-footer h2 {
    max-width: var(--max-width-50);
    margin: 0 auto 4rem !important;
    line-height: 3.5rem;
    font-size: 3rem !important;
}

/* =============================================================================
SECTION 1: HERO
============================================================================= */

.top-companies-hero {
    color: var(--text-white);
    padding: 8rem 0 5rem;
}

.hero-content-wrapper {
    max-width: var(--max-width-50);
}

.top-companies-hero .row-bg-layer .row-bg::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    width: 200%;
    height: 200%;
    background-image: url(/wp-content/uploads/2025/12/palomarr-bg-circles-category-06.svg);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center center;
    pointer-events: none;
    opacity: 0.02;
}

.top-companies-breadcrumbs {
    margin-bottom: 2rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.top-companies-breadcrumbs a {
    color: var(--color-accent);
    text-decoration: none;
}

.top-companies-breadcrumbs a:hover {
    text-decoration: underline;
}

.top-companies-breadcrumbs .separator {
    margin: 0 0.5rem;
    opacity: 0.5;
}

.top-companies-hero h1 {
    margin-bottom: 1.5rem;
}

.top-companies-hero .hero-description {
    font-size: 1.125rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.top-companies-hero .hero-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.top-companies-hero .meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.top-companies-hero .meta-value {
    font-weight: 600;
    color: var(--color-accent);
}

.top-companies-hero .meta-separator {
    opacity: 0.4;
    margin: 0 0.5rem;
}

@media screen and (max-width: 640px) {

    .top-companies-hero .hero-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .top-companies-hero .meta-separator {
        display: none;
    }
}

/* =============================================================================
SECTION 2: CONTEXT + QUICK LIST WRAPPER (Side by Side on Desktop)
============================================================================= */

.top-companies-context-list-wrapper {
    padding: 4rem 0;
    background: #fcfff6;
    overflow: visible;
}

.top-companies-context-list-wrapper > .container {
    overflow: visible;
}

.context-list-inner {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 9rem;
    overflow: visible;
}

/* =============================================================================
SECTION 2A: QUICK LIST
============================================================================= */

.top-companies-quick-list {
    order: 1;
    background: #ffffff;
    border-radius: 2.2rem 2.2rem 2.2rem 0;
    box-shadow: 0 4px 60px #2528271a;
    padding: 2.5rem 3rem !important;
}

.quick-list-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.quick-list-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.quick-list-header .section-title {
    margin-bottom: 0;
}

.quick-list-header .rankings-compare-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Bottom center logo */
.top-companies-quick-list .quick-list-logo-bottom {
    display: block;
    width: 6rem;
    margin: 1.5rem 0 0 auto;
}

.top-companies-quick-list .section-title,
.top-companies-cards .section-title {
    font-size: 3rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.quick-list-wrapper {
    display: flex;
    flex-direction: column;
}

.quick-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    position: relative;
    z-index: 1;
}

.quick-list-item:hover {
    z-index: 10;
}

.quick-list-item .rank {
    font-size: 1.3rem;
    min-width: 2rem;
    font-weight: 400;
    text-align: center;
}

.quick-list-item .company-logo {
    width: 2rem;
    height: 2rem;
    border-radius: 100%;
    object-fit: contain;
    flex-shrink: 0;
    box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.8) !important;
}

.quick-list-item .company-logo-link {
    display: flex;
}

.quick-list-item .name-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quick-list-item .name {
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--text-primary);
    text-decoration: none;
}

.quick-list-item .name:hover {
    color: var(--color-primary);
}

.quick-list-item .scores {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 3rem;
    position: relative;
    margin-left: auto;
}

.quick-list-item .score-main {
    font-size: 1.25rem;
    color: var(--text-link);
}

.quick-list-item .scores-tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    background: #ffffff;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.7rem;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    width: 14rem;
}

.quick-list-item .scores-tooltip .tooltip-description {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-wrap-mode: wrap;
}

.quick-list-item .scores-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.quick-list-item .scores-tooltip .tooltip-label {
    color: var(--text-secondary);
}

.quick-list-item .scores-tooltip .tooltip-value {
    font-weight: 600;
}

.quick-list-item .scores:hover .scores-tooltip,
.quick-list-item .scores-tooltip:hover {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease 0.3s, visibility 0.2s ease 0.3s;
}

.quick-list-item .badges,
.card-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-badges {
    position: absolute;
    top: 0;
    left: 0;
}

.supplier-card-half .card-badges {
    left: 5rem;
}

.supplier-card-half .card-badges {
    right: 15rem;
    left: unset;
    top: 0.2rem;
}

.supplier-card-mini .card-badges {
    top: 0;
    left: unset;
    right: 6rem;
}

.supplier-card-buttons .text {
    display: block;
}

.row .col p:last-child,
.wpb_text_column>.wpb_wrapper>:last-child {
    padding-bottom: 0;
}

.supplier-cards-col.supplier-col-mini {
    flex-direction: column;
    margin: 0 auto 5rem;
    max-width: 40rem;
}

.supplier-card-container.supplier-card-mini .card-action-row {
    right: 3.7rem;
    top: 0;
    left: unset;
}

.supplier-card-container.supplier-card-mini .card-match-score {
    top: -0.1rem;
    right: -0.1rem;
}

@media (max-width: 640px) {
    .top-companies-quick-list {
        padding: 1.5rem !important;
        border-radius: 1rem 1rem 1rem 0;
    }

    .top-companies-quick-list .list-title {
        font-size: 2rem;
    }

    .top-companies-quick-list .quick-list-item {
        flex-wrap: wrap;
    }

    .top-companies-quick-list .quick-list-item .badges {
        display: none;
    }

    .top-companies-quick-list .quick-list-item .scores {
        min-width: auto;
    }

    .top-companies-quick-list .quick-list-item .rank {
        min-width: 1.5rem;
    }

    .top-companies-quick-list .quick-list-header .section-title {
        font-size: 2rem;
    }

    .top-companies-quick-list .quick-list-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .top-companies-quick-list .rankings-compare-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.75rem;
    }
}

/* =============================================================================
SECTION 2B: INDUSTRY CONTEXT
============================================================================= */

.top-companies-industry-context {
    order: 2;
    position: sticky;
    top: 2rem;
    align-self: start;
    height: fit-content;
}

.top-companies-industry-context .section-title {
    font-size: 2rem;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.top-companies-industry-context .industry-context-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--color-gray-700, #374151);
}

/* Expandable paragraphs */
.top-companies-industry-context .expandable-paragraphs {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

.top-companies-industry-context .expandable-paragraphs.active {
    max-height: 1000px;
    opacity: 1;
}

.top-companies-industry-context .see-more {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.top-companies-industry-context .see-more p {
    display: flex;
    align-items: center;
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-link);
    padding: 0;
}

.top-companies-industry-context .see-more.active p::after {
    transform: rotate(180deg);
}

/* Industry Context - Insights Promo */
.industry-context-insights-promo {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--color-light-2, #f5f7f2);
    border-radius: var(--border-radius-p-2, 0.75rem 0.75rem 0.75rem 0);
}

.industry-context-promo-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.industry-context-promo-title {
    font-size: 1rem;
    color: var(--text-primary);
}

.industry-context-promo-description {
    font-size: 0.85rem;
    line-height: 1.5;
}

.industry-context-promo-button {
    flex-shrink: 0;
    white-space: nowrap;
    width: fit-content !important;
}

@media (max-width: 1024px) {
    .industry-context-insights-promo {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .industry-context-promo-button {
        width: 100%;
        text-align: center;
    }
}

/* =============================================================================
BADGE STYLES
============================================================================= */

.top-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.8rem;
    border-radius: var(--border-radius-p-2);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    line-height: 2.5;
    color: var(--color-black);
}

.top-badge-overall {
    background: #24433a;
    color: var(--color-white);
}

.top-badge-value {
    background: #d2f2d7;
}

.top-badge-smb {
    background: #c6e8e3;
}

.top-badge-enterprise {
    background: #e4f6d9;
}

.top-badge-midmarket {
    background: #cbe1f3;
}

.top-badge-default {
    background: var(--color-gray-light);
    color: var(--color-black);
}

.top-companies-quick-list .top-badge-overall {
    order: 2;
}

/* =============================================================================
SECTION 4: SUPPLIER CARDS WITH FILTERS
============================================================================= */
.supplier-cards-col {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.top-companies-cards {
    padding: 4rem 0;
}

.top-companies-cards .section-header {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 5rem;
    max-width: var(--max-width-50);
}

.top-companies-cards .section-header-left {
    flex: 0 0 75%;
}

.top-companies-cards .section-header-right {
    flex: 0 0 25%;
    display: flex;
    justify-content: flex-end;
}

.top-companies-cards .section-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

.filter-switcher {
    align-items: center;
    gap: 2rem;
}

/* No Results Message */
.no-results-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-results-message a {
    color: var(--color-primary);
}

.supplier-card-container-0>.supplier-card>.col>.col>.vc_column-inner>.wpb_wrapper>.img-with-aniamtion-wrap:before,
.supplier-card-container-1>.supplier-card>.col>.col>.vc_column-inner>.wpb_wrapper>.img-with-aniamtion-wrap:before,
.supplier-card-container-2>.supplier-card>.col>.col>.vc_column-inner>.wpb_wrapper>.img-with-aniamtion-wrap:before {
    content: none;
}

.card-match-score {
    position: absolute;
    top: -0.4rem;
    right: -0.4rem;
    background: #e5f7da;
    padding: 0.4rem 0.7rem;
}

.card-match-score span {
    font-size: 1.3rem;
}

.card-name h2 {
    font-size: 4rem;
    line-height: 1.1;
    margin: 0;
}

.card-action-row {
    right: 5rem;
}

#clear-filters {
    margin: 1.5rem auto !important;
}

@media (max-width: 640px) {

    .card-name h2 {
        font-size: 2.2rem;
    }

    .project-filters-container .filter-dropdown {
        display: flex;
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-switcher {
        flex-wrap: wrap;
    }

    .filter-switcher .view-switcher-btn[data-view="half"] {
        display: none;
    }

    .filter-switcher .find-a-supplier {
        width: 100% !important;
        order: 2;
        height: 44px !important;
    }

    .card-match-score span {
        font-size: 1.2rem;
        line-height: 1.7;
    }

}

/* =============================================================================
RUNNERS-UP SECTION
============================================================================= */

.runners-up-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-light, #e5e7eb);
}

.runners-up-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.runners-up-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.runners-up-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.runners-up-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.6rem 1rem 1.2rem;
    background: #fff;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: var(--border-radius-p-2, 0.75rem 0.75rem 0.75rem 0);
    text-decoration: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.runners-up-item:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.runners-up-logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 100%;
    object-fit: contain;
    flex-shrink: 0;
    box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.8);
}

.runners-up-name {
    flex: 1;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.runners-up-score {
    font-size: 1.1rem;
    color: var(--text-link);
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .runners-up-grid {
        grid-template-columns: 1fr;
    }

    .runners-up-title {
        font-size: 1.5rem;
    }
}

/* =============================================================================
SECTION 5: PROMO SECTION
============================================================================= */

.top-companies-promo-section {
    margin: 3rem 0;
    padding: 3rem 0;
    border-top: 1px solid var(--border-light);
}

.top-companies-promo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.top-companies-promo-card {
    display: flex;
    flex-direction: column;
    padding: 3rem 4rem 4rem;
    background: var(--color-light-2);
    border-radius: var(--border-radius-p-2);
}

.top-companies-promo-card .promo-card-content {
    flex: 1;
    margin-bottom: 1.5rem;
}

.top-companies-promo-card .promo-card-content h3 {
    font-size: 2.25rem;
    line-height: 2.5rem;
    margin: 0 0 0.75rem 0;
    color: var(--text-primary);
}

.top-companies-promo-card .promo-card-content p {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-dark);
    margin: 0;
}

.top-companies-promo-card .promo-card-cta {
    align-self: flex-start;
    text-decoration: none;
    width: auto !important;
    min-width: 18rem;
}

/* =============================================================================
SECTION 6: CTA FOOTER
============================================================================= */

.top-companies-cta-footer {
    padding: 5rem 0;
    color: var(--text-white);
}

.cta-content {
    text-align: center;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--text-white);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.cta-buttons > * {
    max-width: 22rem;
}

.cta-note {
    font-size: 0.875rem;
    opacity: 0.7;
}

.before-footer {
    background: var(--bg-dark) !important;
}

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

@media (max-width: 1024px) {
    /* Stack context + quick list vertically on tablet */
    .context-list-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .top-companies-industry-context {
        position: static;
        order: 1;
    }

    .top-companies-quick-list {
        order: 2;
    }
}

@media (max-width: 640px) {
    .top-companies-hero {
        padding: 6rem 0 3rem;
    }

    .top-companies-hero h1 {
        font-size: 2rem;
    }

    .quick-list-item {
        flex-wrap: wrap;
    }

    .quick-list-item .badges {
        width: 100%;
        margin-top: 0.5rem;
    }

    .cta-buttons {
        flex-direction: column;
    }

    .cta-buttons .button-primary-green,
    .cta-buttons .button-secondary-outline-green {
        width: 100%;
    }

    .top-companies-promo-grid {
        grid-template-columns: 1fr;
    }

    .top-companies-promo-card {
        padding: 2rem;
    }

    .top-companies-promo-card .promo-card-content h3 {
        font-size: 1.5rem;
        line-height: 1.8rem;
    }

    .top-companies-cards .section-header {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .top-companies-cards .section-header-right {
        width: 100%;
    }

    .top-companies-cards .section-header-right .nectar-button {
        width: 100% !important;
        margin-bottom: 4rem !important;
        height: 50px !important;
    }

    #supplier-card .card-badges,
    #supplier-card .splide {
        display: none;
        margin: 0 !important;
        padding: 0 !important;
    }

    .content-card .card-name {
        display: block;
        margin: -4rem 0 0rem 5rem !important;
    }

    .supplier-card,
    .supplier-sections,
    .supplier-card-container > .wpb_row:not(.supplier-card) {
        margin: 0 !important;
    }

    .supplier-cards-col {
        margin: 0 -1rem;
        gap: 2rem;
    }
    
}

@media (max-width: 480px) {
    .quick-list-item .scores {
        min-width: auto;
    }
}

/* =============================================================================
   QUICK LIST SOURCE BUTTONS
============================================================================= */

/* Quick list source button - flex sibling to .name */
.quick-list-source-button {
    font-size: 0.7rem;
    color: var(--color-green-faded);
    background: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    padding: 2px 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.quick-list-source-button .source-count {
    margin-left: 2px;
}

/* Show on hover of parent row */
.quick-list-item:hover .quick-list-source-button {
    opacity: 1;
}

.quick-list-source-button:hover {
    opacity: 1;
}