/* ================================================================
   page-company-select.css  –  Compliance Checker
   The Companies index: a two-tier card directory (Full profiles +
   More companies) with a filter strip. All radii / shadows / colours
   pull from the shared tokens so the cards sit with the rest of the
   site. BEM throughout.
   ================================================================ */

.cc-companies {
    max-width: min(95%, 1300px);
    margin: 0 auto;
    padding: var(--space-md) var(--space-md) var(--space-2xl);
}


/* === FILTER STRIP ============================================== */
.cc-companies__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 12px 14px;
    margin-bottom: var(--space-lg);
    background: var(--white);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-dropdown);
}

/* Search — sizing only; the pill visuals come from the shared .cc-search. */
.cc-companies__search { flex: 1 1 280px; min-width: 200px; }

/* Commodity filter chips */
.cc-companies__commodities {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cc-companies__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px 5px 8px;
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-pill);
    background: var(--white);
    color: var(--ae-black);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-transform: capitalize;
    transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}
.cc-companies__chip:hover { border-color: var(--c, var(--ae-darkblue)); }
.cc-companies__chip.is-active {
    background: color-mix(in srgb, var(--c, var(--ae-darkblue)) 14%, var(--white));
    border-color: var(--c, var(--ae-darkblue));
    color: color-mix(in srgb, var(--c, var(--ae-darkblue)) 70%, var(--ae-black));
}
.cc-companies__chip-icon { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
.cc-companies__chip-dot  { width: 10px; height: 10px; border-radius: 50%; margin: 0 3px; flex-shrink: 0; background: var(--c, var(--color-muted)); }

/* Clear-all — light grey + cross, same muted family as the cancel
   button. Only shown (via [hidden]) when a filter is active. */
.cc-companies__clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 6px 10px;
    border: 0;
    background: transparent;
    color: color-mix(in srgb, var(--color-muted) 60%, var(--white));
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition-base);
}
.cc-companies__clear:hover { color: var(--color-muted); }


/* === SECTIONS ================================================== */
.cc-companies__section { margin-top: var(--space-lg); }
.cc-companies__section:first-of-type { margin-top: 0; }
/* Header row: title pill on the left, the big count on the right. */
.cc-companies__section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: var(--space-md);
}
.cc-companies__section-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--fs-h3);
    line-height: 1;   /* keeps the label optically centred inside the pill */
    color: var(--ae-darkblue);
}
/* "Full profiles" reads as a bigger version of the hero profile pill. */
.cc-companies__section-title--profiles {
    padding: 6px 16px;
    border: 1.5px solid var(--ae-land-dark);
    border-radius: var(--radius-pill);
    color: var(--ae-land-dark);
    font-size: var(--fs-h4);
}
.cc-companies__section-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}
.cc-companies__count {
    flex-shrink: 0;
    font-family: var(--font-heading);
    font-size: var(--fs-h3);
    font-weight: 700;
    color: var(--ae-darkblue);
    line-height: 1;
}

.cc-companies__grid {
    display: grid;
    gap: 14px;
}
.cc-companies__grid--large   { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cc-companies__grid--compact { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }

.cc-companies__divider {
    border: 0;
    border-top: 1px solid var(--color-input-border);
    margin: var(--space-xl) 0;
}


/* === "FULL PROFILE" BADGE =====================================
   Green outlined pill on the large cards. Border follows the text
   colour (the dot too), so only `color` is set. */
.cc-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border: 1px solid currentColor;
    border-radius: var(--radius-pill);
    color: var(--ae-land-dark);
    font-family: var(--font-body);
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
.cc-badge__dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}


/* === LARGE CARD (full profile) ================================= */
/* Surface + soft-lift hover come from the shared .cc-card. */
.cc-company-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-card);
    overflow: hidden;
}

.cc-company-card__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 148px;
    padding: 14px 16px;
    background: var(--ae-white);
    border-bottom: 1px solid var(--color-input-border);
}

.cc-company-card__logo-img {width: 75%; height: 75%; object-fit: contain; }
.cc-company-card__monogram {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--ae-darkblue-10);
    color: var(--ae-darkblue);
    font-family: var(--font-heading); font-size: 24px;
}

.cc-company-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* extra bottom padding gives the commodity pills room to breathe
       before the footer divider. */
    padding: 14px 16px 16px;
    flex: 1;
}
/* Company name on the left, "Full profile" badge on the right, top-aligned
   so a wrapped name keeps the badge pinned to the first line. */
.cc-company-card__title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}
.cc-company-card__name {
    font-family: var(--font-heading);
    font-size: var(--fs-md);
    color: var(--ae-darkblue);
    line-height: 1.2;
    min-width: 0;
}
.cc-company-card__meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-muted);
    font-size: var(--fs-sm);
    min-width: 0;
}
/* HQ flag — same boxed chip the sidebar combobox flags use. */
.cc-company-card__flag {
    width: 22px; height: auto; max-height: 15px;
    flex-shrink: 0;
    border-radius: 2px;
    object-fit: cover;
    background: var(--ae-white);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.cc-company-card__meta-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cc-company-card__commodities {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}

.cc-company-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding: 12px 16px;
    border-top: 1px solid var(--color-input-border);
}
.cc-company-card__cases { font-size: var(--fs-sm); color: var(--color-muted); font-weight: 600; }
.cc-company-card__view {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: var(--fs-sm); font-weight: 700; color: var(--ae-darkblue);
    white-space: nowrap;
}
.cc-company-card:hover .cc-company-card__view { gap: 9px; }


/* === COMMODITY MARK (large-card pill) =========================
   Outline pill, commodity-coloured border + text + icon/dot. Colour
   resolved from --c by the [data-commodity] rules at the bottom. */
.cc-commodity-mark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 6px;
    background: var(--white);
    border: 1px solid color-mix(in srgb, var(--c, var(--color-muted)) 40%, transparent);
    border-radius: var(--radius-pill);
    color: var(--c, var(--ae-black));
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1;
    text-transform: capitalize;
}
.cc-commodity-mark__icon { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
.cc-commodity-mark__dot  { width: 10px; height: 10px; border-radius: 50%; margin: 0 3px; flex-shrink: 0; background: var(--c, var(--color-muted)); }


/* === COMPACT CARD (no profile) ================================ */
/* Surface + soft-lift hover come from the shared .cc-card. */
.cc-company-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-dropdown);
}

.cc-company-mini__logo {
    flex-shrink: 0;
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    padding: 4px;
    background: var(--ae-white);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
}
.cc-company-mini__logo-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cc-company-mini__monogram {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; border-radius: 4px;
    background: var(--ae-darkblue-10);
    color: var(--ae-darkblue);
    font-family: var(--font-heading); font-size: 16px;
}

/* name / commodities / cases each on their own line so a high case
   count (e.g. Bunge) can't overflow the narrow card. */
.cc-company-mini__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.cc-company-mini__name {
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    color: var(--ae-darkblue);
    line-height: 1.15;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cc-company-mini__dots { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.cc-company-mini__cases {
    color: var(--color-muted);
    font-size: var(--fs-xs);
    white-space: nowrap;
}
.cc-company-mini__chevron { flex-shrink: 0; color: var(--color-muted); font-size: 13px; }

/* Compact commodity dot — colour swatch (icon overlaid when one
   exists), label exposed via title on hover. */
.cc-commodity-dot {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--c, var(--color-muted));
}
.cc-commodity-dot__icon {
    width: 14px; height: 14px; object-fit: contain;
    /* icon-bearing commodities show the icon on a white disc instead
       of a flat colour dot */
    background: var(--white);
    border-radius: 50%;
}
.cc-commodity-dot:has(.cc-commodity-dot__icon) { background: transparent; }


/* Commodity --c colours come from components/commodity-colors.css. */


/* ================================================================
   RESPONSIVE  (breakpoints documented in tokens.css)
   ----------------------------------------------------------------
     sm   ≤ 767px    phones    — large-card grid → single column
   ================================================================ */

/* === sm  (≤ 767px, phones) ===================================== */
@media (max-width: 767px) {
    .cc-companies__grid--large   { grid-template-columns: 1fr; }
    .cc-companies__clear         { margin-left: 0; }
}
