/* Team Members Grid Styles */

:root {
    --tmg-primary-color: #e7d9c6; /* Default Light Beige */
    --tmg-secondary-color: #512d1f; /* Dark Brown */
    --tmg-card-front-img-bg: #ffffff;
    --tmg-text-dark: #121826;
    --tmg-text-light: #52525B;
    --tmg-border-radius: 0 16px 16px 16px;
    --tmg-pill-radius: 50px;
    --tmg-transition: all 0.3s ease-in-out;
}

/* Grid Container */
.tmg-grid {
    display: grid;
    gap: 32px;
    padding: 20px 0 30px;
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Column Variations */
.tmg-grid-1-columns { grid-template-columns: 1fr; }
.tmg-grid-2-columns { grid-template-columns: repeat(2, 1fr); }
.tmg-grid-3-columns { grid-template-columns: repeat(3, 1fr); }
.tmg-grid-4-columns { grid-template-columns: repeat(4, 1fr); }

/* Responsive Grid Breakpoints */
@media (max-width: 1024px) {
    .tmg-grid-4-columns { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .tmg-grid-4-columns,
    .tmg-grid-3-columns { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .tmg-grid { gap: 24px; }
}
@media (max-width: 480px) {
    .tmg-grid-2-columns,
    .tmg-grid-3-columns,
    .tmg-grid-4-columns { grid-template-columns: 1fr; }
}

/* Grid Items */
.tmg-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--tmg-border-radius);
    background: transparent;
    cursor: pointer;
}

/* Base Image */
.tmg-card-image {
    width: 100%;
    aspect-ratio: 1 / 1.05;
    background: var(--tmg-card-front-img-bg);
    border-radius: var(--tmg-border-radius);
    overflow: hidden;
    z-index: 1; /* Below the overlay */
}

.tmg-member-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* Static Content (Name & Title) - Always Visible, Always Static */
.tmg-card-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 24px 30px 24px;
    z-index: 3; /* Stays above the overlay */
    max-width: 100%; /* Important for ellipsis */
}

/* Name Pill */
.tmg-member-name {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: var(--tmg-text-dark);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    display: inline-block;
    padding: 5px 16px;
    border: 1px solid var(--tmg-text-dark);
    border-radius: var(--tmg-pill-radius);
    line-height: 1.2;
    transition: color 0.3s ease, border-color 0.3s ease;
    
    /* Single line truncation */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Title */
.tmg-member-title {
    font-size: 12px;
    margin: 0;
    color: var(--tmg-text-light);
    font-weight: 500;
    padding-left: 6px;
    transition: color 0.3s ease;
    
    /* Single line truncation for title too, just in case */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}


/* Hover Overlay (Background, Icons, Bio) */
.tmg-card-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--tmg-primary-color);
    display: flex;
    flex-direction: column;
    padding: 30px 24px;
    z-index: 2; /* Slides between image and static content */
    pointer-events: none;
    
    /* Fix for green line subpixel bleed */
    transform: translateY(105%);
    opacity: 0;
    
    /* Faster Transition */
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.tmg-card:hover .tmg-card-hover-overlay {
    pointer-events: auto;
    transform: translateY(0);
    opacity: 1;
}

/* --- ALTERNATING COLORS LOGIC --- */

/* Odd Cards: Beige (#e7d9c6) */
.tmg-card:nth-child(odd) .tmg-card-hover-overlay {
    background: #e7d9c6;
}

.tmg-card:nth-child(odd) .tmg-social-link {
    background: #121826;
    color: #e7d9c6;
}

.tmg-card:nth-child(odd):hover .tmg-member-title {
    color: #3f3f46; 
}


/* Even Cards: Dark Brown (#512d1f) */
.tmg-card:nth-child(even) .tmg-card-hover-overlay {
    background: #512d1f;
}

.tmg-card:nth-child(even) .tmg-member-bio {
    color: #ffffff; /* White text for dark background */
}

.tmg-card:nth-child(even) .tmg-social-link {
    background: #ffffff; /* White background for icons */
    color: #512d1f; /* Dark brown icon color */
}

/* White Text & Border for Name Pill/Title on Dark Brown Overlay */
.tmg-card:nth-child(even):hover .tmg-member-name {
    color: #ffffff;
    border-color: #ffffff;
}

.tmg-card:nth-child(even):hover .tmg-member-title {
    color: #e7d9c6; /* Beige title color for contrast */
}

/* --- END COLORS LOGIC --- */


/* Quote/Bio */
.tmg-member-bio {
    font-size: 13px;
    line-height: 1.6;
    color: #121826;
    margin: 20px 0 0 0;
    font-weight: 500;
}

/* Social Links */
.tmg-social-links {
    display: flex;
    gap: 8px;
}

.tmg-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: transform 0.3s ease-out;
    text-decoration: none;
}

.tmg-social-link svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.tmg-social-link:hover {
    transform: scale(1.1);
}

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

.tmg-card {
    animation: fadeInUp 0.4s ease-out forwards;
}

.tmg-card:nth-child(n) { animation-delay: 0.1s; }


/* =============================================================
   CAROUSEL — added styles (original grid styles above untouched)
   ============================================================= */

/* Outer wrapper — positions arrows */
.tmg-carousel-wrap {
    position: relative;
    width: 100%;
    padding: 0 56px;          /* space for arrows */
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* No-arrow variant keeps flush edges */
.tmg-carousel-wrap:not(:has(.tmg-carousel-arrow)) {
    padding: 0;
}

/* Clip the sliding track */
.tmg-carousel-viewport {
    overflow: hidden;
    width: 100%;
}

/* The moving strip */
.tmg-carousel-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    align-items: stretch;
}

/* Each slide — width is set dynamically by JS */
.tmg-carousel-slide {
    flex-shrink: 0;
    box-sizing: border-box;
}

/* The .tmg-card inside a slide fills 100% width */
.tmg-carousel-slide .tmg-card {
    width: 100%;
    animation: none;   /* disable entrance animation in carousel */
}

/* ---- Arrows ---- */
.tmg-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-60%);   /* offset slightly above centre (accounts for dots) */
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--tmg-secondary-color, #512d1f);
    background: #fff;
    color: var(--tmg-secondary-color, #512d1f);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
    padding: 0;
}

.tmg-carousel-arrow svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    flex-shrink: 0;
}

.tmg-carousel-arrow:hover {
    background: var(--tmg-secondary-color, #512d1f);
    color: #fff;
}

.tmg-carousel-arrow:disabled,
.tmg-carousel-arrow.tmg-disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.tmg-carousel-prev { left: 0; }
.tmg-carousel-next { right: 0; }

/* ---- Dots ---- */
.tmg-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.tmg-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.25s ease, transform 0.25s ease;
}

.tmg-carousel-dot.active,
.tmg-carousel-dot:hover {
    background: var(--tmg-secondary-color, #512d1f);
    transform: scale(1.35);
}

/* ---- Responsive — collapse padding when no room for arrows ---- */
@media (max-width: 640px) {
    .tmg-carousel-wrap {
        padding: 0 44px;
    }
    .tmg-carousel-arrow {
        width: 34px;
        height: 34px;
    }
    .tmg-carousel-arrow svg {
        width: 18px;
        height: 18px;
    }
}
