/* About page styles using global theme variables from styles.css */

body {
    font-family: 'Montserrat', sans-serif;
    color: #333;
}

/* Hero section similar to projects page */
.about-hero {
    position: relative;
    min-height: 70vh;
    padding: 170px 0 100px;
    color: var(--light-text);
    overflow: hidden;
    background-color: #1a1a1a !important;
    /* Fallback background for mobile/offline */
}

.about-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.35));
    z-index: 1;
    pointer-events: none;
}

.hero-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.about-hero .container {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
}

/* Reuse profile card visual from projects */
.profile-card {
    background: rgba(0, 0, 0, .65) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff !important;
    border-radius: 18px;
    padding: 48px 32px;
    width: min(1100px, 60%);
    border: 1px solid rgba(255, 255, 255, .15);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    text-align: center;
}

.profile-title {
    font-size: clamp(1.7rem, 4.8vw + 0.2rem, 3.0rem);
    font-weight: 800;
    text-transform: none;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 14px;
    display: inline-block;
    color: #fff !important;
}

.profile-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 140px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 3px;
    box-shadow: 0 0 16px rgba(245, 32, 8, .35);
    transform: translateX(-50%);
}

.profile-text {
    margin-top: 22px;
    font-size: clamp(1rem, 0.45vw + 0.95rem, 1.0rem);
    line-height: 1.9;
    color: rgba(255, 255, 255, .92);
    text-align: left;
}

/* Fix visibility issues on section load */
.about-section {
    padding: 70px 0;
    background: #fff;
    opacity: 1;
    transform: none;
}

.about-section[data-visible="false"] {
    opacity: 0;
    transform: translateY(18px);
}

.about-section:nth-of-type(even) {
    background: #f8fafc;
}

.section-heading {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin-bottom: 14px;
    position: relative;
}

.section-heading::after {
    content: '';
    display: block;
    width: 64px;
    height: 3px;
    background: var(--primary-color);
    margin-top: 8px;
    border-radius: 2px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    align-items: start;
}

.about-col p {
    color: var(--text-color);
    margin-bottom: 12px;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 14px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    text-align: center;
    padding: 22px 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
}

/* .stat-number::after removed to allow dynamic suffix */

.stat-label {
    font-weight: 600;
    color: var(--secondary-color);
    margin-top: 6px;
    font-size: .95rem;
}

/* Our Team gallery */
.our-team .team-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 10px;
}

.member-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform .2s ease, box-shadow .2s ease;
}

.member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.member-photo {
    background: #fafafa;
    padding: 10px;
}

.member-photo img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 10px;
    background: #fff;
}

.member-name {
    margin: 10px 0 2px;
    color: var(--secondary-color);
    font-weight: 800;
}

.member-role {
    margin: 0 0 14px;
    color: #6b7280;
    font-weight: 600;
    font-size: .95rem;
}

.member-edu {
    margin: -6px 0 8px;
    color: #4b5563;
    font-size: .9rem;
}

.member-email {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    font-size: .9rem;
    display: inline-block;
    margin-bottom: 12px;
    word-break: break-all;
}

.member-email:hover {
    text-decoration: underline;
}

.team-group-title {
    margin-top: 24px;
    margin-bottom: 8px;
    font-size: 1.2rem;
    color: var(--secondary-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
    display: inline-block;
    width: 100%;
}

/* Gallery carousel */
.gallery-section {
    background: #fff;
}

.gallery-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-viewport {
    overflow: hidden;
    width: 100%;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .06);
}

.gallery-track {
    display: flex;
    transition: transform .4s ease;
}

.gallery-slide {
    min-width: 100%;
    user-select: none;
    position: relative;
}

.gallery-slide img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    position: absolute;
    left: 16px;
    bottom: 16px;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .25);
    font-weight: 700;
    max-width: 60%;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .85);
    color: var(--secondary-color);
    border: 1px solid #e5e7eb;
    width: 40px;
    height: 48px;
    border-radius: 10px;
    cursor: pointer;
    z-index: 2;
}

.gallery-nav.prev {
    left: 10px;
}

.gallery-nav.next {
    right: 10px;
}

.gallery-nav:hover {
    background: #fff;
}

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.gallery-dots button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #d1d5db;
    cursor: pointer;
}

.gallery-dots button.active {
    background: var(--primary-color);
}

@media (max-width: 768px) {
    .gallery-slide img {
        height: 300px;
    }

    .gallery-caption {
        left: 10px;
        bottom: 10px;
        padding: 8px 10px;
        font-size: .9rem;
        max-width: 80%;
    }
}

.team .team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 10px;
}

.team .team-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
}

.team .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.1);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.team .name {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.team .role {
    color: #6b7280;
    font-weight: 600;
    margin: 2px 0 6px;
    font-size: .95rem;
}

.team .bio {
    color: #4b5563;
}

.cta {
    background: #ffffff;
}

.cta .cta-card {
    background: linear-gradient(90deg, var(--secondary-color), #1f2937);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    color: #fff;
    box-shadow: 0 16px 28px rgba(0, 0, 0, .12), 0 8px 24px rgba(0, 0, 0, .1);
}

.cta .cta-card h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.cta .cta-card p {
    color: rgba(255, 255, 255, .9);
    margin-bottom: 12px;
}

@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-hero {
        padding: 140px 0 80px;
        min-height: 60vh;
    }
}

@media (max-width: 992px) {
    .our-team .team-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .our-team .team-gallery {
        grid-template-columns: 1fr;
    }
}

/* Small-device refinements (iPhone XR/SE and below) */
@media (max-width: 480px) {
    .profile-card {
        padding: 32px 20px;
        width: 96%;
    }

    .member-photo img {
        height: 350px;
        object-fit: cover;
        object-position: top;
    }

    .gallery-slide img {
        height: 260px;
    }

    .about-hero {
        padding: 120px 0 60px;
    }

    .title,
    .heading {
        word-wrap: break-word;
    }

    /* Prevent title overflow */
}

@media (max-width: 414px) {

    /* iPhone XR width */
    .member-photo img {
        height: 320px;
    }

    .gallery-slide img {
        height: 240px;
    }
}

@media (max-width: 375px) {

    /* iPhone SE width */
    .member-photo img {
        height: 300px;
    }

    .gallery-slide img {
        height: 220px;
    }
}

@media (max-width: 320px) {
    .member-photo img {
        height: 350px;
        object-fit: cover;
        object-position: top;
    }

    .gallery-slide img {
        height: 200px;
    }
}

/* Force visibility on mobile to override any potential JS lag */
@media (max-width: 768px) {
    .about-section {
        opacity: 1 !important;
        transform: none !important;
    }

    img {
        opacity: 1 !important;
        visibility: visible !important;
    }
}