/* Page Specific Styles */

/* --- Profile Section Wrap --- */
.profile-section {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: var(--space-xl, 2.5rem) 0;
    background: var(--color-bg-main, #f9fafc);
}

/* --- Card Layout --- */
.profile-card {
    display: flex;
    flex-direction: row;
    background: var(--color-bg-surface, #fff);
    border-radius: var(--radius-lg, 20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .10);
    border: 1px solid var(--color-border-subtle, #dedede);
    max-width: 900px;
    width: 100%;
    overflow: hidden;
    margin: 0 auto;
    transition: transform .3s, box-shadow .3s;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, .15);
}

/* --- Responsive Mobile --- */
@media (max-width: 800px) {
    .profile-card {
        flex-direction: column;
        max-width: 98vw;
    }

    .profile-card-image {
        width: 120%;
        min-width: 0;
        min-height: 200px;
    }

    .profile-card-content {
        padding: var(--space-lg, 1.2rem);
    }
}

/* --- Profile Image Side --- */
.profile-card-image {
    width: 34%;
    min-width: 250px;
    max-width: 440px;
    position: relative;
    background: #eff3f8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.profile-image {
    width: 100%;
    height: 100%;
    min-height: 280px;
    object-fit: cover;
    display: block;
    border-radius: 0;
    background: #f2f4fa;
}

/* --- Content Side --- */
.profile-card-content {
    flex: 1;
    padding: var(--space-xl, 2.5rem);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
}

/* --- Titles and Meta --- */
.profile-name {
    font-size: 2.2rem;
    color: var(--color-text-primary, #222d47);
    margin-bottom: var(--space-xs, 0.5rem);
    font-weight: 700;
    line-height: 1.1;
}

.profile-title {
    font-size: 1.15rem;
    color: var(--color-accent, #1d5bae);
    margin: 0;
    font-weight: 600;
}

.profile-meta {
    font-size: 1rem;
    color: var(--color-text-secondary, #597087);
    margin: .5em 0 1em 0;
}

.profile-dept {
    font-style: italic;
    color: var(--color-text-secondary, #43648a);
}

.profile-inst {
    color: var(--color-text-secondary, #8c9ab1);
}

.profile-tagline {
    color: #458ad9;
    font-size: 0.9rem;
    display: block;
    margin-top: .2em;
    font-weight: 500;
}

.profile-bio-section {
    margin-bottom: 1.4em;
}

.profile-bio {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--color-text-primary, #232323);
    margin: 0;
}

/* --- Socials/Research Profiles --- */
.profile-socials-section {
    margin-top: 1.2em;
}

.profile-socials-title {
    font-size: 1.12rem;
    color: var(--color-accent, #2563eb);
    margin-bottom: 0.43em;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.profile-socials {
    display: flex;
    gap: 0.8em;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}


.btn-outline,
.social-icon-link,
.profile-socials a {
    display: inline-block;
    padding: 0.5em 1.3em;
    background: var(--btn-bg, #e8eafc);
    /* Soft blue/gray for light mode */
    color: var(--color-accent, #2563eb);
    /* Accent color for all modes */
    border: 1.7px solid var(--btn-border, #b5bedc);
    border-radius: 22px;
    font-size: 1.04rem;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: capitalize;
    box-shadow: none;
    transition:
        background-color 0.2s,
        color 0.2s,
        border-color 0.2s,
        box-shadow 0.22s;
}

/* DARK MODE: high contrast, readable, consistent feel */
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .social-icon-link,
[data-theme="dark"] .profile-socials a {
    background: var(--btn-bg, #263040);
    color: var(--color-accent, #60a5fa);
    border-color: var(--btn-border, #334155);
}

/* HOVER: Accented and always white text for best contrast */
.btn-outline:hover,
.social-icon-link:hover,
.profile-socials a:hover {
    background: var(--color-accent, #2563eb);
    color: #fff !important;
    /* Always readable on accent */
    border-color: var(--color-accent-dark, #1d4ed8);
    box-shadow: 0 2px 8px 0 rgba(37, 99, 235, 0.12);
}



/* --- Divider/HR Styling --- */
.divider {
    border: none;
    height: 0;
    border-top: 1.3px solid #e2e6ef;
    margin: var(--space-lg, 2rem) 0;
}


/* --- Consistent Hero Headers & Carousel --- */
.page-hero.main-hero,
.carousel-wrapper.main-hero {
    margin-bottom: var(--space-xl);
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 350px;
    /* Increased height for impact */
    background: #f0f0f0;
}

.page-hero.main-hero .hero-img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.hero-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    height: 100%;
    width: 100%;
    scrollbar-width: none;
    /* Firefox */
}

.hero-carousel::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    scroll-snap-align: start;
    position: relative;
    flex-shrink: 0;
}

.carousel-item .hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: var(--space-lg);
    color: #fff;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
    /* Let clicks pass through to carousel if needed */
}

.hero-title-overlay {
    font-size: 2.5rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    color: #fff !important;
}


/* --- Detailed Page Header (Mobile Optimized) --- */
.detail-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-md);
    align-items: center;
    margin-bottom: var(--space-lg);
    background: var(--color-bg-surface);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.detail-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    background: white;
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-subtle);
}

.detail-meta-group {
    display: flex;
    flex-direction: column;
}

.institution-name {
    font-size: 1.3rem;
    margin: 0 0 4px 0;
    color: var(--color-text-primary);
}

.year-badge {
    display: inline-block;
    background: var(--color-accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    align-self: flex-start;
}

.detail-description p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.thesis-box {
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin: var(--space-xl) 0;
}

.thesis-title {
    color: var(--color-accent);
    margin-bottom: var(--space-xs);
}

.thesis-supervisor {
    font-style: italic;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

/* Contact Card */
.contact-card {
    background: var(--color-bg-surface);
    padding: var(--space-xl);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Responsive */
@media (max-width: 768px) {

    /* Profile Card Mobile */
    .profile-card {
        flex-direction: column;
        text-align: center;
    }

    .profile-card-image {
        width: 100%;
        height: 250px;
    }

    .profile-card-content {
        padding: var(--space-lg);
    }

    .profile-role {
        margin-left: auto;
        margin-right: auto;
    }

    .profile-socials {
        justify-content: center;
    }

    /* Hero Carousel Mobile */
    .page-hero.main-hero,
    .carousel-wrapper.main-hero {
        height: 220px;
    }

    .hero-title-overlay {
        font-size: 1.6rem;
    }

    /* Detail Header Mobile Optimization */
    .detail-header {
        grid-template-columns: 1fr;
        /* Stack vertically if needed, or keep row for compact header */
        text-align: center;
        justify-items: center;
        gap: var(--space-sm);
    }

    .detail-meta-group {
        align-items: center;
    }

    .detail-logo {
        width: 80px;
        height: 80px;
    }

    .institution-name {
        font-size: 1.2rem;
    }
}