/* ==========================================
   FILTER LAYOUT
   ========================================== */
.cr-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
}

.cr-filter-group {
    flex: 1;
    min-width: 200px;
}

.cr-filter-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.cr-filter-group select {
    width: 100%;
    padding: 8px;
}

.cr-filter-btn, .cr-reset-btn {
    padding: 10px 20px;
    background: #2271b1;
    color: #fff;
    border: none;
    cursor: pointer;
    text-decoration: none;
    height: fit-content;
}

.cr-reset-btn {
    background: #ccc;
    color: #333;
}

/* ==========================================
   SELECT2 ENHANCED UI
   ========================================== */

.select2-container--default .select2-selection--multiple {
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    min-height: 45px;
    padding: 5px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 15px;
    padding: 3px 12px;
    font-size: 13px;
    margin: 5px 5px 5px 0;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff;
    margin-right: 5px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ccc;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    margin-top: 7px;
    font-size: 14px;
    min-width: 150px !important;
}

.select2-results__option--highlighted {
    background-color: #0073aa !important;
    color: #fff !important;
}

/* ==========================================
   ACCORDION LAYOUT
   ========================================== */   
.cr-accordion-item {
    border: 1px solid #ddd;
    margin-bottom: 10px;
    background: #fff; /* Default white background */
    border-radius: 4px; /* Optional: rounded corners */
    overflow: hidden; /* Keeps children inside border-radius */
}

.cr-accordion-header {
    display: flex;
    padding: 15px;
    cursor: pointer;
    align-items: flex-start;
    background: #f3f3f3; /* Closed state */
    border-bottom: 1px solid transparent; /* Placeholder border */
    transition: background 0.3s ease; /* Smooth color change */
}

.cr-header-info {
    flex-grow: 1;
    min-width: 0; /* Prevents text from overflowing container */
}

/* Hover effect for closed items */
.cr-accordion-header:hover {
    background: #f9f9f9;
}

/* Active (Open) State */
.cr-accordion-item.active .cr-accordion-header {
    background: #ecf3eb; /* Open state = Light Green */
    border-bottom: 1px solid #d0dbd5; /* Separator line */
}

.cr-header-logo {
    width: 80px;
    height: 80px;
    margin-right: 20px;
    flex-shrink: 0;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cr-header-logo img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.cr-header-info {
    flex-grow: 1;
}

.cr-header-info h3 {
    margin: 0 0 5px;
    font-size: 18px;
    color: #10321f;
}

.cr-excerpt {
    color: #666;
    font-size: 14px;
    margin: 5px 0;
}

.cr-toggle-icon {
    font-size: 24px;
    font-weight: bold;
    color: #2271b1;
    transition: transform 0.3s ease;
}

/* Rotate icon when open */
.cr-accordion-item.active .cr-toggle-icon {
    transform: rotate(45deg); /* Turns + into x visually */
}

.cr-accordion-body {
    display: none;
    border-top: 1px solid #10321f;
    padding: 20px;
    background: #f3f3f3;    
}

/* Add a shadow to the open item */
.cr-accordion-item.active {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #bbb;
}

.cr-accordion-item.active .cr-accordion-body {
    display: block;
}

.cr-accordion-item.active .cr-toggle-icon {
    content: "-";
}

/* ==========================================
   CARD LAYOUT
   ========================================== */

/* Grid: 60% Left (3fr), 40% Right (2fr) */
.cr-details-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 25px;
}

@media (max-width: 768px) {
    .cr-details-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   DETAILS STYLING
   ========================================== */
/* Left Column Card */
.cr-details-col {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    height: fit-content;
}

.cr-details-col p {
    margin-bottom: 8px !important;
    line-height: 1.5 !important;
}

.cr-pdf-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* PDF Link Styling */
.cr-pdf-link {
    display: inline-flex;
    align-items: center;
    background: #f0f0f1;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    color: #d63638; /* Red for PDF */
    font-size: 0.9em;
    font-weight: 500;
    margin-top: 5px;
}

.cr-pdf-link svg {
    margin-right: 6px;
    width: 16px;
    height: 16px;
    fill: #d63638;
}

.cr-no-pdf {
    color: #666;
}

/* ==========================================
   CONTACT SECTION LAYOUT
   ========================================== */
.cr-contact-section {
    display: flex;
    gap: 20px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
}

.cr-contact-avatar {
    flex: 0 0 80px;
}

.cr-contact-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 2px solid #fff;
}

.cr-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #ddd;
}

.cr-contact-details {
    flex: 1;
}

.cr-contact-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.cr-contact-linkedin {
    margin-bottom: 10px;
}

.cr-contact-linkedin a {
    display: inline-flex;
    align-items: center;
    color: #0077b5;
    text-decoration: none;
    font-size: 0.9em;
}

.cr-contact-linkedin a:hover {
    text-decoration: underline;
}

.cr-contact-linkedin svg {
    margin-right: 5px;
}

.cr-contact-form-intro {
    font-size: 0.9em;
    margin-bottom: 10px;    
    color: #555;
    font-style: italic;
}

/* ==========================================
   COMPACT CONTACT FORM
   ========================================== */
.cr-contact-form {
    background: #fff;
    padding: 10px 10px 10px 0;
    border-radius: 4px;
}

.cr-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.cr-form-row input {
    flex: 1;
}

.cr-contact-form input[type="text"],
.cr-contact-form input[type="email"],
.cr-contact-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

.cr-contact-form textarea {
    margin-bottom: 10px;
    resize: vertical;
}

.cr-consent {
    margin-bottom: 10px;
    font-size: 0.9em;
    line-height: 1.4;
}

.cr-consent label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.cr-consent input[type="checkbox"] {
    margin-top: 3px;
}

.cr-submit-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 3px;
}

/* ==========================================
   RIGHT COLUMN & MAP
   ========================================== */
/* Right Column Card (Map) */
.cr-details-col-right {
    background: #ffffff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    height: fit-content;
    display: flex;
    flex-direction: column;
}

.cr-details-col h4, 
.cr-details-col-right h4 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #10321f;
    border-bottom: 2px solid #ecf3eb;
    padding-bottom: 10px;
}

/* Map Container */
.cr-map {
    width: 100%;
    height: 475px; /* Must have height for Leaflet */
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    z-index: 1; /* Prevent overlap issues with accordion */
    margin-top: auto; /* Pushes map to bottom if title is small */
}

/* Info Rows with Icons */
.cr-info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.cr-info-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-right: 15px;
    color: #2271b1;
    fill: #2271b1;
}

.cr-info-content {
    flex-grow: 1;
}

.cr-info-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 2px;
    font-weight: 600;
}

.cr-info-value {
    font-size: 15px;
    color: #333;
    line-height: 1.4;
    word-break: break-word;
}

.cr-info-value a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.cr-info-value a:hover {
    text-decoration: underline;
}

/* ==========================================
   GENERAL & HELPERS
   ========================================== */
.cr-notice.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border: 1px solid #c3e6cb;
    margin-bottom: 20px;
}

.cr-no-results, .cr-instructions {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* ==========================================
   EXPERTISE PILLS
   ========================================== */
.cr-expertise-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.cr-pill {
    display: inline-block;
    padding: 4px 12px;
    background-color: #e5f3f0; /* Very light green */
    color: #10321f;            /* Dark green text */
    border-radius: 15px;       /* Rounded corners */
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid #d0dbd5;
    transition: background 0.2s ease;
}

/* Ensure pills don't look weird if they wrap inside the small header */
.cr-accordion-item.active .cr-expertise-pills {
    margin-bottom: 5px;
}


/* ==========================================
   HEADER DESCRIPTION SWAP
   ========================================== */

/* Default State (Closed) */
.cr-full-desc-header {
    display: none; /* Hidden by default */
    margin: 10px 0;
    color: #444;
    font-size: 14px;
    line-height: 1.6;
    border-top: 1px solid #d0dbd5;
    padding-top: 10px;
}

.cr-excerpt {
    display: block; /* Visible by default */
}

/* Active State (Open) */
.cr-accordion-item.active .cr-excerpt {
    display: none; /* Hide excerpt when open */
}

.cr-accordion-item.active .cr-full-desc-header {
    display: block; /* Show full description when open */
}