/* =============================================================
   Companies Currently Hiring - hub page
   Brand accent: #4d4ed4
   ============================================================= */

.ch-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 20px 64px;
}

/* Intro copy (page content) */
.ch-intro {
    font-size: 16px;
    line-height: 1.7;
    color: #475569;
    margin-bottom: 30px;
    max-width: 760px;
}

/* ---- Stats bar ---------------------------------------------- */
.ch-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.ch-stat {
    background: #fff;
    border: 1px solid #e8eaf6;
    border-radius: 16px;
    padding: 22px 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
}

.ch-stat-num {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #4d4ed4;
    line-height: 1.15;
    margin-bottom: 6px;
    letter-spacing: -.5px;
}

.ch-stat-updated .ch-stat-num {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0;
}

.ch-stat-label {
    display: block;
    font-size: 11.5px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .8px;
    font-weight: 600;
}

/* ---- Toolbar / search --------------------------------------- */
.ch-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 26px;
}

.ch-search {
    position: relative;
    width: 100%;
    max-width: 380px;
}

.ch-search-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.ch-search input {
    width: 100%;
    height: 48px;
    padding: 0 18px 0 46px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    color: #0f172a;
    background: #fff;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    box-sizing: border-box;
}

.ch-search input::placeholder { color: #94a3b8; }

.ch-search input:focus {
    border-color: #4d4ed4;
    box-shadow: 0 0 0 4px rgba(77, 78, 212, .1);
}

/* ---- Grid --------------------------------------------------- */
.ch-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    align-items: stretch;
}

/* ---- Company card ------------------------------------------- */
.ch-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgb(5 105 255 / .8);
    border-radius: 16px;
    padding: 24px;
    height: 100%;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
    transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}

.ch-card:hover {
    border-color: #2958ff;
    box-shadow: 0 10px 26px rgba(77, 78, 212, .12);
    transform: translateY(-2px);
}

/* Header: logo + name */
.ch-card-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.ch-card-logo {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #eef0f7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ch-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    padding: 5px;
    box-sizing: border-box;
}

.ch-card-initial {
    font-size: 24px;
    font-weight: 800;
    color: var(--civi-color-accent, #4d4ed4);
}

/* Round company logos on the hiring archive, matching the company directory.
   Scoped to .archive-hiring so the homepage widget keeps its own style. */
.area-hiring .ch-card-logo,
.area-hiring .ch-card.ch-card--grid .ch-card-logo,
.area-hiring .ch-card.ch-card--list .ch-card-logo {
    border-radius: 50%;
}

/* Fill the round logo frame (matches the directory's cover style) so square
   logos read as a circle instead of a centered square. Applies to the hiring
   widget and the hiring archive (both carry .area-hiring). */
.area-hiring .ch-card-logo img {
    object-fit: cover;
    padding: 0;
}

.ch-card-name {
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
    color: var(--civi-color-primary);
    font-weight: 500;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.ch-card-name a {
    color: inherit;
    text-decoration: none;
}

.ch-card-name a:hover {
    color: var(--civi-color-accent, #4d4ed4);
}

/* Pills: sector / size / location */
.ch-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.ch-tag {
    display: inline-block;
    color: var(--civi-color-accent);
    background: rgb(0 116 86 / .05);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    padding: 5px 12px;
    line-height: 1.3;
}

/* Job list */
.ch-jobs {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.ch-job {
    padding: 0 0 14px;
}

.ch-job:last-child {
    padding-bottom: 0;
}

.ch-job-title {
    display: inline-block;
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 4px;
    transition: color .15s ease;
    font-style: inherit;
    font-stretch: normal;
    font-weight: 500;
}

.ch-job-title:hover {
    text-decoration: underline;
}

.ch-job-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12.5px;
    color: #94a3b8;
}

.ch-job-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #cbd5e1;
    display: inline-block;
}

/* View Profile button - pinned to the bottom so cards align */
.ch-card-btn {
    display: block;
    margin-top: auto;
    text-align: center;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #eef0f7;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.ch-card-btn:hover {
    background: var(--civi-color-accent, #4d4ed4);
    border-color: var(--civi-color-accent, #4d4ed4);
    color: #fff;
}

/* ---- Empty / no-results ------------------------------------- */
.ch-empty,
.ch-noresults {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 16px;
}

.ch-noresults {
    margin: 0;
}

/* ---- Load more ---------------------------------------------- */
.ch-loadmore-wrap {
    text-align: center;
    margin-top: 40px;
}

.ch-loadmore {
    display: inline-block;
    padding: 14px 40px;
    background: #4d4ed4;
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, box-shadow .15s ease, transform .12s ease;
    box-shadow: 0 6px 18px rgba(77, 78, 212, .25);
}

.ch-loadmore:hover:not(:disabled) {
    background: #3d3eb8;
    transform: translateY(-1px);
}

.ch-loadmore:disabled {
    opacity: .6;
    cursor: default;
    box-shadow: none;
}

/* ---- Responsive --------------------------------------------- */
@media (max-width: 1024px) {
    .ch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .ch-wrap { padding: 22px 14px 44px; }
    .ch-stats { grid-template-columns: 1fr; gap: 12px; }
    .ch-stat { padding: 18px 20px; }
    .ch-toolbar { justify-content: stretch; }
    .ch-search { max-width: none; }
    .ch-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

/* =============================================================
   Archive page (/companies-hiring/) - header, filter bar, pagination
   ============================================================= */
.ch-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 20px 64px;
}

.ch-archive-head {
    margin-bottom: 24px;
}

.ch-archive-title {
    margin: 0 0 6px;
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.5px;
}

.ch-archive-sub {
    margin: 0;
    font-size: 15px;
    color: #64748b;
}

.ch-archive-sub strong {
    color: #4d4ed4;
}

/* Horizontal filter bar */
.ch-filterbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background: #fff;
    border: 1px solid #e8eaf6;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04);
}

.ch-filterbar-search {
    position: relative;
    flex: 1 1 240px;
    min-width: 200px;
}

.ch-filterbar-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.ch-filterbar-search input {
    width: 100%;
    height: 46px;
    padding: 0 16px 0 42px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    color: #0f172a;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ch-filterbar-search input:focus {
    border-color: #4d4ed4;
    box-shadow: 0 0 0 4px rgba(77, 78, 212, .1);
}

.ch-filterbar-select {
    height: 46px;
    flex: 0 1 180px;
    min-width: 150px;
    padding: 0 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    color: #0f172a;
    background: #fff;
    outline: none;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ch-filterbar-select:focus {
    border-color: #4d4ed4;
    box-shadow: 0 0 0 4px rgba(77, 78, 212, .1);
}

.ch-filterbar-btn {
    height: 46px;
    padding: 0 28px;
    border: none;
    border-radius: 10px;
    background: #4d4ed4;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease;
}

.ch-filterbar-btn:hover {
    background: #3d3eb8;
}

/* Pagination */
.ch-pagination {
    margin-top: 36px;
}

.ch-pagination .page-numbers {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.ch-pagination .page-numbers li {
    margin: 0;
}

.ch-pagination .page-numbers a,
.ch-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #e8eaf6;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.ch-pagination .page-numbers a:hover {
    border-color: #4d4ed4;
    color: #4d4ed4;
}

.ch-pagination .page-numbers .current {
    background: #4d4ed4;
    border-color: #4d4ed4;
    color: #fff;
}

@media (max-width: 680px) {
    .ch-archive { padding: 22px 14px 44px; }
    .ch-archive-title { font-size: 24px; }
    .ch-filterbar { flex-direction: column; align-items: stretch; }
    .ch-filterbar-search,
    .ch-filterbar-select,
    .ch-filterbar-btn { flex: 1 1 auto; width: 100%; }
}

/* Intro text under the archive title */
.ch-archive-intro {
    font-size: 15px;
    line-height: 1.7;
    color: #475569;
    margin: 0 0 10px;
    max-width: 760px;
}

/* Settings-driven column counts (override the .ch-grid default) */
.ch-grid.ch-cols-1 { grid-template-columns: minmax(0, 1fr); }
.ch-grid.ch-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ch-grid.ch-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ch-grid.ch-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ch-grid.ch-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

@media (max-width: 1100px) {
    .ch-grid.ch-cols-4,
    .ch-grid.ch-cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
    .ch-grid[class*="ch-cols-"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
    .ch-grid[class*="ch-cols-"] { grid-template-columns: minmax(0, 1fr); }
}

/* AJAX loading state */
.ch-archive.ch-loading .ch-grid {
    opacity: .5;
    pointer-events: none;
    transition: opacity .15s ease;
}

/* Pagination wrapper (AJAX-driven) */
.ch-pagination-wrap {
    margin-top: 36px;
    text-align: center;
}

.ch-pagination-wrap .page-numbers {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0;
    padding: 0;
}

.ch-pagination-wrap .page-numbers li {
    margin: 0;
}

.ch-pagination-wrap a.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #e8eaf6;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.ch-pagination-wrap a.page-numbers:hover {
    border-color: #4d4ed4;
    color: #4d4ed4;
}

.ch-pagination-wrap a.page-numbers.current {
    background: #4d4ed4;
    border-color: #4d4ed4;
    color: #fff;
}

/* ---- Hiring archive layout ----------------------------------------- */

/*
 * Strip every box style the theme paints onto .civi-company-item so only
 * our .ch-card draws the visible card. This removes the "layout inside
 * a layout" effect (the outer green-bordered box around each card).
 */
.area-hiring .civi-company-item.ch-item,
.area-hiring .civi-company-item.ch-item:hover {
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

/*
 * Accent border + uniform 20px padding on every hiring card, matching
 * the project's .civi-company-item.layout-list / .civi-jobs-item.layout-list
 * pattern. Applies to both list and grid orientations.
 */
.area-hiring .ch-card,
.area-hiring .ch-card.ch-card--grid,
.area-hiring .ch-card.ch-card--list {
    padding: 20px;
    border-color: rgb(5 105 255 / .8);
}

.area-hiring .ch-card:hover,
.area-hiring .ch-card.ch-card--grid:hover,
.area-hiring .ch-card.ch-card--list:hover {
    border-color: rgb(5 105 255 / .8);
}

/* No-sidebar mode: content column spans the row. */
.col-left.no-sidebar {
    flex: 1 1 100%;
    max-width: 100%;
}

/*
 * Grid view: column count driven by the Hiring → Grid Columns setting
 * (archive) or by the widget's Columns control. High specificity on the
 * archive selector beats any theme rule on .civi-company-item width.
 */
.content-company.area-archive.area-hiring.grid-view,
.ch-widget.area-hiring.grid-view {
    --ch-cols: 3;
    display: grid;
    grid-template-columns: repeat(var(--ch-cols), minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    align-items: stretch;
}

.content-company.area-archive.area-hiring.grid-view.ch-cols-1 { --ch-cols: 1; }
.content-company.area-archive.area-hiring.grid-view.ch-cols-2 { --ch-cols: 2; }
.content-company.area-archive.area-hiring.grid-view.ch-cols-3 { --ch-cols: 3; }
.content-company.area-archive.area-hiring.grid-view.ch-cols-4 { --ch-cols: 4; }
.content-company.area-archive.area-hiring.grid-view.ch-cols-5 { --ch-cols: 5; }

/* List view (archive AND widget): full-width rows. */
.ch-widget.area-hiring.list-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Optional "View all" CTA under the widget. Uses the theme's
   .civi-button.button-border-bottom link style. */
.ch-widget-cta {
    margin-top: 28px;
    text-align: center;
}

/*
 * Reset the theme's .civi-company-item width / flex-basis (it normally
 * sizes itself to ~50% for a flex row), so the grid container's
 * grid-template-columns is what actually decides cards-per-row.
 */
.area-hiring.grid-view .civi-company-item.ch-item,
.area-hiring.list-view .civi-company-item.ch-item {
    width: auto;
    max-width: none;
    min-width: 0;
    flex: 0 0 auto;
    float: none;
}

.area-hiring.grid-view .civi-company-item.ch-item {
    display: flex;
}

.area-hiring.grid-view .civi-company-item.ch-item > .ch-card {
    width: 100%;
}

/* List view: full-width rows, vertical stack. */
.area-hiring.list-view {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.area-hiring.list-view .civi-company-item.ch-item {
    display: block;
    width: 100%;
}

/* ---- List-mode card (redesigned) ----------------------------------- */
/*
 * Two clear regions side by side:
 *   .ch-card__main  - logo + name + tags + jobs list
 *   .ch-card__aside - View Profile CTA, right-pinned
 * Markup-level: we reuse the existing children, so no template change is
 * needed; CSS Grid arranges them.
 */
.ch-card.ch-card--list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "head"
        "tags"
        "jobs"
        "cta";
    align-items: start;
    row-gap: 10px;
    padding: 22px 26px;
}

.ch-card.ch-card--list .ch-card-head  { grid-area: head; margin: 0; }
.ch-card.ch-card--list .ch-card-tags  { grid-area: tags; margin: 0; }
.ch-card.ch-card--list .ch-jobs       { grid-area: jobs; margin: 6px 0 0; padding: 12px 0 0; border-top: 1px dashed #eef0f7; }
.ch-card.ch-card--list .ch-card-btn   { grid-area: cta;  margin: 6px 0 0; padding: 12px 22px; width: 100%; box-sizing: border-box; text-align: center; }

.ch-card.ch-card--list .ch-card-logo  { width: 52px; height: 52px; border-radius: 10px; }
.ch-card.ch-card--list .ch-card-name  { font-size: 18px; }

/* Open jobs become a tighter inline list with a soft divider. */
.ch-card.ch-card--list .ch-job {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}
.ch-card.ch-card--list .ch-job:last-child { border-bottom: none; padding-bottom: 0; }
.ch-card.ch-card--list .ch-job-title      { margin-bottom: 2px; }

/* Hover: keep the existing lift; don't translate (looks twitchy in lists). */
.ch-card.ch-card--list:hover { transform: none; }

/* Responsive collapse - clamp the chosen column count on smaller screens. */
@media (max-width: 1199px) {
    .content-company.area-archive.area-hiring.grid-view.ch-cols-5 { --ch-cols: 4; }
}

@media (max-width: 991px) {
    .content-company.area-archive.area-hiring.grid-view,
    .content-company.area-archive.area-hiring.grid-view.ch-cols-3,
    .content-company.area-archive.area-hiring.grid-view.ch-cols-4,
    .content-company.area-archive.area-hiring.grid-view.ch-cols-5 { --ch-cols: 2; }
}

@media (max-width: 720px) {
    .content-company.area-archive.area-hiring.grid-view,
    .content-company.area-archive.area-hiring.grid-view.ch-cols-2,
    .content-company.area-archive.area-hiring.grid-view.ch-cols-3,
    .content-company.area-archive.area-hiring.grid-view.ch-cols-4,
    .content-company.area-archive.area-hiring.grid-view.ch-cols-5 { --ch-cols: 1; }
}

