/* PCRC Cycling Club Theme - Team Page */

/* CSS Variables for your color palette */
:root {
    --deep-blue: #004e9e;
    --light-blue: #1ca2dd;
    --yellow: #ffe400;
    --white: #ffffff;
    --dark-blue: #002f6c;
    --shadow: rgba(0, 78, 158, 0.3);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, var(--deep-blue) 0%, var(--dark-blue) 100%);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Animated background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, var(--light-blue) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, var(--yellow) 1px, transparent 1px);
    background-size: 100px 100px, 150px 150px;
    opacity: 0.1;
    z-index: -1;
    animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100px, -100px); }
}

/* EXACT HEADER FROM INDEX.CSS */
header {
    background: linear-gradient(45deg, var(--light-blue), var(--deep-blue));
    backdrop-filter: blur(10px);
    border-bottom: 3px solid var(--yellow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    max-width: none;
    z-index: 2000;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px var(--shadow);
    border-radius: 0 0 20px 20px;
    animation: slideDown 0.8s ease-out;
    margin: 0;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* EXACT LOGO FROM INDEX.CSS */
.logo {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05) rotate(2deg);
}

.logo a {
    text-decoration: none;
    color: var(--yellow);
    font-size: 1.8em;
    font-weight: bold;
}

.logo img {
    width: 80px;
    height: auto;
    border-radius: 50%;
    border: 3px solid var(--yellow);
    transition: all 0.3s ease;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 10px var(--yellow); }
    to { box-shadow: 0 0 20px var(--yellow), 0 0 30px var(--yellow); }
}

.logo img:hover {
    transform: rotate(360deg);
    border-color: var(--white);
}

/* EXACT NAVIGATION FROM INDEX.CSS */
nav {
    display: flex;
    align-items: center;
    z-index: 2001;
    position: relative;
    min-width: 0;
    flex-shrink: 0;
}

.menu {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: nowrap;
}

.menu li {
    position: relative;
}

.menu li a {
    color: var(--white);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    padding: 12px 20px;
    border-radius: 25px;
    background: linear-gradient(45deg, transparent, rgba(255, 228, 0, 0.1));
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: block;
}

.menu li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--yellow), transparent);
    transition: left 0.5s ease;
}

.menu li a:hover::before {
    left: 100%;
}

.menu li a:hover {
    background: var(--yellow);
    color: var(--dark-blue);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 228, 0, 0.4);
}

/* EXACT DROPDOWN FROM INDEX.CSS */
.dropdown .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--dark-blue);
    border: 2px solid var(--yellow);
    border-radius: 15px;
    padding: 10px 0;
    min-width: 200px;
    box-shadow: 0 10px 30px var(--shadow);
    z-index: 10000;
    list-style: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.dropdown:hover .sub-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.sub-menu li a {
    color: var(--white) !important;
    padding: 12px 20px !important;
    display: block !important;
    text-decoration: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    transition: all 0.3s ease !important;
    transform: none !important;
    box-shadow: none !important;
}

.sub-menu li a:hover {
    background: var(--light-blue) !important;
    color: var(--white) !important;
    padding-left: 30px !important;
    transform: none !important;
    box-shadow: none !important;
}

/* EXACT HAMBURGER FROM INDEX.CSS */
.nav-toggle {
    display: none;
    background: var(--yellow);
    color: var(--dark-blue);
    border: none;
    padding: 10px;
    border-radius: 10px;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    transform: rotate(180deg);
    background: var(--white);
}

/* Main Content */
main {
    padding: 140px 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* KEEP ALL EXISTING TEAM CONTENT STYLING */

/* Team Section */
.team-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 228, 0, 0.3);
    border-radius: 20px;
    padding: 50px 30px;
    margin-bottom: 40px;
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease-out;
    text-align: center;
    color: var(--yellow);
}

.team-section:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 50px var(--shadow);
    border-color: var(--yellow);
}

.team-section h1 {
    color: var(--yellow);
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255, 228, 0, 0.5);
    position: relative;
}

.team-section h1::after {
    content: '👥';
    position: absolute;
    right: -80px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    animation: teamWave 3s ease-in-out infinite;
}

@keyframes teamWave {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
}

.team-section p {
    font-size: 1.2em;
    color: var(--white);
    max-width: 800px;
    margin: 0 auto 20px;
    line-height: 1.8;
    text-align: left;
}

/* TEAM MEMBER ARTICLES */
.team-member-article {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 228, 0, 0.3);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px var(--shadow);
    transition: all 0.4s ease;
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.team-member-article:nth-child(2) { animation-delay: 0.2s; }
.team-member-article:nth-child(3) { animation-delay: 0.4s; }
.team-member-article:nth-child(4) { animation-delay: 0.6s; }

.team-member-article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--yellow), var(--light-blue));
    transition: height 0.3s ease;
}

.team-member-article:hover::before {
    height: 100%;
    opacity: 0.1;
}

.team-member-article:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 50px var(--shadow);
    border-color: var(--yellow);
}

/* TEAM MEMBER CONTAINER - IMAGE TAKES UP WHOLE SPACE */
.team-member {
    position: relative;
    width: 300px;
    height: 300px;
    cursor: pointer;
    border-radius: 20px;
    overflow: hidden;
    border: 4px solid var(--yellow);
    box-shadow: 0 8px 25px var(--shadow);
    transition: all 0.4s ease;
}

.team-member:hover {
    transform: scale(1.05);
    border-color: var(--white);
    box-shadow: 0 15px 40px var(--shadow);
}

/* IMAGE FILLS THE ENTIRE CONTAINER */
.team-member-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

/* TEXT OVERLAY - HIDDEN BY DEFAULT, APPEARS ON HOVER */
.team-member-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 78, 158, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding: 30px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s ease;
    z-index: 2;
    border-radius: 16px;
}

/* TEXT APPEARS ONLY ON IMAGE HOVER */
.team-member:hover .team-member-overlay {
    opacity: 1;
    transform: scale(1);
}

.team-member:hover .team-member-image {
    filter: brightness(0.3) blur(2px);
}

/* TEXT STYLING INSIDE OVERLAY */
.team-member-overlay h2 {
    color: var(--yellow);
    font-size: 1.8em;
    margin-bottom: 15px;
    text-shadow: 0 0 10px rgba(255, 228, 0, 0.5);
    animation: slideInFromTop 0.5s ease-out 0.1s both;
}

.team-member-overlay .role {
    color: var(--light-blue);
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 15px;
    animation: slideInFromTop 0.5s ease-out 0.2s both;
}

.team-member-overlay .description {
    color: var(--white);
    font-size: 1em;
    line-height: 1.5;
    animation: slideInFromTop 0.5s ease-out 0.3s both;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Team grid layout for multiple members */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin: 40px 0;
}

/* Team stats section */
.team-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 228, 0, 0.3);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease-out;
    animation-fill-mode: both;
}

.stat-card:nth-child(1) { animation-delay: 0.8s; }
.stat-card:nth-child(2) { animation-delay: 0.9s; }
.stat-card:nth-child(3) { animation-delay: 1.0s; }
.stat-card:nth-child(4) { animation-delay: 1.1s; }

.stat-card:hover {
    transform: translateY(-10px);
    border-color: var(--yellow);
    box-shadow: 0 15px 30px var(--shadow);
}

.stat-icon {
    font-size: 2.5em;
    margin-bottom: 15px;
    display: block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.stat-title {
    color: var(--yellow);
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.stat-value {
    color: var(--white);
    font-size: 1.5em;
    font-weight: bold;
}

/* EXACT FOOTER FROM INDEX.CSS */
footer {
    background: linear-gradient(45deg, var(--light-blue), var(--deep-blue));
    color: var(--yellow);
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px var(--shadow);
    transition: all 0.3s ease;
    border-top: 3px solid var(--yellow);
}

footer:hover {
    transform: translateY(-5px);
    box-shadow: 0 -8px 30px var(--shadow);
}

footer p {
    margin: 10px 0;
    font-weight: 500;
    transition: all 0.3s ease;
}

footer a {
    color: var(--yellow);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
}

footer a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--white);
    transition: width 0.3s ease;
}

footer a:hover::before {
    width: 100%;
}

footer a:hover {
    color: var(--white);
    text-shadow: 0 0 10px var(--yellow);
}

/* EXACT SOCIAL LINKS FROM INDEX.CSS */
.social-links {
    margin: 15px 0;
    text-align: center;
}

.facebook-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1877f2;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 15px;
    border: 2px solid #1877f2;
    border-radius: 25px;
    background: linear-gradient(135deg, #ffffff, #f0f8ff);
    transition: all 0.3s ease;
    font-size: 1em;
}

.facebook-link:hover {
    background: #1877f2;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.3);
}

.facebook-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(24, 119, 242, 0.2);
}

.facebook-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    fill: currentColor;
}

.facebook-link:hover .facebook-icon {
    transform: scale(1.1);
}

/* EXACT RESPONSIVE FROM INDEX.CSS */
@media (max-width: 1200px) {
    .menu {
        gap: 10px;
    }
    
    .menu li a {
        padding: 10px 15px;
        font-size: 1em;
    }
}

@media (max-width: 900px) {
    header {
        width: 100vw;
        left: 0;
        right: 0;
        max-width: none;
    }
    
    main {
        padding: 160px 20px 40px;
    }
    
    nav {
        width: 100%;
        justify-content: center;
        position: relative;
        z-index: 2001;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--dark-blue);
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 10000;
        border-radius: 0 0 20px 20px;
        padding: 20px 0;
        gap: 0;
    }
    
    .menu.active {
        display: flex;
        animation: slideDown 0.5s ease;
    }
    
    .menu li {
        padding: 10px 0;
        text-align: center;
        width: 100%;
    }
    
    /* Team content mobile adjustments */
    .team-section,
    .team-member-article {
        padding: 30px 20px;
        font-size: 1em;
    }
    
    .team-section h1 {
        font-size: 2em;
    }
    
    .team-section h1::after {
        right: -60px;
        font-size: 0.7em;
    }
    
    .team-member {
        width: 250px;
        height: 250px;
    }
    
    .team-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    /* Add missing 768px breakpoint - DON'T override existing nav styles */
    html, body {
        background: linear-gradient(135deg, var(--deep-blue) 0%, var(--dark-blue) 100%) !important;
        background-color: var(--deep-blue) !important;
        background-attachment: fixed !important;
    }
    
    body {
        font-size: 17px;
        line-height: 1.7;
    }
    
    /* Better readability without touching navigation */
    section, article {
        font-size: 1.02em;
    }
    
    section p, article p {
        font-size: 1.1em !important;
        line-height: 1.7 !important;
    }
    
    section h1, article h1 {
        font-size: 1.9em !important;
    }
    
    section h2, article h2 {
        font-size: 1.4em !important;
    }
    
    /* Better cards without touching nav */
    .info-card, .stat-card, .benefit-item, .ride-info-card,
    .timeline-ride, .step-item, .value-item, .fact-item {
        font-size: 1em;
    }
    
    /* Mobile fixes for team member overlay text */
    .team-member-overlay {
        padding: 20px 15px; /* Reduce padding */
    }
    
    .team-member-overlay h2 {
        font-size: 1.3em !important; /* Smaller heading */
        margin-bottom: 10px;
        line-height: 1.2;
    }
    
    .team-member-overlay .role {
        font-size: 1em !important; /* Smaller role text */
        margin-bottom: 10px;
        line-height: 1.2;
    }
    
    .team-member-overlay .description {
        font-size: 0.85em !important; /* Much smaller description */
        line-height: 1.3;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 4; /* Limit to 4 lines */
        -webkit-box-orient: vertical;
    }
}

/* Fix for cut-off overlay text on mobile */

@media (max-width: 768px) {
    .team-member-overlay {
        height: auto !important; /* Dynamic height instead of fixed */
        min-height: 40% !important; /* Minimum height to ensure visibility */
        max-height: 80% !important; /* Maximum height to prevent covering entire image */
        padding: 15px 12px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        overflow: hidden !important;
    }
    
    .team-member-overlay h2 {
        font-size: 1.2em !important;
        margin-bottom: 8px !important;
        line-height: 1.2 !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }
    
    .team-member-overlay .role {
        font-size: 1em !important;
        margin-bottom: 8px !important;
        line-height: 1.2 !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        overflow: hidden !important;
    }
    
    .team-member-overlay .description {
        font-size: 0.85em !important;
        line-height: 1.3 !important;
        overflow: hidden !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 3 !important; /* Show 3 lines max */
        -webkit-box-orient: vertical !important;
        margin: 0 !important;
    }
}

@media (max-width: 600px) {
    .team-member-overlay {
        min-height: 35% !important;
        max-height: 70% !important;
        padding: 12px 10px !important;
    }
    
    .team-member-overlay h2 {
        font-size: 1.1em !important;
        margin-bottom: 6px !important;
    }
    
    .team-member-overlay .role {
        font-size: 0.9em !important;
        margin-bottom: 6px !important;
    }
    
    .team-member-overlay .description {
        font-size: 0.8em !important;
        -webkit-line-clamp: 2 !important; /* Show 2 lines max */
    }
}

@media (max-width: 480px) {
    .team-member-overlay {
        min-height: 30% !important;
        max-height: 60% !important;
        padding: 10px 8px !important;
    }
    
    .team-member-overlay h2 {
        font-size: 1em !important;
        margin-bottom: 5px !important;
    }
    
    .team-member-overlay .role {
        font-size: 0.85em !important;
        margin-bottom: 5px !important;
    }
    
    .team-member-overlay .description {
        font-size: 0.75em !important;
        -webkit-line-clamp: 2 !important;
    }
}

@media (max-width: 400px) {
    .team-member-overlay {
        min-height: 25% !important;
        max-height: 50% !important;
        padding: 8px 6px !important;
    }
    
    .team-member-overlay h2 {
        font-size: 0.9em !important;
        margin-bottom: 4px !important;
    }
    
    .team-member-overlay .role {
        font-size: 0.8em !important;
        margin-bottom: 4px !important;
    }
    
    .team-member-overlay .description {
        font-size: 0.7em !important;
        -webkit-line-clamp: 1 !important; /* Only 1 line on very small screens */
    }
}

/* Alternative: Disable hover effect on very small screens */
@media (max-width: 480px) {
    /* Optional: Completely disable hover on small screens */
    .team-member:hover .team-member-overlay {
        opacity: 0 !important; /* Hide overlay completely on small screens */
    }
    
    .team-member:hover .team-member-image {
        filter: none !important; /* Keep image normal */
    }
    
    /* Or show overlay permanently with smaller text */
    .team-member-overlay {
        opacity: 0.9 !important;
        position: absolute;
        bottom: 0;
        height: auto !important;
        background: linear-gradient(transparent, rgba(0, 78, 158, 0.95)) !important;
        justify-content: flex-end !important;
        padding: 15px 10px 10px !important;
    }
    
    .team-member-overlay h2,
    .team-member-overlay .role {
        display: none; /* Hide on small screens, show only on hover for larger screens */
    }
    
    .team-member-overlay .description {
        font-size: 0.8em !important;
        text-align: center;
        margin: 0;
        -webkit-line-clamp: 1;
    }
}

/* Mobile Background Fixes */
html {
    background: linear-gradient(135deg, var(--deep-blue) 0%, var(--dark-blue) 100%);
    background-color: var(--deep-blue);
    min-height: 100%;
}

/* Enhanced Mobile Readability - PRESERVES hamburger menu */
@media (max-width: 900px) {
    /* Keep your existing 900px breakpoint code intact, just add: */
    
    html, body {
        background: linear-gradient(135deg, var(--deep-blue) 0%, var(--dark-blue) 100%) !important;
        background-color: var(--deep-blue) !important;
        background-attachment: fixed !important;
    }
    
    body {
        font-size: 16px;
        line-height: 1.7;
    }
    
    /* DON'T override main padding - keep your existing values */
    
    /* Better section readability */
    section, article, .info-section, .race-section, .rides-section, 
    .join, .sent-to, .team-section, .team-member-article {
        font-size: 1.02em;
    }
    
    /* Better text without overriding structure */
    section p, article p {
        font-size: 1.1em !important;
        line-height: 1.7 !important;
    }
    
    section h1, article h1 {
        font-size: 2em !important;
    }
    
    section h2, article h2 {
        font-size: 1.5em !important;
    }
}

@media (max-width: 768px) {
    /* Add missing 768px breakpoint - DON'T override existing nav styles */
    html, body {
        background: linear-gradient(135deg, var(--deep-blue) 0%, var(--dark-blue) 100%) !important;
        background-color: var(--deep-blue) !important;
        background-attachment: fixed !important;
    }
    
    body {
        font-size: 17px;
        line-height: 1.7;
    }
    
    /* Better readability without touching navigation */
    section, article {
        font-size: 1.02em;
    }
    
    section p, article p {
        font-size: 1.1em !important;
        line-height: 1.7 !important;
    }
    
    section h1, article h1 {
        font-size: 1.9em !important;
    }
    
    section h2, article h2 {
        font-size: 1.4em !important;
    }
    
    /* Better cards without touching nav */
    .info-card, .stat-card, .benefit-item, .ride-info-card,
    .timeline-ride, .step-item, .value-item, .fact-item {
        font-size: 1em;
    }
}

@media (max-width: 600px) {
    /* Keep your existing 600px code, just enhance text readability */
    body {
        font-size: 16px;
        line-height: 1.7;
    }
    
    /* Only improve text, don't touch layout or nav */
    section p, article p {
        font-size: 1.05em !important;
        line-height: 1.7 !important;
    }
    
    section h1, article h1 {
        font-size: 1.8em !important;
    }
    
    section h2, article h2 {
        font-size: 1.4em !important;
    }
    
    /* Grid layouts - single column */
    .info-cards, .benefits-grid, .steps-container, .team-grid,
    .values-grid, .ride-info-cards, .race-stats {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    /* Photo galleries */
    .photo-gallery {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .ride-photo {
        max-height: 200px;
    }
    
    /* Team member adjustments */
    .team-member {
        max-width: 250px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    /* Add missing 480px - text improvements only */
    html, body {
        background: linear-gradient(135deg, var(--deep-blue) 0%, var(--dark-blue) 100%) !important;
        background-color: var(--deep-blue) !important;
        background-attachment: scroll !important;
    }
    
    body {
        font-size: 15px;
        line-height: 1.6;
    }
    
    /* Text improvements only */
    section p, article p {
        font-size: 1em !important;
        line-height: 1.6 !important;
    }
    
    section h1, article h1 {
        font-size: 1.6em !important;
        line-height: 1.3;
    }
    
    section h2, article h2 {
        font-size: 1.3em !important;
    }
    
    /* Compact cards */
    .info-card, .stat-card, .benefit-item {
        font-size: 0.95em;
    }
    
    /* Smaller team members */
    .team-member {
        max-width: 200px;
    }
    
    .ride-photo {
        max-height: 180px;
    }
}

@media (max-width: 400px) {
    /* Very small screens - text only */
    body {
        font-size: 14px;
    }
    
    section p, article p {
        font-size: 0.95em !important;
        line-height: 1.6 !important;
    }
    
    section h1, article h1 {
        font-size: 1.4em !important;
    }
    
    section h2, article h2 {
        font-size: 1.2em !important;
    }
    
    .team-member {
        max-width: 180px;
    }
    
    .ride-photo {
        max-height: 160px;
    }
}

/* DON'T override navigation - only improve other hover effects */
@media (max-width: 768px) {
    .info-card:hover, .stat-card:hover, .benefit-item:hover,
    .team-member:hover, .ride-photo:hover {
        transform: translateY(-3px) !important;
    }
    
    /* Ensure good contrast for content areas only */
    .info-card, .stat-card, .benefit-item, .ride-info-card {
        background: rgba(255, 255, 255, 0.15) !important;
    }
}

/* Mobile-friendly approach - text under image instead of overlay */

@media (max-width: 768px) {
    /* Disable hover overlay on mobile */
    .team-member:hover .team-member-overlay {
        opacity: 0 !important;
    }
    
    .team-member:hover .team-member-image {
        filter: none !important;
    }
    
    /* Create text section under image */
    .team-member::after {
        content: attr(data-name) "\A" attr(data-role) "\A" attr(data-description);
        white-space: pre-line;
        position: absolute;
        bottom: -120px; /* Position below the image */
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        color: var(--dark-blue);
        padding: 15px;
        border-radius: 0 0 15px 15px;
        font-size: 0.9em;
        line-height: 1.4;
        text-align: center;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        opacity: 0;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        z-index: 10;
    }
    
    /* Show text on tap/touch */
    .team-member.active::after,
    .team-member:active::after {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Adjust team member container height */
    .team-member {
        margin-bottom: 140px; /* Add space for text below */
    }
}

/* Add this to replace the existing mobile sections */

/* Hide mobile text on desktop by default */
.team-member-info-mobile {
    display: none;
}

/* Desktop styles - keep existing hover effect */
@media (min-width: 769px) {
    /* Ensure desktop hover effects work properly */
    .team-member-info-mobile {
        display: none !important;
    }
    
    .team-member-overlay {
        display: flex !important;
    }
    
    /* Ensure images maintain proper aspect ratio on desktop */
    .team-member-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .team-member {
        width: 300px;
        height: 300px;
        position: relative;
        overflow: hidden;
        border-radius: 15px;
    }
}

/* Tablet and mobile styles */
@media (max-width: 768px) {
    /* Mobile background fixes */
    html, body {
        background: linear-gradient(135deg, var(--deep-blue) 0%, var(--dark-blue) 100%) !important;
        background-color: var(--deep-blue) !important;
        background-attachment: fixed !important;
    }
    
    /* Hide overlay on mobile */
    .team-member-overlay {
        display: none !important;
    }
    
    /* Remove hover effects on mobile */
    .team-member:hover .team-member-image {
        filter: none !important;
    }
    
    /* Fix image aspect ratio on mobile */
    .team-member {
        width: 100%;
        max-width: 300px;
        height: 300px;
        margin: 0 auto;
        position: relative;
        overflow: hidden;
        border-radius: 15px;
    }
    
    .team-member-image {
        width: 100%;
        height: 100%;
        object-fit: cover !important;
        display: block;
    }
    
    /* Show mobile text under image */
    .team-member-info-mobile {
        display: block !important;
        background: rgba(255, 255, 255, 0.95);
        color: var(--dark-blue);
        padding: 15px;
        margin-top: 15px;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        text-align: center;
    }
    
    .team-member-info-mobile h3 {
        font-size: 1.3em;
        margin-bottom: 8px;
        color: var(--deep-blue);
        font-weight: bold;
    }
    
    .team-member-info-mobile .role-mobile {
        font-size: 1.1em;
        font-weight: bold;
        color: var(--light-blue);
        margin-bottom: 10px;
    }
    
    .team-member-info-mobile .description-mobile {
        font-size: 0.95em;
        line-height: 1.5;
        margin: 0;
        color: var(--dark-blue);
    }
    
    /* Adjust team member article spacing */
    .team-member-article {
        margin-bottom: 30px;
    }
    
    /* Team grid adjustments */
    .team-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        justify-items: center;
    }
}

@media (max-width: 600px) {
    .team-member {
        max-width: 280px;
        height: 280px;
    }
    
    .team-member-info-mobile {
        padding: 12px;
        margin-top: 12px;
    }
    
    .team-member-info-mobile h3 {
        font-size: 1.2em;
        margin-bottom: 6px;
    }
    
    .team-member-info-mobile .role-mobile {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    .team-member-info-mobile .description-mobile {
        font-size: 0.9em;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .team-member {
        max-width: 250px;
        height: 250px;
    }
    
    .team-member-info-mobile {
        padding: 10px;
        margin-top: 10px;
    }
    
    .team-member-info-mobile h3 {
        font-size: 1.1em;
    }
    
    .team-member-info-mobile .role-mobile {
        font-size: 0.95em;
    }
    
    .team-member-info-mobile .description-mobile {
        font-size: 0.85em;
    }
}

@media (max-width: 400px) {
    .team-member {
        max-width: 220px;
        height: 220px;
    }
    
    .team-member-info-mobile {
        padding: 8px;
        margin-top: 8px;
    }
    
    .team-member-info-mobile h3 {
        font-size: 1em;
    }
    
    .team-member-info-mobile .role-mobile {
        font-size: 0.9em;
    }
    
    .team-member-info-mobile .description-mobile {
        font-size: 0.8em;
    }
}

/* Ensure proper grid layout on all screens */
@media (min-width: 769px) {
    .team-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 30px;
        justify-items: center;
    }
}

@media (max-width: 768px) {
    .team-grid {
        display: block;
    }
    
    .team-member-article {
        display: block;
        margin-bottom: 40px;
    }
}