/* =====================================================
   COLLEGE UNION PAGE STYLES
   ===================================================== */

/* 1. Main Section Container */
.union-body-section {
    padding: 40px 0 80px 0; /* Reduced top padding to move title up */
    min-height: 80vh;
    /* Bold dark greenish background with a vertical gradient for a seamless footer transition */
    background-color: var(--primary-teal-dark);
    background-image: linear-gradient(to bottom, var(--primary-teal-dark) 0%, var(--primary-teal) 100%);
    color: var(--white);
}

/* 2. Page Header (Title & Subtitle) */
.union-body-section .section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.union-body-section .section-header h2 {
    color: var(--white); /* White text for contrast on dark background */
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.union-body-section .section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-gold);
    border-radius: 2px;
}

.union-body-section .section-header p {
    color: var(--accent-gold); /* Gold text for better visibility on dark teal */
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 3. Members Grid Layout */
.union-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns on large screens */
    gap: 2.5rem;
    justify-content: center;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* 4. Individual Member Card */
.union-card {
    /* Deep maroon background for cards as requested */
    background: var(--secondary-maroon);
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.union-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-gold-light);
}

/* 5. Inner Content of the Card */
.union-card-inner {
    padding: 3rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--white);
}

/* 6. Member Image Styling */
.union-image-wrapper {
    width: 160px;
    height: 160px;
    margin-bottom: 2rem;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--accent-gold); /* Gold border for photos */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    background: var(--secondary-maroon-dark);
    transition: all var(--transition-normal);
}

.union-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform var(--transition-slow);
}

.union-card:hover .union-image-wrapper {
    border-color: var(--white);
    transform: scale(1.05);
}

.union-card:hover .union-image {
    transform: scale(1.1);
}

/* 7. Member Name & Designation */
.union-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.75rem;
    font-family: var(--font-primary);
    line-height: 1.2;
}

.union-post {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-fast);
}

.union-card:hover .union-post {
    background: var(--accent-gold);
    color: var(--secondary-maroon-dark);
    border-color: var(--accent-gold);
}

/* 8. Footer Wave Override (Makes the wave blend with the dark teal background) */
#footer .custom-shape-divider-top .shape-fill {
    fill: var(--primary-teal) !important;
}

/* 9. Responsiveness (Adapting to different screens) */

/* For tablet and desktop screens below 1200px */
@media (max-width: 1200px) {
    .union-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .union-image-wrapper {
        width: 130px;
        height: 130px;
    }

    .union-name {
        font-size: 1.1rem;
    }
}

/* For small tablets and landscape phones */
@media (max-width: 992px) {
    .union-body-section .section-header h2 {
        font-size: 2.5rem;
    }

    .union-image-wrapper {
        width: 100px;
        height: 100px;
        border-width: 3px;
    }

    .union-card-inner {
        padding: 2rem 1rem;
    }
}

/* For small mobile phones (3 cards per row as requested) */
@media (max-width: 576px) {
    .union-body-section {
        padding: 30px 0;
    }

    .union-body-section .section-header {
        margin-bottom: 2rem;
    }

    .union-body-section .section-header h2 {
        font-size: 1.8rem;
    }

    .union-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        padding: 0 0.5rem;
    }

    .union-card {
        width: 100%;
        max-width: none;
        border-radius: 12px;
    }

    .union-card-inner {
        padding: 1rem 0.5rem;
    }

    .union-image-wrapper {
        width: 70px;
        height: 70px;
        margin-bottom: 0.75rem;
        border-width: 2px;
    }

    .union-name {
        font-size: 0.8rem;
        margin-bottom: 0.4rem;
    }

    .union-post {
        font-size: 0.6rem;
        padding: 0.25rem 0.5rem;
        letter-spacing: 0;
    }
}
