/**
 * Directory Page Styles
 * Tabbed directory with pill navigation and profile grid
 */

/* ==========================================================================
   Directory Page Layout
   ========================================================================== */

.directory-page {
    min-height: 60vh;
}

.directory-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0px;
}

/* ==========================================================================
   Directory Header
   ========================================================================== */

.directory-header {
    background-color: var(--wp--preset--color--primary, #2C5F2D);
    color: #ffffff;
    padding: 60px 0 40px;
    text-align: center;
    border-radius: 15px;
}

.directory-title {
    font-family: var(--wp--preset--font-family--heading, 'Poppins', sans-serif);
    font-size: 2.5rem;
    font-weight: 600;
    margin: 0 0 15px;
    color: #ffffff;
}

.directory-description {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.directory-description p {
    margin: 0;
}

/* ==========================================================================
   Tab Navigation (Pills)
   ========================================================================== */

.directory-tabs-wrapper {
    background-color: #f8f9fa;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #e9ecef;
}

/* Account for sticky header */
.sticky-header-enabled .directory-tabs-wrapper {
    top: 80px;
}

.directory-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.directory-tab-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-family: var(--wp--preset--font-family--body, 'Inter', sans-serif);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--wp--preset--color--primary, #2C5F2D);
    background-color: #ffffff;
    border: 2px solid var(--wp--preset--color--primary, #2C5F2D);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.25s ease;
    min-width: 120px;
}

.directory-tab-pill:hover {
    background-color: var(--wp--preset--color--secondary, #97BC62);
    border-color: var(--wp--preset--color--secondary, #97BC62);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 95, 45, 0.2);
}

.directory-tab-pill:focus {
    outline: 3px solid var(--wp--preset--color--secondary, #97BC62);
    outline-offset: 2px;
}

.directory-tab-pill.active {
    background-color: var(--wp--preset--color--primary, #2C5F2D);
    border-color: var(--wp--preset--color--primary, #2C5F2D);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(44, 95, 45, 0.3);
}

.directory-tab-pill.active:hover {
    background-color: var(--wp--preset--color--primary, #2C5F2D);
    border-color: var(--wp--preset--color--primary, #2C5F2D);
    transform: none;
}

/* ==========================================================================
   Tab Content Panels
   ========================================================================== */

.directory-content {
    padding: 40px 0 60px;
    background-color: #ffffff;
}

.directory-tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.directory-tab-panel.active {
    display: block;
}

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

/* ==========================================================================
   Profile Grid - Masonry Layout using CSS Columns
   ========================================================================== */

.profiles-grid {
    column-count: 4;
    column-gap: 30px;
}

.profiles-grid .profile-card {
    break-inside: avoid;
    margin-bottom: 30px;
}

/* 3 columns on tablet/medium screens */
@media (max-width: 1100px) {
    .profiles-grid {
        column-count: 3;
    }
}

/* ==========================================================================
   Profile Card
   ========================================================================== */

.profile-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.profile-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 30px 20px;
    text-align: center;
}

.profile-card-link:hover {
    text-decoration: none;
}

/* Profile Image */
.profile-card-image {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

/* Circular image wrapper - ensures perfect circle regardless of source image */
.profile-card-image-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 4px solid var(--wp--preset--color--secondary, #97BC62);
    transition: border-color 0.3s ease;
    background-color: #9ca3af;
}

.profile-card:hover .profile-card-image-wrapper {
    border-color: var(--wp--preset--color--primary, #2C5F2D);
}

/* Image inside wrapper - fills the circular container */
.profile-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    border-radius: 0;
}

/* Legacy support: Direct img without wrapper */
.profile-card-image .profile-avatar,
.profile-card-image > img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center center;
    border: 4px solid var(--wp--preset--color--secondary, #97BC62);
    transition: border-color 0.3s ease;
    display: block;
    flex-shrink: 0;
}

.profile-card:hover .profile-avatar,
.profile-card:hover .profile-card-image > img {
    border-color: var(--wp--preset--color--primary, #2C5F2D);
}

/* Placeholder for profiles without images - solid gray circle */
.profile-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #9ca3af;
    flex-shrink: 0;
}

/* Hide any icons inside placeholder - show solid gray only */
.profile-avatar-placeholder .dashicons,
.profile-avatar-placeholder span,
.profile-avatar-placeholder svg {
    display: none !important;
}

/* Profile Content */
.profile-card-content {
    padding: 0 10px;
}

.profile-card-name {
    font-family: var(--wp--preset--font-family--heading, 'Poppins', sans-serif);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--wp--preset--color--text, #1a1a1a);
    transition: color 0.3s ease;
}

.profile-card:hover .profile-card-name {
    color: var(--wp--preset--color--primary, #2C5F2D);
}

.profile-card-bio {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    /* -webkit-line-clamp: 2; */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.7em;
}

/* ==========================================================================
   No Profiles Message
   ========================================================================== */

.no-profiles-message {
    text-align: center;
    padding: 60px 20px;
    background-color: #f8f9fa;
    border-radius: 12px;
}

.no-profiles-message p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

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

/* Tablet - 2 columns */
@media (max-width: 768px) {
    .directory-header {
        padding: 40px 0 30px;
    }

    .directory-title {
        font-size: 2rem;
    }

    .directory-tabs-wrapper {
        padding: 15px 0;
    }

    .directory-tabs {
        gap: 10px;
    }

    .directory-tab-pill {
        padding: 10px 20px;
        font-size: 0.95rem;
        min-width: 100px;
    }

    .profiles-grid {
        column-count: 2;
        column-gap: 20px;
    }

    .profiles-grid .profile-card {
        margin-bottom: 20px;
    }

    .profile-card-link {
        padding: 25px 15px;
    }

    .profile-card-image-wrapper,
    .profile-card-image .profile-avatar,
    .profile-card-image > img,
    .profile-avatar-placeholder {
        width: 100px;
        height: 100px;
    }
}

/* Mobile - 1 column with horizontal card layout */
@media (max-width: 480px) {
    .directory-header {
        padding: 30px 0 25px;
    }

    .directory-title {
        font-size: 1.75rem;
    }

    .directory-description {
        font-size: 1rem;
    }

    .directory-tabs {
        flex-direction: column;
        gap: 8px;
    }

    .directory-tab-pill {
        width: 100%;
        max-width: 280px;
    }

    .directory-content {
        padding: 30px 0 40px;
    }

    .profiles-grid {
        column-count: 1;
        column-gap: 0;
    }

    .profiles-grid .profile-card {
        margin-bottom: 15px;
    }

    .profile-card-link {
        display: flex;
        align-items: center;
        text-align: left;
        padding: 20px;
        gap: 15px;
    }

    .profile-card-image {
        margin-bottom: 0;
        flex-shrink: 0;
        justify-content: flex-start;
    }

    .profile-card-image-wrapper,
    .profile-card-image .profile-avatar,
    .profile-card-image > img,
    .profile-avatar-placeholder {
        width: 80px;
        height: 80px;
    }

    .profile-card-content {
        padding: 0;
        flex: 1;
    }

    .profile-card-name {
        font-size: 1.05rem;
    }

    .profile-card-bio {
        font-size: 0.85rem;
        min-height: auto;
    }
}
