/**
 * WP Organisation Directory - Frontend Styles
 * Pixel-perfect match for Organisation Directory
 */

.wp-org-directory-wrapper {
    background-color: #FAF8F5;
    padding: 40px 32px;
    border-radius: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1D2622;
    box-sizing: border-box;
    width: 100%;
    margin: 0 auto;
}

.wp-org-directory-wrapper * {
    box-sizing: border-box;
}

/* ==========================================
   Header Filter Bar & Search
   ========================================== */
.wp-org-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.wp-org-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wp-org-tab {
    background-color: transparent;
    color: #22292F;
    border: none;
    outline: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 6px;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.4;
    white-space: nowrap;
}

.wp-org-tab:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: #12382C;
}

.wp-org-tab.active {
    background-color: #12382C; /* Deep forest green */
    color: #FFFFFF;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wp-org-tab.active:hover {
    background-color: #0E2F24;
    color: #FFFFFF;
}

/* Search Box */
.wp-org-search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 250px;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.wp-org-search-box:hover,
.wp-org-search-box:focus-within {
    background-color: #FFFFFF;
    border-color: #E2DDD5;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.wp-org-search-icon {
    position: absolute;
    left: 12px;
    pointer-events: none;
    color: #797E87;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-org-search-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 10px 32px 10px 38px;
    font-size: 14px;
    color: #1D2622;
    outline: none;
    font-family: inherit;
}

.wp-org-search-input::placeholder {
    color: #8C919A;
    font-weight: 400;
}

.wp-org-search-clear {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
}

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

/* ==========================================
   Organisation Grid
   ========================================== */
.wp-org-grid {
    display: grid;
    column-gap: 22px;
    row-gap: 18px;
    grid-template-columns: repeat(3, 1fr);
    transition: opacity 0.2s ease;
}

.wp-org-grid.wp-org-cols-1 { grid-template-columns: 1fr; }
.wp-org-grid.wp-org-cols-2 { grid-template-columns: repeat(2, 1fr); }
.wp-org-grid.wp-org-cols-3 { grid-template-columns: repeat(3, 1fr); }
.wp-org-grid.wp-org-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ==========================================
   Card Styling
   ========================================== */
.wp-org-card {
    background-color: #FFFFFF;
    border: 1px solid #ECE7DD;
    border-radius: 14px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 80px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.wp-org-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
    border-color: #DFD8CC;
}

.wp-org-card-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1;
}

.wp-org-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #C49B66; /* Warm golden dot */
    flex-shrink: 0;
}

.wp-org-card-info {
    min-width: 0;
    flex: 1;
}

.wp-org-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1D2622;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.wp-org-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.15s ease;
}

.wp-org-title a:hover {
    color: #12382C;
}

.wp-org-subtitle {
    margin: 4px 0 0 0;
    font-size: 13px;
    font-weight: 400;
    color: #7A756D;
    line-height: 1.25;
}

.wp-org-card-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Heart Favorite Button */
.wp-org-heart-btn {
    background: none;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.wp-org-heart-btn:hover {
    background-color: rgba(224, 83, 83, 0.08);
}

.wp-org-heart-icon {
    width: 20px;
    height: 20px;
    stroke: #D0C8BD;
    fill: none;
    transition: stroke 0.2s ease, fill 0.2s ease, transform 0.2s ease;
}

.wp-org-heart-btn:hover .wp-org-heart-icon {
    stroke: #E05353;
    transform: scale(1.12);
}

.wp-org-heart-btn.is-liked .wp-org-heart-icon {
    stroke: #E05353;
    fill: #E05353;
    animation: wpOrgHeartBeat 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes wpOrgHeartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Hide states */
.wp-org-card.wp-org-card-hidden {
    display: none !important;
}

.wp-org-card.wp-org-card-filtered-out {
    display: none !important;
}

.wp-org-card.wp-org-card-fade-in {
    animation: wpOrgFadeUp 0.25s ease-out forwards;
}

@keyframes wpOrgFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   No Results Message
   ========================================== */
.wp-org-no-results {
    text-align: center;
    padding: 48px 20px;
    color: #7A756D;
    font-size: 15px;
}

/* ==========================================
   Expand / View All Button
   ========================================== */
.wp-org-expand-wrap {
    display: flex;
    justify-content: center;
    margin-top: 36px;
}

.wp-org-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #FFFFFF;
    border: 1px solid #ECE7DD;
    border-radius: 10px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #1D2622;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    font-family: inherit;
}

.wp-org-expand-btn:hover {
    background-color: #F9F7F2;
    border-color: #DDD6C9;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
}

.wp-org-expand-icon {
    display: flex;
    align-items: center;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.wp-org-expand-btn.is-expanded .wp-org-expand-icon {
    transform: rotate(180deg);
}

/* ==========================================
   Responsive Adaptations
   ========================================== */
@media (max-width: 991px) {
    .wp-org-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .wp-org-directory-wrapper {
        padding: 32px 20px;
    }
}

@media (max-width: 680px) {
    .wp-org-topbar {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .wp-org-search-box {
        width: 100%;
        background-color: #FFFFFF;
        border-color: #E2DDD5;
    }
    .wp-org-tabs {
        overflow-x: auto;
        padding-bottom: 6px;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .wp-org-grid {
        grid-template-columns: 1fr !important;
    }
}
