/**
 * IKIM Team Block Styles
 * Responsive styling for team member grid display
 */

/* Box Shadow Options */
.ikim-team-wrapper.shadow-none {
    box-shadow: none !important;
}
.ikim-team-wrapper.shadow-small {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}
.ikim-team-wrapper.shadow-medium {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}
.ikim-team-wrapper.shadow-large {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
}

/* Main wrapper */
.ikim-team-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0.5rem;
}

/* Team title - matches WordPress heading styles */
.ikim-team-title {
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark-gray);
    margin-bottom: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

/* Default font size only if no inline style */
.ikim-team-title:not([style*="font-size"]) {
    font-size: 1.9rem;
}

/* Unified font size classes */
.ikim-team-title.title-xs { font-size: 0.75rem !important; }
.ikim-team-title.title-sm { font-size: 0.875rem !important; }
.ikim-team-title.title-medium { font-size: 1rem !important; }
.ikim-team-title.title-lg { font-size: 1.125rem !important; }
.ikim-team-title.title-xl { font-size: 1.25rem !important; }
.ikim-team-title.title-2xl { font-size: 1.5rem !important; }
.ikim-team-title.title-3xl { font-size: 1.875rem !important; }
.ikim-team-title.title-4xl { font-size: 2.25rem !important; }
.ikim-team-title.title-5xl { font-size: 3rem !important; }

/* Team grid container */
.ikim-team-grid {
    display: grid;
    width: 100%;
    align-items: start;
}

/* Column configurations */
.ikim-team-grid.columns-1 {
    grid-template-columns: 1fr;
}

.ikim-team-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.ikim-team-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.ikim-team-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.ikim-team-grid.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* Gap sizes */
.ikim-team-grid.gap-small {
    gap: 0.75rem;
}

.ikim-team-grid.gap-medium {
    gap: 1.25rem;
}

.ikim-team-grid.gap-large {
    gap: 2rem;
}

/* Individual team member card */
.ikim-team-member {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid #e0e0e0;
    padding: 0.75rem 0.5rem;
    text-align: center;
    transition: all 0.3s ease;
    height: fit-content;
}

.ikim-team-member:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Team member photo */
.team-member-photo {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
}

.team-member-photo img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f8f9fa;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.team-member-photo img:hover {
    transform: scale(1.05);
}

/* Team member name */
.team-member-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.3;
}

/* Team member title */
.team-member-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #002896;
    height: 50px;
    margin-bottom: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-style: italic;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Adjust spacing when title is not shown - add space to maintain alignment */
.team-member-name:not(:has(+ .team-member-title)) {
    margin-bottom: calc(50px + 0.5rem); /* 50px title height + 0.5rem margin */
}

/* Team member bio */
.team-member-bio {
    font-size: 0.8rem;
    line-height: 1.4;
    color: #666666;
    margin-bottom: 0;
    font-family: 'Inter', sans-serif;
}

/* Bio toggle button */
.team-bio-toggle {
    background: #002896;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.team-bio-toggle:hover {
    background: #001f6e;
    transform: translateY(-1px);
}

.team-bio-toggle:focus {
    outline: 2px solid #002896;
    outline-offset: 2px;
}

/* Bio content wrapper */
.team-member-bio-wrapper {
    margin-top: 0.5rem;
}

.team-member-bio-content {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #002896;
    transition: all 0.3s ease;
}

.team-member-bio-content.show {
    display: block !important;
}

/* Responsive breakpoints */

/* Tablet landscape (1024px and down) */
@media (max-width: 1024px) {
    .ikim-team-wrapper {
        padding: 1.5rem 1rem;
    }
    
    .ikim-team-title {
        margin-bottom: var(--spacing-md);
    }
    
    .ikim-team-grid.columns-5 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .ikim-team-grid.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .ikim-team-grid.gap-large {
        gap: 3rem;
    }
    
    .ikim-team-grid.gap-medium {
        gap: 2rem;
    }
}

/* Tablet portrait (768px and down) */
@media (max-width: 768px) {
    .ikim-team-wrapper {
        padding: 1.5rem 0.75rem;
    }
    
    .ikim-team-title {
        margin-bottom: var(--spacing-md);
    }
    
    .ikim-team-grid.columns-5,
    .ikim-team-grid.columns-4,
    .ikim-team-grid.columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ikim-team-grid.gap-large {
        gap: 2.5rem;
    }
    
    .ikim-team-grid.gap-medium {
        gap: 1.5rem;
    }
    
    .ikim-team-grid.gap-small {
        gap: 1rem;
    }
    
    .ikim-team-member {
        padding: 1.25rem 0.75rem;
    }
    
    .team-member-photo img {
        width: 125px;
        height: 125px;
    }
    
    .team-member-name {
        font-size: 1.15rem;
    }
    
    .team-member-title {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
        height: 45px; /* Slightly smaller on tablet */
    }
    
    .team-member-bio {
        font-size: 0.75rem;
    }
    
    .team-bio-toggle {
        font-size: 0.65rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Mobile (480px and down) */
@media (max-width: 480px) {
    .ikim-team-wrapper {
        padding: 1rem 0.5rem;
    }
    
    .ikim-team-title {
        margin-bottom: var(--spacing-md);
    }
    
    .ikim-team-grid.columns-5,
    .ikim-team-grid.columns-4,
    .ikim-team-grid.columns-3,
    .ikim-team-grid.columns-2 {
        grid-template-columns: 1fr;
    }
    
    .ikim-team-grid.gap-large,
    .ikim-team-grid.gap-medium {
        gap: 1.5rem;
    }
    
    .ikim-team-grid.gap-small {
        gap: 1rem;
    }
    
    .ikim-team-member {
        padding: 1rem 0.75rem;
        margin: 0 auto;
        max-width: 300px;
        width: 100%;
    }
    
    .team-member-photo img {
        width: 110px;
        height: 110px;
    }
    
    .team-member-name {
        font-size: 1.1rem;
    }
    
    .team-member-title {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
        height: 40px; /* Smaller on mobile */
    }
    
    .team-member-bio {
        font-size: 0.7rem;
        line-height: 1.3;
    }
    
    .team-bio-toggle {
        font-size: 0.6rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Extra small mobile (360px and down) */
@media (max-width: 360px) {
    .ikim-team-title {
        margin-bottom: var(--spacing-md);
    }
    
    .ikim-team-member {
        padding: 0.875rem 0.5rem;
    }
    
    .team-member-photo img {
        width: 100px;
        height: 100px;
    }
    
    .team-member-name {
        font-size: 1.05rem;
    }
    
    .team-member-title {
        font-size: 0.7rem;
        height: 35px; /* Smallest on extra small mobile */
    }
    
    .team-member-bio {
        font-size: 0.65rem;
        line-height: 1.3;
    }
    
    .team-bio-toggle {
        font-size: 0.55rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Background color variations */
.ikim-team-grid[style*="background-color"] {
    border-radius: 12px;
    padding: 2rem;
}

@media (max-width: 768px) {
    .ikim-team-grid[style*="background-color"] {
        padding: 1.5rem;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .ikim-team-grid[style*="background-color"] {
        padding: 1rem;
    }
}

/* Editor-specific styles for better editing experience */
.wp-block-editor .ikim-team-wrapper .add-member-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.wp-block-editor .ikim-team-wrapper .add-member-placeholder:hover {
    border-color: #007cba;
    background: #f0f6fc;
}

/* Print styles */
@media print {
    .ikim-team-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .ikim-team-member {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
    
    .team-member-photo img {
        width: 60px !important;
        height: 60px !important;
    }
}