/* ============================================================
   Companies page styles
   Extracted from custom.css. Loaded only on companies.html.
   Shared components (pagination .pg-*/.companies-pagination*,
   .ms-* multiselect, .main-partner-section, .text-color-black)
   remain in custom.css because other pages use them.
   ============================================================ */

#companies-grid {
  padding: 1rem;
  margin-top: 0.2rem;
}

.background-semi-light {
    background-color: #a9c8d0;
}

.companies-page {
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* contain the full-bleed background pseudo-elements */
}

.companies-layout {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 70px);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.companies-sidebar {
    width: 380px;
    flex-shrink: 0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-self: stretch;
    overflow: visible;
    position: relative;
}

/* Bleed the sidebar background out to the left viewport edge */
.companies-sidebar::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 100%;
    width: 100vw;
    background-color: #a9c8d0;
}

/* ------------------------------------------------------------------
   Filter sidebar — mirrors the Jobs page filter styling (.jb-* classes).
   Colour tokens below are copied from jobs_overview.css :root so these
   rules resolve correctly on the companies page.
   ------------------------------------------------------------------ */
.companies-sidebar {
    --bg-white: #ffffff;
    --bg-card-hover: #f5f8fa;
    --border-color: #d1dce5;
    --border-light: #e8eef3;
    --text-primary: #1a1a1a;
    --text-muted: #8a96a3;
    --accent-primary: #2a6496;
    --radius-sm: 0;
}

.sidebar-card {
    background: #ffffff;
    border-radius: 0;
    padding: 1.25rem;
    border: 1px solid #e9e9e8;
    min-width: 0;
    overflow: visible;
    position: relative; /* containing block for the filter dropdown menus */
}

.companies-sidebar .form-control {
    border-radius: 0;
}

/* Search box */
.jb-search-box {
    position: relative;
    margin-bottom: 20px;
}

.jb-search-input {
    width: 100%;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 9px 12px 9px 36px;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: #ffffff;
    transition: border-color 0.2s ease;
    outline: none;
}
.jb-search-input::placeholder { color: var(--text-muted); }
.jb-search-input:focus { border-color: var(--accent-primary); }

.jb-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

/* Section heading (Filter by:) */
.jb-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
}

.jb-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.jb-reset-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    transition: color 0.2s ease;
    border-radius: var(--radius-sm);
}
.jb-reset-btn:hover { color: var(--accent-primary); }
.jb-reset-btn.is-spinning { animation: jb-reset-spin 0.45s ease; }

@keyframes jb-reset-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Filter accordion groups */
.jb-filter-list {
    margin-bottom: 20px;
}

.jb-filter-group {
    border-bottom: 1px solid var(--border-light);
    background: #ffffff;
}
.jb-filter-group:first-child { border-top: 1px solid var(--border-light); }

.jb-filter-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 4px;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
    font-size: 0.93rem;
    color: var(--text-primary);
}
.jb-filter-label:hover,
.jb-filter-group.open .jb-filter-label { color: var(--accent-primary); }

.jb-filter-label .jb-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}
.jb-filter-group.open .jb-chevron { transform: rotate(180deg); }

.jb-filter-content {
    display: none;
    padding: 0;
}
.jb-filter-group.open .jb-filter-content { display: block; }

/* The label row is the trigger now, so hide the multiselect's own button */
.jb-filter-content .ms-root > .form-select { display: none !important; }
.jb-filter-content .ms-root { position: static; }
.jb-filter-content .ms-menu {
    width: 100%;
    left: 0;
    right: 0;
}

/* Thin dropdown scrollbar — matches the Jobs page (.jb-page) */
.companies-page ::-webkit-scrollbar        { width: 6px; height: 6px; }
.companies-page ::-webkit-scrollbar-track  { background: transparent; }
.companies-page ::-webkit-scrollbar-thumb  { background: #d1dce5; }

/* Active filter pills — matches the Jobs page (.jb-active-filter-*) */
.jb-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 14px;
}

.jb-active-filter-chip {
    display: inline-flex;
    align-items: stretch;
    padding: 0;
    border: none;
    border-radius: 999px;
    overflow: hidden;
    background: transparent;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.jb-active-filter-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .10);
}

.jb-active-filter-chip:focus-visible {
    outline: 2px solid #2a6496;
    outline-offset: 2px;
}

.jb-active-filter-text {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px 0 11px;
    background: #2a6496;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.2;
    max-width: min(100%, 24rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jb-active-filter-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 0 6px;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 0.82rem;
}

.jb-active-filter-remove .bi {
    font-size: 0.82rem;
    line-height: 1;
}

@media (max-width: 767px) {
    .jb-active-filters {
        gap: 6px 8px;
    }
    .jb-active-filter-text {
        min-height: 28px;
        padding: 0 8px 0 9px;
        font-size: 0.78rem;
    }
    .jb-active-filter-remove {
        min-width: 24px;
        padding: 0 5px;
    }
}

/* Mobile filter toggle */
.jb-filter-toggle-btn {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s ease;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}
.jb-filter-toggle-btn:hover { background: var(--bg-card-hover); }

@media (max-width: 991px) {
    .jb-filter-toggle-btn { display: inline-flex; }
}

.main-partner-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.main-partner-logo img {
    width: 100%;
    max-width: 200px;
    max-height: 200px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.companies-content {
    flex: 1;
    padding: 1.5rem;
    background-color: #dce8ed;
    position: relative;
}

/* Bleed the content background out to the right viewport edge */
.companies-content::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    width: 100vw;
    background-color: #dce8ed;
}

.companies-content-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 991px) {
    .companies-layout {
        flex-direction: column;
    }
    .companies-sidebar {
        width: 100%;
    }
}

a.company-card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  background: #ffffff;
  border: 1px solid #e9e9e8;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  height: 100%;
}

a.company-card-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.company-card-top {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0.6rem 0;
}

.company-card-top .fav-icon {
  font-size: 26px;
  color: #bbb;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.company-card-top .fav-icon:hover {
  color: #000000;
  transform: scale(1.15);
}

.company-card-top .fav-icon.active {
  color: #FFD700;
  transform: scale(1.15);
}

.company-logo-card {
  width: 100%;
  height: 160px;
  border-radius: 0;
  padding: 0.75rem 1rem 0.75rem  1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #ffffff;
  border: none;
}

.company-logo-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.company-card-body {
  width: 100%;
  padding: 0.75rem 1rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  justify-content: space-between;
}

.company-card-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.company-card-subtitle {
  font-size: 0.8rem;
  color: #6c757d;
  margin: 0 0 0.4rem;
}

.company-card-name {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0;
}
