/**
 * Student Cards CSS - Teach Haiti Brand Compliant
 * 
 * Uses official Teach Haiti brand colors:
 * Primary: Twilight (#003349), Harbor (#005E93), Canary (#F18721)
 * Secondary: Sea Foam (#68BFD0), Cherry (#EF3B49), Marigold (#FFD63B)
 * 
 * Typography: Mr. Eaves for headlines, Avenir Next for body text
 */

.th-student-cards-container {
    margin: 3rem 0;
    padding: 1rem;
}

.th-student-cards-wrapper {
    display: grid;
    gap: 2.5rem;
    margin: 0 auto;
}

/* Grid Layout Configurations */
.grid-layout .th-student-cards-wrapper {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.columns-2 .th-student-cards-wrapper {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    max-width: 800px;
}

.columns-3 .th-student-cards-wrapper {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    max-width: 1100px;
}

.columns-4 .th-student-cards-wrapper {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    max-width: 1300px;
}

/* Student Card Base Styling */
.th-student-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 51, 73, 0.10);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    border: 1px solid #e9ecef;
}

.th-student-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 51, 73, 0.15);
}

/* Image Container - Larger and More Prominent */
.th-student-image-container {
    position: relative;
    height: 320px;
    overflow: hidden;
    background-image: url(/wp-content/uploads/2024/02/header-map-scaled.webp), linear-gradient(135deg, #005E93 0%, #003349 100%) !important;
    background-blend-mode: soft-light;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Harbor to Twilight - keeping the student background gradient */
    display: flex;
    align-items: center;
    justify-content: center;
}

.th-student-photo-wrapper {
    width: 240px;
    /* Even larger */
    height: 240px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.th-student-card:hover .th-student-photo-wrapper {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 1);
}

.th-student-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: all 0.3s ease;
}

.th-student-photo-placeholder {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    border: 4px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Sponsor Badges */
.th-sponsor-badge,
.th-sponsored-badge {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    font-family: 'Avenir Next', Arial, sans-serif;
    letter-spacing: 0.3px;
}

.th-sponsor-badge {
    /* Convert to a ribbon-style clickable badge (no pulse) */
    background: #EF3B49;
    color: #ffffff;
    border: 0;
    cursor: pointer;
    animation: none;
    border-radius: 999px; /* pill core */
    line-height: 1.2;
    position: absolute;
}

/* Ribbon tails */
.th-sponsor-badge::before,
.th-sponsor-badge::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
}

.th-sponsor-badge::before {
    left: -8px;
    border-width: 9px 8px 9px 0;
    border-color: transparent #EF3B49 transparent transparent;
}

.th-sponsor-badge::after {
    right: -8px;
    border-width: 9px 0 9px 8px;
    border-color: transparent transparent transparent #EF3B49;
}

.th-sponsor-badge:hover {
    background-color: #e4303e;
}

.th-sponsor-badge:focus {
    outline: 3px solid rgba(239, 59, 73, 0.35);
    outline-offset: 2px;
}

.th-sponsored-badge {
    background: #68BFD0;
    color: white;
    cursor: default;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 51, 73, 0.14), 0 0 0 3px rgba(255, 255, 255, 0.35);
}

@keyframes th-pulse {
    0% {
        transform: translateX(-50%) scale(1);
    }

    50% {
        transform: translateX(-50%) scale(1.1);
    }

    100% {
        transform: translateX(-50%) scale(1);
    }
}

/* shimmer keyframes removed */

/* Student Information Section */
.th-student-info {
    padding: 2rem 2.5rem;
}

.th-student-name {
    font-family: 'Mr Eaves Mod OT', Helvetica, Arial, Lucida, sans-serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: #003349;
    /* Twilight */
    margin: 0 0 1.5rem 0;
    text-align: center;
    line-height: 1.3;
}

/* Student Details */
.th-student-details {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.th-student-detail {
    display: flex;
    padding: 0.1rem 0;
    font-size: 1.1rem;
    color: #003349;
    font-family: 'Avenir Next', Arial, sans-serif;
    font-weight: 400;
    transition: all 0.2s ease;
}

.th-student-detail:hover {
    color: #005E93;
}

.th-detail-icon {
    margin-right: 0.8rem;
    width: 20px;
    height: 20px;
    fill: #005E93;
    flex-shrink: 0;
}

.th-detail-text {
    font-weight: 500;
}

.th-detail-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Student Bio */
.th-student-bio {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #003349;
    font-family: 'Avenir Next', Arial, sans-serif;
    font-style: italic;
    border-top: 3px solid #68BFD0;
}

/* Action Section */
.th-student-action {
    text-align: center;
    margin-top: 2rem;
}

.th-sponsor-button {
    background: #f18721;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    font-family: 'Avenir Next', Arial, sans-serif;
    box-shadow: 0 2px 8px rgba(239, 59, 73, 0.25);
    letter-spacing: 0.3px;
    border-radius: 30px;
}

.th-sponsor-button:hover {
    color: #ffffff !important;
    background-color: #68bfd0;
    border-color: #68bfd0 !important;
}

.th-sponsor-button span {
    vertical-align: middle;
}

.th-sponsored-message {
    /* Soft celebration panel, non-CTA */
    background: linear-gradient(90deg, rgba(104,191,208,0.18), rgba(104,191,208,0.08));
    color: #003349;
    padding: 14px 22px 14px 48px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    display: inline-block;
    font-family: 'Avenir Next', Arial, sans-serif;
    letter-spacing: 0.3px;
    border: 2px solid rgba(104,191,208,0.85);
    box-shadow: 0 8px 24px rgba(0, 51, 73, 0.08);
    position: relative;
    cursor: default;
}

.th-sponsored-message::before {
    content: '🎉';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    pointer-events: none;
}

/* Card State Styling */
.th-student-card.needs-sponsor {
    border-top: 4px solid #EF3B49;
}

.th-student-card.sponsored {
    border-top: 4px solid #68BFD0;
}

.th-student-card.sponsored .th-student-image-container {
    /* background: linear-gradient(135deg, #68BFD0 0%, #005E93 100%); */
    /* Sea Foam to Harbor */
    background-blend-mode: soft-light;
    background-image: url(/wp-content/uploads/2024/02/header-map-scaled.webp), linear-gradient(135deg, #68BFD0 0%, #005E93 100%) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .th-student-cards-wrapper {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }

    .th-student-card {
        margin: 0 auto;
        max-width: 380px;
    }

    .th-student-image-container {
        height: 280px;
    }

    .th-student-photo-wrapper,
    .th-student-photo-placeholder {
        width: 200px;
        height: 200px;
    }

    .th-student-name {
        font-size: 1.4rem;
    }

    .th-student-info {
        padding: 1.5rem 2rem;
    }

    .th-sponsor-button {
        padding: 12px 24px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .th-student-cards-container {
        padding: 0.5rem;
        margin: 2rem 0;
    }

    .th-student-image-container {
        height: 260px;
    }

    .th-student-photo-wrapper,
    .th-student-photo-placeholder {
        width: 180px;
        height: 180px;
    }

    .th-student-info {
        padding: 1.2rem 1.5rem;
    }

    .th-sponsor-badge,
    .th-sponsored-badge {
        padding: 10px 16px;
        font-size: 0.8rem;
    }

    /* no special wrapping needed for simple banner */
}

/* Loading Animation for Dynamic Content */
@keyframes th-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.th-student-card {
    animation: th-fadeInUp 0.6s ease-out;
}

.th-student-card:nth-child(2) {
    animation-delay: 0.1s;
}

.th-student-card:nth-child(3) {
    animation-delay: 0.2s;
}

.th-student-card:nth-child(4) {
    animation-delay: 0.3s;
}

.th-student-card:nth-child(5) {
    animation-delay: 0.4s;
}

.th-student-card:nth-child(6) {
    animation-delay: 0.5s;
}
