/* ==========================================================================
   NORD Organization Directory
   ========================================================================== */

/* Wrapper
   ========================================================================== */

.org-directory-wrap {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    font-family: inherit;
}

/* Search panel
   ========================================================================== */

.org-search-panel {
    background: #f4f5f6;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.org-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.org-search-icon {
    position: absolute;
    left: 12px;
    color: #6c757d;
    display: flex;
    pointer-events: none;
}

.org-search-input {
    width: 100%;
    padding: 10px 40px 10px 38px;
    font-size: 15px;
    line-height: 1.5;
    color: #212529;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none; /* removes default Safari search styling */
}

.org-search-input:focus {
    border-color: #0097a7;
    box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.18);
}

.org-search-input::placeholder {
    color: #9aa0a8;
}

/* hide browser-native clear button on search inputs */
.org-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.org-search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #6c757d;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.org-search-clear:hover {
    color: #212529;
}

/* Search actions row (contains submit button)
   ========================================================================== */

.org-search-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.org-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 22px;
    background: #0097a7;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease;
    line-height: 1.4;
}

.org-search-btn:hover {
    background: #007a87;
}

.org-search-btn:focus-visible {
    outline: 3px solid #0097a7;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(0, 151, 167, 0.25);
}

.org-search-btn:disabled,
.org-search-btn[aria-busy="true"] {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Visually hidden live region for screen reader announcements
   ========================================================================== */

.org-sr-announce {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Results summary
   ========================================================================== */

.org-results-summary {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 12px;
    min-height: 20px;
}

/* Results list + loading state
   ========================================================================== */

.org-results-list {
    position: relative;
    min-height: 120px;
}

.org-results-list[aria-busy="true"] .org-loading-overlay {
    display: flex;
}

.org-results-list[aria-busy="true"] .org-card,
.org-results-list[aria-busy="true"] .org-no-results {
    opacity: 0.4;
    pointer-events: none;
}

.org-loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.org-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e4e7;
    border-top-color: #0097a7;
    border-radius: 50%;
    animation: org-spin 0.7s linear infinite;
}

@keyframes org-spin {
    to { transform: rotate(360deg); }
}

/* Organization card
   ========================================================================== */

.org-card {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-left: 4px solid #0097a7;
    border-radius: 0 6px 6px 0;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.15s ease;
}

.org-card:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.org-card-body {
    padding: 16px 20px 12px;
}

.org-card-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.35;
}

.org-card-title a {
    color: #1a1a2e;
    text-decoration: none;
}

.org-card-title a:hover {
    color: #0097a7;
    text-decoration: underline;
}

.org-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    font-size: 14px;
    margin-bottom: 8px;
    color: #495057;
}

.org-card-meta-item {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.org-card-label {
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    white-space: nowrap;
}

.org-card-meta a,
.org-card-diseases a {
    color: #0097a7;
    text-decoration: none;
}

.org-card-meta a:hover,
.org-card-diseases a:hover {
    text-decoration: underline;
}

.org-card-diseases {
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
}

.org-card-diseases-more {
    color: #6c757d;
    font-style: italic;
}

.org-card-footer {
    padding: 10px 20px 14px;
    border-top: 1px solid #f0f0f0;
}

.org-card-profile-link {
    font-size: 14px;
    font-weight: 600;
    color: #0097a7;
    text-decoration: none;
}

.org-card-profile-link:hover {
    text-decoration: underline;
    color: #007a87;
}

/* No results
   ========================================================================== */

.org-no-results {
    background: #f8f9fa;
    border: 1px dashed #ced4da;
    border-radius: 6px;
    padding: 32px 24px;
    text-align: center;
    color: #6c757d;
    font-size: 15px;
}

.org-no-results p {
    margin: 0;
}

/* Pagination
   ========================================================================== */

.org-pagination-wrap {
    margin-top: 24px;
    margin-bottom: 8px;
}

.org-pagination-wrap .pagination .page-link {
    color: #0097a7;
    border-color: #dee2e6;
    font-size: 14px;
    padding: 6px 12px;
}

.org-pagination-wrap .pagination .page-item.active .page-link {
    background-color: #0097a7;
    border-color: #0097a7;
    color: #fff;
}

.org-pagination-wrap .pagination .page-item.disabled .page-link {
    color: #adb5bd;
}

.org-pagination-wrap .pagination .page-link:focus {
    box-shadow: 0 0 0 3px rgba(0, 151, 167, 0.25);
}

/* Responsive
   ========================================================================== */

@media (max-width: 576px) {
    .org-search-panel {
        padding: 16px;
    }

    .org-card-meta {
        flex-direction: column;
        gap: 4px;
    }

    .org-card-body {
        padding: 14px 14px 10px;
    }

    .org-card-footer {
        padding: 8px 14px 12px;
    }
}
