/* =========================================
   1. Global Layout & Resets
   ========================================= */
.ts-single a,
.ts-wrap a {
    outline: none;
    text-decoration: none;
    color: inherit;
}

.ts-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

/* =========================================
   2. Filter Bar (Pills)
   ========================================= */
.ts-filterbar {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    width: 100%;
}

.ts-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* responsive wrapping */
    justify-content: center;
}
.ts-selectlabel {
    display: none; /* Hidden on desktop */
}
.ts-pill {
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.ts-pill:hover,
.ts-pill.is-active {
    background: #0d3b35;
    color: #fff;
    border-color: #0d3b35;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
/* Styling the Dropdown */
.ts-selecttext {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ts-select {
    appearance: none; /* Remove default browser arrow */
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 50px; /* Match pill shape */
    padding: 10px 20px;
    padding-right: 40px; /* Space for arrow */
    font-size: 16px; /* 16px prevents zoom on iOS */
    color: #333;
    width: 100%;
    max-width: 300px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
    
    /* Custom Arrow Icon */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

.ts-select:focus {
    outline: none;
    border-color: #0d3b35;
    box-shadow: 0 0 0 3px rgba(13, 59, 53, 0.1);
}

/* Mobile State: Hide Pills, Show Select */
@media (max-width: 768px) {
    .ts-pills {
        display: none;
    }

    .ts-selectlabel {
        display: flex;
        flex-direction: column; /* Stack label text and input */
        align-items: center;
        width: 100%;
        gap: 8px;
    }
}
/* =========================================
   3. Smart Grid System
   ========================================= */
.ts-grid {
    display: grid;
    /* Auto-fit columns: min 260px wide, max 1 fraction */
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    width: 100%;
}

/* =========================================
   4. Card Component
   ========================================= */
.ts-card {
    /* Layout */
    display: flex;
    flex-direction: column;
    
    /* Visuals */
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    position: relative;
    
    /* State: Visible */
    opacity: 1;
    transform: scale(1) translateY(0); /* Explicitly set both defaults */
    
    /* Animation: "Bouncy" effect for APPEARING (Showing) */
    transition: 
        opacity 0.4s ease, 
        transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
        box-shadow 0.3s ease;
}
.ts-card:not(.is-hidden):hover {
    transform: scale(1) translateY(-6px); /* Keep scale 1, move up */
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    z-index: 10; /* Bring hovered card to front */
}
/*.ts-card:hover {*/
/*    transform: translateY(-6px);*/
/*    box-shadow: 0 15px 30px rgba(0,0,0,0.1);*/
/*}*/

/* Hidden state for Javascript Filtering */
.ts-card.is-hidden {
    /* State: Hidden */
    opacity: 0;
    transform: scale(0.9) translateY(0); /* Scale down, reset Y position */
    
    /* Animation: Smooth "Linear" effect for DISAPPEARING (Hiding) */
    /* We override the transition here so it doesn't bounce when hiding */
    transition: 
        opacity 0.3s ease, 
        transform 0.3s ease; 
        
    pointer-events: none; /* Prevent clicks while fading out */
}

/* Photo Area */
.ts-photo {
    height: 260px;
    background: #eee;
    overflow: hidden;
    position: relative;
}

.ts-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.6s ease;
    filter: grayscale(100%);
}

.ts-card:hover .ts-photo img {
    transform: scale(1.08);
    filter: grayscale(0%);
}

/* Content Area */
.ts-panel {
    padding: 22px;
    text-align: left;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Ensures buttons align at bottom if needed */
}

.ts-name {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 800;
    color: #111;
    line-height: 1.2;
}

.ts-role {
    color: #0d3b35;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.ts-bio {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    /* Limit lines in grid view */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 100px;
}

/* Stretched Link (Makes entire card clickable) */
.ts-stretched-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Button */
.ts-btn {
    align-self: flex-start;
    margin-top: auto; /* Pushes button to bottom */
    padding: 8px 20px;
    background: #f0f0f0;
    color: #333;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    position: relative;
    z-index: 2; /* Sits above stretched link */
    transition: background 0.2s, color 0.2s;
}

.ts-card:hover .ts-btn {
    background: #0d3b35;
    color: #fff;
}

/* =========================================
   5. Single Member Page
   ========================================= */
.ts-single {
    max-width: 880px;
    margin: 40px auto;
    padding:32px 16px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.ts-single-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    padding:26px 18px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.ts-single h1 {
    font-size: 3rem;
    margin: 10px 0;
    line-height: 1.1;
    color: #111;
    font-weight:800;
}

.ts-kicker {
    letter-spacing:.12em;
    text-transform:uppercase;
    font-size:12px;
    color:#777;
    margin:0 0 8px;
}

.ts-single-role {
    font-size: 1rem;
    color: #0d3b35;
    margin-bottom: 20px;
    font-weight: 500;
}

.ts-single-photo {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 30px;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.ts-single-photo img {
    display: block;
    width: 100%;
    height: auto;
}

/* Bio Expand/Collapse Animation */
.ts-bio-wrap {
    max-width:640px;
	margin:0 auto;
    position: relative;
    overflow: hidden;
    text-align: left;
    transition: max-height 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.ts-bio-wrap.is-collapsed {
    max-height: 100px; /* Height when closed */
}

.ts-bio-wrap:not(.is-collapsed) {
    max-height: 2000px; /* Arbitrary large height to allow full expansion */
}

.ts-bio-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
    transition: opacity 0.3s;
}

.ts-bio-wrap:not(.is-collapsed) .ts-bio-fade {
    opacity: 0;
}

.ts-toggle {
    margin-top: 25px;
    background: #e24b1a;
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    transition: transform 0.2s, background 0.2s;
}

.ts-toggle:hover {
    background: #c63d12;
    transform: translateY(-2px);
}

/* =========================================
   6. Modal Popup
   ========================================= */
.ts-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    backdrop-filter: blur(4px);
}

.ts-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.ts-modal-inner {
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
    position: relative;
}

.ts-modal.is-open .ts-modal-inner {
    transform: scale(1);
    opacity: 1;
}

.ts-modal img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: block;
}

.ts-modal-close {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 44px;
    height: 44px;
    background: #fff;
    border: none;
    border-radius: 50%;
    font-weight: 900;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.ts-modal-close:hover {
    transform: scale(1.1);
}

/* =========================================
   7. Mobile Specific Adjustments
   ========================================= */
@media (max-width: 600px) {
    /* Adjust grid padding for small screens */
    .ts-wrap {
        padding: 30px 15px;
    }
    
    /* Make single card padding smaller on mobile */
    .ts-single-card {
        padding: 25px 15px;
    }
    
    /* Adjust font sizes for mobile */
    .ts-single h1 {
        font-size: 2.2rem;
    }
    
    /* Modal close button moves inside on small screens to prevent overflow */
    .ts-modal-close {
        top: 10px;
        right: 10px;
    }
}