/* ── ch-directory.css — Companies House directory & search pages ── */

.ch-directory {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 0;
    font-family: var(--ch-font, 'Lato', sans-serif);
}

/* ── Search form ──────────────────────────────────────────────────────────── */

.ch-dir-search-wrap {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 26px;
}

.ch-dir-search-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--subtle-text, #65757a);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.ch-dir-search-form {
    display: flex;
    gap: 8px;
    max-width: 600px;
}

.ch-dir-search-input {
    flex: 1;
    padding: 11px 16px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: #333;
    outline: none;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ch-dir-search-input:focus {
    border-color: var(--primary, #ee2a5c);
    box-shadow: 0 0 0 3px rgba(238, 42, 92, 0.08);
}

.ch-dir-search-btn {
    padding: 11px 24px;
    background: var(--primary, #ee2a5c);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.ch-dir-search-btn:hover {
    opacity: 0.87;
}

/* ── A–Z navigation ───────────────────────────────────────────────────────── */

.ch-alpha-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 22px;
}

.ch-alpha-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #444;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.ch-alpha-btn:hover {
    background: var(--primary, #ee2a5c);
    color: #fff !important;
    border-color: var(--primary, #ee2a5c);
    text-decoration: none !important;
}

.ch-alpha-btn.ch-alpha-active {
    background: var(--primary, #ee2a5c);
    color: #fff !important;
    border-color: var(--primary, #ee2a5c);
    font-weight: 700;
    pointer-events: none;
}

/* ── Results count ────────────────────────────────────────────────────────── */

.ch-dir-count {
    font-size: 14px;
    color: var(--subtle-text, #65757a);
    margin-bottom: 4px;
}

.ch-dir-count strong {
    color: #222;
}

/* ── Result list ──────────────────────────────────────────────────────────── */

.ch-dir-results {
    border-top: 1px solid #eee;
}

.ch-dir-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.ch-dir-result-main {
    flex: 1;
    min-width: 0;
}

.ch-dir-result-name {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary, #ee2a5c) !important;
    text-decoration: none !important;
    margin-bottom: 5px;
    line-height: 1.3;
    word-break: break-word;
}

.ch-dir-result-name:hover {
    text-decoration: underline !important;
}

.ch-dir-result-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--subtle-text, #65757a);
    margin-bottom: 4px;
}

.ch-dir-result-address {
    font-size: 13px;
    color: var(--subtle-text, #65757a);
    line-height: 1.4;
}

/* ── Status badges ────────────────────────────────────────────────────────── */

.ch-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    white-space: nowrap;
}

.ch-status-active {
    background: rgba(7, 160, 7, 0.1);
    color: #07a007;
}

.ch-status-dissolved {
    background: rgba(200, 30, 30, 0.1);
    color: #c81e1e;
}

.ch-status-liquidation {
    background: rgba(225, 120, 0, 0.1);
    color: #e17800;
}

.ch-status-default {
    background: rgba(101, 117, 122, 0.1);
    color: var(--subtle-text, #65757a);
}

/* ── View profile button ──────────────────────────────────────────────────── */

.ch-dir-result-action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border: 1.5px solid var(--primary, #ee2a5c);
    border-radius: 99px;
    color: var(--primary, #ee2a5c) !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
    align-self: center;
}

.ch-dir-result-action:hover {
    background: var(--primary, #ee2a5c);
    color: #fff !important;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */

.ch-dir-empty {
    padding: 28px 0;
    font-size: 15px;
    color: var(--subtle-text, #65757a);
}

/* ── Pagination ───────────────────────────────────────────────────────────── */

.ch-directory .ch-dir-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 24px;
    padding: 0;
    list-style: none;
    justify-content: center;
}

.ch-directory .ch-dir-pagination li a,
.ch-directory .ch-dir-pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary, #ee2a5c);
    background: #fff;
    text-decoration: none !important;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.ch-directory .ch-dir-pagination li a:hover {
    background: var(--primary, #ee2a5c);
    color: #fff !important;
    border-color: var(--primary, #ee2a5c);
}

.ch-directory .ch-dir-pagination li.active span {
    background: var(--primary, #ee2a5c);
    color: #fff;
    border-color: var(--primary, #ee2a5c);
    pointer-events: none;
}

.ch-directory .ch-dir-pagination li.disabled span {
    color: #ccc;
    border-color: #eee;
    pointer-events: none;
}

/* ── Officer duplicate notice ─────────────────────────────────────────────── */

.ch-dir-officer-note {
    font-size: 12px;
    color: var(--subtle-text, #65757a);
    background: #f8f9fa;
    border-left: 3px solid #ddd;
    padding: 7px 12px;
    border-radius: 0 6px 6px 0;
    margin: 4px 0 10px;
    line-height: 1.5;
}

/* ── Officer-specific styles ──────────────────────────────────────────────── */

/* Remove the top divider line — cards have their own borders */
.ch-officer-results {
    border-top: none;
    padding-top: 6px;
}

/* Card border on all four sides with radius */
.ch-dir-result-row.ch-officer-row {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 10px;
    align-items: flex-start;
}

.ch-officer-name {
    cursor: default;
}

/* ── Company list (always visible) ───────────────────────────────────────── */

.ch-officer-companies {
    margin-top: 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

/* Use the outer row class for extra specificity to beat theme overrides */
.ch-officer-row .ch-officer-appt-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    background: #fff;
    box-sizing: border-box;
}

.ch-officer-row .ch-officer-appt-item:last-child {
    border-bottom: none;
}

.ch-officer-row .ch-officer-appt-item:hover {
    background: #fdf2f5;
}

.ch-officer-row .ch-officer-appt-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px;
    flex: 1 !important;
    min-width: 0;
}

.ch-officer-appt-name {
    display: block !important;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary, #ee2a5c) !important;
    line-height: 1.3;
    text-decoration: none !important;
    word-break: break-word;
    margin: 0;
}

.ch-officer-appt-name:hover {
    text-decoration: underline !important;
}

.ch-officer-appt-meta {
    display: block !important;
    font-size: 12px;
    color: var(--subtle-text, #65757a);
    margin: 0;
    line-height: 1.4;
}

.ch-appt-resigned {
    color: #c81e1e;
    font-size: 11px;
}

/* Smaller View Detail button — forced to the right edge */
.ch-officer-row .ch-appt-action {
    flex-shrink: 0 !important;
    align-self: center !important;
    margin-left: auto;
    font-size: 11px !important;
    padding: 5px 12px !important;
    white-space: nowrap;
}

/* ── "See all" expandable section ────────────────────────────────────────── */

.ch-officer-more {
    display: block;
}

.ch-officer-see-all {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary, #ee2a5c);
    cursor: pointer;
    list-style: none;
    user-select: none;
    background: #fafafa;
    border-top: 1px solid #eee;
    transition: opacity 0.12s;
}

.ch-officer-see-all::after {
    content: '\25BE';
    font-size: 15px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.2s;
}

.ch-officer-see-all::-webkit-details-marker,
.ch-officer-see-all::marker {
    display: none;
}

.ch-officer-see-all:hover {
    opacity: 0.75;
}

.ch-officer-more[open] .ch-officer-see-all::after {
    transform: rotate(180deg);
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */

@media screen and (max-width: 576px) {
    .ch-dir-search-wrap { padding: 14px 16px; }
    .ch-dir-search-form { max-width: 100%; }
    .ch-alpha-btn { min-width: 30px; height: 30px; font-size: 12px; }
    .ch-dir-result-action { display: none; }
    .ch-dir-result-name { font-size: 15px; }
}
