/*
 * Dr. Nikhil Narayan - Human Rights Law Portfolio
 * Minimal Monochrome Theme
 */

/* Import Modern Sans-Serif Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* Import Design Tokens */
@import url('design-tokens.css');

:root {
    --bg-color: #f0f4ff;

    /* Soft light blue - replaces grey throughout */
    --surface-color: #fff;
    --text-color: #111827;

    /* Deep grey, almost black. Darkened from #6b7280 (4.395:1 on --bg-color) to
       #666d7b (4.73:1) to clear WCAG 2.1 AA contrast (4.5:1) for normal text on
       the page background. Still AA-safe on white surfaces (5.20:1). */
    --muted-color: #666d7b;
    --accent-color: #2563EB;

    /* Vibrant Blue */
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --border-color: #e5e7eb;

    /* Lighter border */
    --navy-900: #0f1b33;
    --navy-800: #18294a;
    --nav-text: #e2e8f0;
    --nav-text-strong: #f8fafc;
    --nav-accent: #93c5fd;
    --nav-cta-ring: var(--accent-color);
    --nav-cta-fill: var(--accent-light);
    --header-bg: rgba(255, 255, 255, 0.9);

    /* Glassy white header */
    --transition-speed: 0.2s ease-out;
    --banner-aspect-ratio: 16 / 9;

    /* Typography - Diverse Sans-Serif Stack */
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
svg {
    max-width: 100%;
    height: auto;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.75;
    margin: 0;
    scroll-behavior: smooth;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 0;
}

#smooth-wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

#smooth-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    padding-top: var(--nav-height, 72px);
}

main {
    flex: 1 0 auto;
}

.footer {
    margin-top: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    color: var(--text-color);
    font-weight: 600;
}

p {
    color: var(--muted-color);
    margin-bottom: 1.25rem;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color var(--transition-speed), border-color var(--transition-speed);
}

a:hover,
a:focus {
    color: var(--text-color);
    border-color: var(--text-color);
}

main {
    background-color: var(--bg-color);
}

/* Global Page Header padding to clear fixed nav */
.page-header {
    padding-top: clamp(7rem, 10vw, 9rem) !important;
    padding-bottom: 3rem;

    /* Background handled by body (Blue) or overridden */
    border-bottom: 1px solid var(--border-color);
}

.page-banner {
    position: relative;
    width: 100%;
    height: clamp(140px, 18vw, 220px);
    overflow: hidden;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
    display: none;
}

.page-banner-image {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}

.page-banner+.page-header {
    padding-top: 0;
    margin-top: 0;
}

.page-banner+.hero {
    padding-top: clamp(1.5rem, 6vw, 3rem) !important;
}

.page-title-wrapper {
    display: grid;
    grid-template-columns: minmax(0, max-content);
    grid-template-areas: "title";
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-inline: auto;
}

.page-title-wrapper h1 {
    grid-area: title;
    min-width: 0;
    max-width: min(100%, 22ch);
    margin: 0;
    text-align: center;
    overflow-wrap: break-word;
    text-wrap: balance;
}

@media (max-width: 767.98px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block;
    }

    .page-title-wrapper {
        grid-template-columns: 1fr;
        grid-template-areas: "title";
        justify-items: center;
        width: 100%;
    }

    .page-title-wrapper h1 {
        text-align: center;
    }
}

@media (max-width: 767.98px) {
    main {
        display: flex;
        flex-direction: column;
    }

    .home-overview {
        order: 1;
    }

    .home-focus {
        order: 2;
    }

    .home-featured {
        order: 3;
    }

    .home-featured-talk {
        order: 4;
    }

    .home-fieldwork {
        order: 5;
    }

    .home-stats {
        order: 6;
    }

    .home-contact {
        order: 7;
    }

    /* Show hero image slot at top on mobile */
    .hero-image-slot {
        display: flex;
    }

    /* Hide desktop hero image on mobile */
    .hero-image-desktop {
        display: none;
    }

    /* Show logo animation after text on mobile */
    .hero-logo-slot {
        display: flex;
    }

    #focus-logo-wrapper {
        min-height: 0;
    }

    .hero-logo-slot .logo-animation-container {
        max-width: 200px;
        max-height: 240px;
    }

    .page-banner {
        aspect-ratio: var(--banner-aspect-ratio, 16 / 9);
    }

    .page-banner+.page-header {
        padding-top: 0;
    }

    .page-banner+.hero {
        padding-top: clamp(1.25rem, 5vw, 2.5rem) !important;
    }
}

/* Specific adjustment for Homepage Hero - Removed to standardize height
.hero {
    padding-top: clamp(9rem, 12vw, 11rem) !important;
} */

section {
    padding: clamp(3rem, 6vw, 5rem) 0;
    border-bottom: 1px solid var(--border-color);
}

section.page-banner {
    padding: 0;
}


/* Global Alternating Sections (include page headers) */
main> :is(section, header.page-header):nth-child(odd) {
    background-color: var(--surface-color);
}

main> :is(section, header.page-header):nth-child(even) {
    background-color: transparent;
}

.section-heading {
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 600;
}

.divider {
    height: 2px;
    width: 60px;
    background-color: var(--accent-color);
    margin: 1rem 0 2rem;
}

.divider.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.section-heading+.divider {
    margin-top: 0;
}

/* Accessibility */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -2.5rem;
    background: var(--accent-color);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 1000;
    transition: top var(--transition-speed);
}

.skip-link:focus {
    top: 1rem;
}

:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* Navigation */
#mainNav {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    transition: padding var(--transition-speed), backdrop-filter var(--transition-speed);
    padding: 0.25rem 0;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

#mainNav.navbar-shrink {
    padding: 0.25rem 0;
    background-color: var(--header-bg);
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.04em;
    color: var(--text-color) !important;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    line-height: 1.1;
}

.navbar-brand-icon {
    height: clamp(32px, 2.4vw, 40px);
    width: auto;
    flex-shrink: 0;
    display: block;
    transform: translateY(-0.5px);
}

/* Fix for Flash of Stale Content on Entry Pages */
.entry-hero-image {
    transition: opacity 0.4s ease-out;
    opacity: 0;
    visibility: hidden;
}

.entry-hero-image.is-loaded {
    opacity: 1;
    visibility: visible;
}

.navbar-toggler {
    border: none;
    color: var(--text-color);
    font-size: 1.25rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-color) !important;
    padding: 0.5rem 0.9rem !important;
    position: relative;
    transition: color var(--transition-speed);
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0.9rem;
    right: 0.9rem;
    bottom: 0.2rem;
    height: 1px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform var(--transition-speed);
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
    color: var(--text-color) !important;
}

.nav-link:hover::after,
.nav-link:focus::after,
.nav-link.active::after {
    transform: scaleX(1);
}

/* Hero */
.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    padding: clamp(6rem, 10vw, 8rem) 0 clamp(4rem, 8vw, 6rem);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-banner {
    --hero-bg-image: none;

    background-color: var(--header-bg);
}

.hero .container {
    max-width: 960px;
    position: relative;
    z-index: 2;
}

.hero .text-white {
    color: var(--text-color) !important;
    text-shadow: none;
}

.hero-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.35));
    z-index: 1;
}

.hero-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--hero-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.35s ease-out;
    z-index: 0;
}

.hero-banner.hero-image-loaded::after {
    opacity: 1;
}

/* Decorative crest watermark behind the home hero text (home page only). Sits
   above the dark gradient (::before, z-index 1) but below the content (z-index 2). */
.hero-watermark {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
}

.hero-watermark-mark {
    width: min(92%, 46rem);
    height: auto;
    color: #fff;
    opacity: 0.06;
}

.hero-banner .text-white {
    color: #fff !important;
    text-shadow: 0 8px 24px rgba(15, 23, 42, 0.45);
}

.hero-banner p {
    color: rgba(255, 255, 255, 0.85);
}

.hero-banner .btn-outline-primary {
    background-color: transparent;
    border-color: #fff;
    color: #fff;
}

.hero-banner .btn-outline-primary:hover,
.hero-banner .btn-outline-primary:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

.hero-page {
    min-height: 75vh;
    height: auto;
    padding: calc(var(--nav-height, 72px) + clamp(1rem, 3vw, 2rem)) 0 clamp(2rem, 5vw, 4rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero.hero-page p,
.hero.hero-page .page-subtitle {
    margin-left: auto;
    margin-right: auto;
    max-width: 800px;
    text-align: center;
}

.page-intro {
    padding: 3rem 0;
}

.hero h1 {
    font-size: clamp(2.75rem, 5vw, 4rem);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.hero p {
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    color: var(--muted-color);
    margin-bottom: 2rem;
    max-width: 520px;
    margin-left: 0;
    margin-right: 0;
}

.hero .btn {
    margin-top: 0;
}

.hero .page-subtitle {
    margin-left: auto;
    margin-right: auto;
    max-width: 800px;
}

@media (min-width: 769px) {
    .hero.hero-page h1 {
        margin-bottom: 0.75rem;
    }

    .hero.hero-page .divider {
        margin: 0.5rem auto;
    }

    .hero.hero-page .page-subtitle {
        margin-top: 0;
        margin-bottom: 0.75rem;
    }
}


.hero .text-center .btn {
    margin-left: 0;
}

/* Hero image slot - for mobile (shows hero image at top) */
.hero-image-slot {
    display: none;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.hero-image-slot .hero-photo-mobile {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

/* Hero image desktop - visible on large screens */
.hero-image-desktop {
    display: block;
    text-align: center;
}

/* Hide the mobile image slot on desktop, show the desktop version */
@media (min-width: 992px) {
    .hero-image-slot {
        display: none !important;
    }

    .hero-image-desktop {
        display: block;
    }

    .hero-logo-slot {
        display: none;
    }

    .hero-image-col {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Hero logo slot - now appears after text on mobile */
.hero-logo-slot {
    display: none;
    justify-content: center;
    margin-top: 2rem;
    margin-bottom: 0;
}

.hero-logo-slot .logo-animation-container {
    max-width: 240px;
}

.hero .btn-outline-primary {
    background-color: #fff;
    border-color: #fff;
    color: var(--text-color);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.hero .btn-outline-primary:hover,
.hero .btn-outline-primary:focus {
    background-color: #fff;
    border-color: #fff;
    color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.hero-photo {
    width: 100%;
    max-width: 500px;
    height: auto;
    max-height: 600px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    object-fit: cover;
    display: block;
}

@media (max-width: 991.98px) {
    .hero {
        padding-top: 6rem !important;
        text-align: center;
        min-height: auto;
        align-items: flex-start;
    }

    .hero .text-center {
        text-align: center !important;
    }

    .hero p {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-photo {
        margin: 3rem auto 0;
        max-height: none;
        width: 100%;
        max-width: 100%;
        aspect-ratio: 4/5;
    }

    .featured-context {
        margin-top: 2rem;

        /* Ensure spacing when stacked */
    }
}

.btn-primary {
    background-color: var(--accent-color);
    border: 1px solid var(--accent-color);
    color: #fff;
    padding: 0.75rem 1.8rem;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    font-size: 0.95rem;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    transition: all var(--transition-speed);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
}

.btn-outline-primary {
    border: 1px solid var(--border-color);

    /* Subtle border initially */
    background-color: var(--surface-color);
    color: var(--text-color);
    border-radius: 999px;
    padding: 0.75rem 1.8rem;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    transition: all var(--transition-speed);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--surface-color);
    border-color: var(--text-color);
    color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-secondary,
.btn-outline-light {
    background-color: var(--surface-color);
    border-color: var(--border-color);
    color: var(--text-color);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-light:hover,
.btn-outline-light:focus {
    background-color: var(--surface-color);
    border-color: var(--text-color);
    color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* About */
.profile-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.profile-card h2 {
    font-size: 1.9rem;
    margin: 0.5rem 0 0.25rem;
}

.profile-card .text-muted {
    color: var(--muted-color) !important;
}

.profile-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background-color: #dcdcdc;
    background-size: cover;
    background-position: center;
    filter: grayscale(20%);
    border: 4px solid var(--surface-color);
    box-shadow: 0 0 0 1px var(--border-color);
}

.social-icons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.social-icons a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: background-color var(--transition-speed), color var(--transition-speed), transform var(--transition-speed);
}

.social-icons a:hover,
.social-icons a:focus {
    background-color: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
}

.social-icon--qub {
    padding: 0;
}

.social-icon--qub .icon-qub {
    display: block;
    width: 20px;
    height: 20px;
    background-image: url('../img/qub-logo.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.social-icon--qub:hover .icon-qub,
.social-icon--qub:focus .icon-qub {
    filter: brightness(0) invert(1);
}


.feature-box {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    height: 100%;
    text-align: left;
    transition: transform var(--transition-speed);
}

.feature-box:hover,
.feature-box:focus-within {
    transform: translateY(-4px);
}

.feature-box i {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

/* Cards / Generic Blocks */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--surface-color);
    transition: all var(--transition-speed);
    box-shadow: var(--shadow-sm);

    /* Added default shadow */
}

.card:hover,
.card:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;

    /* Cleaner hover state */
}

.card-body {
    padding: 2.25rem;
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    display: block;
    color: var(--accent-color);
}

.card-title {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.card-text {
    color: var(--muted-color);
}

.card-link {
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-bottom: none;
}

.card-link::after {
    content: '\f061';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    transition: transform var(--transition-speed);
}

.card-link:hover::after,
.card-link:focus::after {
    transform: translateX(2px);
}

/* Contact Cards */
.contact-card {
    transition: all var(--transition-speed);
}

.contact-card:hover,
.contact-card:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color) !important;
}

.contact-list li {
    transition: transform var(--transition-speed);
}

.contact-list li:hover {
    transform: translateX(2px);
}

/* Publications */
.publication-group {
    /* Padding/Margin handled by parent section */
    margin-bottom: 0;
    border-bottom: none;
}

.publication-group .group-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-color);
    margin-bottom: 2.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

.publication-item {
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    padding: 3rem 0;
    transition: transform var(--transition-speed), border-color var(--transition-speed);
}

.publication-item:last-child {
    border-bottom: none;
}

.publication-item:hover,
.publication-item:focus-within {
    transform: none;

    /* No movement, subtle color shift instead */
    border-color: var(--text-color);
}

.publication-item h4 {
    font-family: var(--font-heading);
    font-size: 1.8rem;

    /* Larger, more prominent */
    margin-bottom: 0.5rem;
    line-height: 1.3;
    transition: color var(--transition-speed);
}

.publication-item:hover h4 {
    color: var(--muted-color);

    /* Subtle interactive feedback */
}

.blog-post-item h4 a {
    color: var(--text-color);
}

.blog-post-item h4 a:hover,
.blog-post-item h4 a:focus {
    color: var(--muted-color);
}

.publication-item .publication-meta {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-color);

    /* Darker than muted for readability */
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.publication-abstract {
    margin-top: 1rem;
    color: var(--muted-color);
    font-size: 1.05rem;

    /* Slightly larger for reading */
    line-height: 1.8;
    max-width: 800px;

    /* Optimal reading width */
}

.blog-post-item {
    padding-left: clamp(1rem, 2vw, 1.5rem);
    padding-right: clamp(1rem, 2vw, 1.5rem);
}

.container-narrow.publication-media-list {
    max-width: min(1120px, 100%);
}

.publication-item--media {
    display: flex;
    align-items: flex-start;
    gap: clamp(2rem, 4vw, 4rem);
}

.publication-content {
    flex: 1 1 0;
    min-width: 0;
}

.publication-media {
    flex: 0 1 clamp(360px, 42%, 500px);
    max-width: 500px;
    order: 2;
}

.publication-media img {
    width: 100%;
    display: block;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    object-fit: cover;
    aspect-ratio: 4 / 3;
}

@media (max-width: 991.98px) {
    .publication-media {
        flex: 0 0 auto;
        order: 0;
        width: 100%;
        max-width: 480px;
    }

    .publication-item--media {
        flex-direction: column;
        align-items: stretch;
    }
}

.publication-category {
    margin-bottom: 2.5rem;
}

.publication-category h3 {
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-color);
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.focus-points {
    list-style: none;
    padding-left: 0;
    margin: 1.5rem 0 0;
    display: grid;
    gap: 0.75rem;
    color: var(--muted-color);
}




/* Alternating Publications */
.publications-wrapper section:nth-of-type(odd) {
    background-color: var(--surface-color);
}

.publications-wrapper section:nth-of-type(even) {
    background-color: transparent;
}

/* Fieldwork */
.fieldwork-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--surface-color);
    transition: transform var(--transition-speed);
}

.fieldwork-card:hover,
.fieldwork-card:focus-within {
    transform: var(--hover-lift);
}

.fieldwork-card.textual {
    background-color: var(--surface-color);
    border-radius: var(--radius-md);
}

.fieldwork-card.textual .fieldwork-content {
    padding: clamp(1.75rem, 4vw, 2.5rem);
}

.fieldwork-img {
    height: 220px;
    background-size: cover;
    background-position: center;
    filter: grayscale(30%);
    transition: transform var(--transition-speed), filter var(--transition-speed);
}

.fieldwork-card:hover .fieldwork-img,
.fieldwork-card:focus-within .fieldwork-img {
    transform: scale(1.04);
    filter: grayscale(0%);
}

.fieldwork-content {
    padding: 1.75rem;
}

.fieldwork-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.fieldwork-content p {
    margin-bottom: 0;
}

.fieldwork-list {
    list-style: none;
    padding-left: 0;
    margin: 1.25rem 0 0;
    display: grid;
    gap: 0.85rem;
    color: var(--muted-color);
}

.fieldwork-list li strong {
    color: var(--text-color);
}

/* Gallery */
.gallery-container {
    padding: 0.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    background-color: transparent;
    border: none;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.gallery-item:hover,
.gallery-item:focus-within {
    transform: translateY(-4px);
}

.gallery-img {
    height: 260px;
    background-size: cover;
    background-position: center;
    filter: grayscale(30%);
    transition: transform var(--transition-speed), filter var(--transition-speed);
}

.gallery-item:hover .gallery-img,
.gallery-item:focus-within .gallery-img {
    transform: scale(1.05);
    filter: grayscale(0%);
}

/* Gallery Mobile Responsiveness */
@media (max-width: 767.98px) {
    .gallery-container {
        padding: 0;
    }

    .gallery-item {
        margin-bottom: 1rem;
    }

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

@media (max-width: 575.98px) {
    .gallery-img {
        height: 180px;
    }

    .gallery-container .col-sm-6 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Contact */
.contact-info,
.contact-form {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2.25rem;
    height: 100%;
}

.contact-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--muted-color);
}

.contact-list li i {
    color: var(--accent-color);
    font-size: 1.1rem;
}

.form-label {
    font-weight: 500;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--muted-color);
}

.form-control {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 0.85rem 1rem;
    background-color: var(--bg-color);
    transition: all var(--transition-speed);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-control:focus {
    border-color: var(--accent-color);
    background-color: var(--surface-color);
    box-shadow: 0 0 0 4px var(--accent-light);
    outline: none;
}

/* Home */
.home-overview {
    background-color: var(--surface-color);
}

.home-focus {
    background-color: var(--bg-color);
}

.focus-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2.25rem;
    background-color: var(--surface-color);
}

.focus-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

.focus-card ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
    display: grid;
    gap: 0.85rem;
    color: var(--muted-color);
}

.focus-card li::before {
    content: '—';
    margin-right: 0.75rem;
    color: var(--accent-color);
}

.focus-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.focus-link i {
    font-size: 0.75rem;
    transition: transform var(--transition-speed);
}

.focus-link:hover i,
.focus-link:focus i {
    transform: translateX(3px);
}

.mobile-only {
    display: none;
}

.research-overview,
.research-projects,
.research-teaching,
.fieldwork-overview,
.fieldwork-footprint,
.publications-intro {
    background-color: var(--surface-color);
}

.research-pillars,
.fieldwork-grid,
.publications-list {
    background-color: var(--bg-color);
}

.research-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
    color: var(--muted-color);
}

.research-list li strong {
    color: var(--text-color);
}

.methods-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .methods-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.home-stats {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: var(--bg-color);
}

.stat-number {
    font-size: clamp(2rem, 3vw, 2.6rem);
    font-family: var(--font-heading);
}

.stat-label {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-color);
}

.home-featured {
    background-color: var(--bg-color);
}

.home-featured-talk {
    background-color: var(--surface-color);
}

.featured-talk-layout,
.fieldwork-layout {
    display: grid;
    gap: clamp(1.5rem, 4vw, 2.5rem);
    grid-template-columns: 1fr;
    grid-template-areas:
        "heading"
        "media"
        "body";
}

.featured-talk-layout > .featured-talk-heading,
.fieldwork-layout > .fieldwork-heading {
    grid-area: heading;
    margin-bottom: 0;
}

.featured-talk-layout > .featured-talk-body,
.fieldwork-layout > .fieldwork-body {
    grid-area: body;
    min-width: 0;
}

.featured-talk-layout > .featured-talk-media-col,
.fieldwork-layout > .fieldwork-media-col {
    grid-area: media;
    min-width: 0;
}

@media (min-width: 992px) {
    .featured-talk-layout,
    .fieldwork-layout {
        grid-template: "heading media" auto "body    media" 1fr / 1fr 1fr;
        gap: 0.5rem 3rem;
        align-items: start;
    }

    .featured-talk-layout > .featured-talk-media-col,
    .fieldwork-layout > .fieldwork-media-col {
        align-self: center;
    }
}

.featured-title {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}

.featured-meta {
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

.featured-context {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2.25rem;
    background-color: var(--surface-color);
}

.featured-context h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.featured-publication-media {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background-color: var(--surface-color);
}

.featured-publication-media img {
    width: 100%;
    height: auto;
    display: block;
}

.featured-talk-media {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background-color: var(--surface-color);
}

.featured-talk-media img {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 4 / 3;
}

.fieldwork-footprint .focus-link {
    margin-top: 1rem;
}

.home-fieldwork {
    background-color: var(--surface-color);
}

.home-contact {
    background-color: var(--bg-color);
}

.contact-cta {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: clamp(2rem, 6vw, 3rem);
    background-color: var(--surface-color);
}

.cta-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Page Header - Unified for all pages */
.page-header {
    background-color: var(--bg-color);
    padding: clamp(7rem, 10vw, 9rem) 0 clamp(2.5rem, 6vw, 4rem);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.page-header h1 {
    font-size: clamp(2.25rem, 4vw, 3rem);
    margin: 0 0 0.75rem;
    font-weight: 600;
}

.page-header .page-subtitle,
.page-header .lead {
    font-size: 1.125rem;
    color: var(--muted-color);
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.page-header .divider {
    margin: 1rem auto 1.5rem;
}

/* Footer */
.footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
}

.nav-link--cta {
    border-radius: 999px;
    padding: 0.45rem 1.1rem !important;
    color: var(--text-color) !important;
    background-color: var(--nav-cta-fill);
    border: 1px solid var(--nav-cta-ring);
    box-shadow: 0 0 0 2px var(--nav-cta-ring);
}

.nav-link--cta::after {
    display: none;
}

.nav-link--cta:hover,
.nav-link--cta:focus {
    background-color: var(--accent-light);
    color: var(--text-color) !important;
}

.footer a {
    color: var(--text-color);
    border-bottom: 1px solid transparent;
}

.footer a:hover,
.footer a:focus {
    color: var(--text-color);
    border-bottom-color: var(--text-color);
}

.footer p {
    color: var(--text-color);
    margin-bottom: 0;
}

.footer-back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform var(--transition-speed), background-color var(--transition-speed);
    font-size: 1rem;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
}

.back-to-top:hover,
.back-to-top:focus {
    transform: translateY(-3px);
    background-color: #000;
    color: #fff;
}

.back-to-top.active {
    opacity: 1;
    pointer-events: auto;
}

/* Utilities */
.text-muted {
    color: var(--muted-color) !important;
}

.text-primary {
    color: var(--text-color) !important;
}

.spinner-border {
    color: var(--text-color);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container-narrow {
    max-width: 880px;
}

.section-subtitle {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted-color);
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
}

#publications-loading[hidden] {
    display: none !important;
}

/* Animation */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Home Focus Section Image */
.focus-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.focus-profile-image {
    max-width: 350px;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: var(--radius-md);
}

/* Responsive */
@media (max-width: 991.98px) {
    #mainNav {
        padding: 1rem 0;
    }

    .nav-link {
        padding: 0.75rem 0 !important;
    }

    .profile-card {
        align-items: center;
        text-align: center;
    }

    .profile-card .social-icons {
        justify-content: center;
    }

    .hero {
        min-height: unset;
        padding: 6rem 0 4rem;
    }

    .hero p {
        margin-left: 0;
        margin-right: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-cta {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1.25rem;
    }

    .hero {
        padding-top: 5rem;
    }

    .hero h1 {
        font-size: 2.3rem;
    }

    .hero .text-center {
        text-align: center !important;
    }

    .hero p {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .profile-img {
        width: 150px;
        height: 150px;
    }

    .gallery-img {
        height: 220px;
    }

    .back-to-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 44px;
        height: 44px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   BLOG PAGE
   ======================================== */

.blog-posts {
    padding-top: 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.blog-card {
    background-color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    height: 100%;

    /* Ensure uniform height in grid */
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: var(--hover-lift);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}


.blog-card-content {
    padding: 1.75rem;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--muted-color);
}

.blog-meta time {
    font-weight: 500;
}

.blog-category {
    background-color: var(--bg-color);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-card h2 {
    font-size: 1.375rem;
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.blog-card h2 a {
    color: var(--text-color);
    border-bottom: none;
}

.blog-card h2 a:hover {
    color: var(--muted-color);
}

.blog-excerpt {
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--text-color);
    padding-bottom: 2px;
}

.blog-read-more i {
    font-size: 0.75rem;
    transition: transform var(--transition-speed);
}

.blog-read-more:hover i {
    transform: translateX(4px);
}

.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    font-style: italic;
    color: var(--muted-color);
}

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

/* ========================================
   ABOUT PAGE REWORK (Elegant / Fluid)
   ======================================== */

.bio-content-section {
    /* Background handled by global alternating rules */
    padding: clamp(3rem, 6vw, 4rem) 0 clamp(6rem, 12vw, 10rem);
}

/* Fluid Layout */
.bio-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: clamp(4rem, 8vw, 6rem);
    align-items: start;
}

@media (max-width: 991.98px) {
    .bio-grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    /* Flatten styling wrappers to reorder children */
    .bio-text,
    .bio-sidebar {
        display: contents;
    }

    /* Reorder for Mobile */
    .bio-image-container {
        order: 1;
    }

    .bio-main-content {
        order: 2;
    }

    .education-section {
        order: 3;
    }

    .cv-download-btn {
        order: 4;
    }

    .bio-social-links {
        order: 5;
    }

    /* Ensure text styling persists since display:contents strips container styles */
    .bio-main-content {
        font-size: 1.15rem;
        line-height: 1.8;
        color: var(--text-color);
    }
}

/* Typography Focused Content */
.bio-text {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-color);
    max-width: 65ch;
}

.bio-text p {
    margin-bottom: 2rem;
}

.bio-lead {
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--text-color);
    margin-bottom: 2.5rem;
    font-family: var(--font-heading);
}

/* Integrated Image (Circular) */
.bio-image-container {
    position: relative;
    margin-bottom: 3rem;
    text-align: center;
}

.bio-image {
    width: 280px;
    height: 280px;
    border-radius: 50%;

    /* Circle */
    object-fit: cover;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    filter: grayscale(20%);
    transition: filter 0.6s ease, transform 0.6s ease;
}

.bio-image:hover {
    filter: grayscale(0%);
    transform: scale(1.02);
}

.bio-caption {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--muted-color);
    font-style: italic;
}

/* Sidebar Container */
.bio-sidebar {
    position: relative;
}

/* Education Timeline */
.education-section {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.education-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--muted-color);
    margin-bottom: 1.5rem;
}

.education-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.education-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: padding-left 0.3s ease, border-bottom-color 0.3s ease;
}

.education-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.education-item:hover {
    padding-left: 0.5rem;
    border-bottom-color: var(--accent-color);
}

.edu-degree {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: 600;
}

.edu-school {
    font-size: 0.9rem;
    color: var(--muted-color);
}

/* .cv-download-btn used for animation selection only, styling via Bootstrap classes */

/* Bio Social Links */
.bio-social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.bio-social-links .social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.bio-social-links .social-link:hover {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.bio-social-links .social-link i {
    font-size: 1rem;
}

/* -------------------------------------------------------------------------- */

/*                               Loading States                               */

/* -------------------------------------------------------------------------- */

/* Prevent interaction while loading */
.wp-is-loading body {
    pointer-events: none;
}

/* Base opacity for dynamic sections */

/* Base state: Hidden by default (Wait for JS) */
.bio-content-section,
.bio-header .bio-title,
.bio-header .bio-subtitle,
.bio-sidebar,
.hero h1,
.hero p,
.hero-actions,
.hero-photo,
.home-overview,
.home-focus,
.entry-title,
.entry-meta,
.entry-location,
.entry-date {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

/* Revealed state: When JS is loaded */
.wp-content-loaded .bio-content-section,
.wp-content-loaded .bio-header .bio-title,
.wp-content-loaded .bio-header .bio-subtitle,
.wp-content-loaded .bio-sidebar,
.wp-content-loaded .hero h1,
.wp-content-loaded .hero p,
.wp-content-loaded .hero-actions,
.wp-content-loaded .hero-photo,
.wp-content-loaded .home-overview,
.wp-content-loaded .home-focus,
.wp-content-loaded .entry-title,
.wp-content-loaded .entry-meta,
.wp-content-loaded .entry-location,
.wp-content-loaded .entry-date {
    opacity: 1;
}

/* Fallback: If JS fails or is slow, show content after 3s (optional failsafe, handled by JS removing class) */

/* Ideally relying on wp-content-loaded class added by JS */

/* Optional: When loaded, ensure they are visible (redundant but explicit) */
.wp-content-loaded .bio-content-section,
.wp-content-loaded .bio-header .bio-title,
.wp-content-loaded .bio-header .bio-subtitle,
.wp-content-loaded .bio-sidebar {
    opacity: 1;
}

/* Ensure no layout shift for the main container if possible */
.bio-content-section {
    min-height: 50vh;
}

/* -------------------------------------------------------------------------- */

/*                            Fieldwork - Single Entry                        */

/* -------------------------------------------------------------------------- */

.fieldwork-entry-main {
    background-color: var(--white);
}

/* Entry Hero */
.entry-hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    background-color: var(--black);
    color: var(--white);
    overflow: hidden;
}

.entry-hero-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.entry-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.entry-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 2;
}

.entry-hero .container {
    position: relative;
    z-index: 3;
}

.entry-meta {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.9;
    color: var(--white);

    /* White text for visibility on overlay */
}

/* Explicit white for children */
.entry-location,
.entry-date,
.entry-category {
    color: #fff !important;
}

.entry-title {
    font-family: var(--font-heading);
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Entry Content */
.entry-content-section {
    background-color: var(--white);
}


/* Centered Story Layout */
.fieldwork-story-row {
    position: relative;
    padding-bottom: 10rem;
}

.entry-text-column {
    /* No sticky needed for single column */
    position: relative;
}

.entry-body {
    font-size: 1.25rem;

    /* Larger, more readable */
    line-height: 1.8;
    color: var(--text-color);
}

.entry-body p {
    margin-bottom: 2rem;
    max-width: 65ch;

    /* Optimal reading width */
    margin-left: auto;
    margin-right: auto;
}

/* Injected Gallery Items */
.gallery-stream-item {
    margin: 4rem auto;

    /* Generous spacing */
    width: 100%;
    max-width: 100%;

    /* Can go wider than text if desired, or match col */
    position: relative;
    overflow: hidden;
}

.gallery-link {
    display: block;
    position: relative;
    overflow: hidden;

    /* Aspect ratio could be enforced here if needed */
}

.gallery-link img {
    width: 100%;
    height: auto;
    display: block;

    /* Initial state handled by JS */
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);

    /* Subtle dim */
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.gallery-link:hover .gallery-overlay {
    opacity: 1;
}

/* Gallery Grid */
.entry-gallery .gallery-item {
    display: block;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.entry-gallery .gallery-item:hover {
    transform: translateY(-5px);
}

.entry-gallery img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    color: var(--accent-color);
    font-family: var(--font-heading);
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.btn-back:hover {
    color: var(--accent-hover);
    transform: translateX(-5px);
}

/* -------------------------------------------------------------------------- */

/*                          Fieldwork (Expandable Diary)                      */

/* -------------------------------------------------------------------------- */

/* Grid Layout */
.fieldwork-grid-section {
    padding: 2rem 0;
}

.fieldwork-diary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.fieldwork-item {
    cursor: pointer;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.3s ease;
    opacity: 0;

    /* Hidden initially to prevent flash before GSAP */
}

.fieldwork-item-inner {
    position: relative;
    background: var(--surface-color);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.f-image-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.f-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.fieldwork-item:hover .f-image {
    transform: scale(1.05);

    /* Gentle zoom on hover */
}

.f-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.f-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-color);
    margin-bottom: 0.5rem;
}

.f-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.f-summary {
    font-size: 0.95rem;
    color: var(--text-color);
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.f-read-more {
    margin-top: 1rem;
    background: none;
    border: none;
    padding: 0;
    color: var(--accent-color);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
    cursor: pointer;
}

/* Detail View (Fixed Overlay) */
.fieldwork-detail-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    z-index: 2000;
    overflow-y: auto;

    /* Hidden by default, managed by GSAP */
    visibility: hidden;
    opacity: 1;

    /* GSAP will handle */
}

.close-detail-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 2010;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: background 0.2s;
}

/* Detail Header (Hero) */
.detail-header {
    height: 60vh;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.detail-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.detail-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-title-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 4rem 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: white;
}

.detail-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 0.5rem;
}

.detail-meta {
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.9;
}

/* Detail Body */
.detail-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem 8rem;
}

.detail-diary-entry {
    font-size: 1.15rem;
    line-height: 1.8;
}

.detail-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 4rem;
}

.detail-gallery-grid img {
    width: 100%;
    border-radius: 4px;
    transition: transform 0.2s;
}

.detail-gallery-grid img:hover {
    transform: scale(1.02);
}

/* -------------------------------------------------------------------------- */

/*                            Fieldwork Story Layout                          */

/* -------------------------------------------------------------------------- */

.fieldwork-story-row {
    position: relative;
    align-items: flex-start;

    /* Important for parallax/pinning */
}

.gallery-stream-wrapper {
    position: relative;

    /* Optional: Sticky top to keep it in view if text is short */
}

.gallery-stream-item {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.gallery-stream-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.gallery-link {
    display: block;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-link:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    color: white;
    font-size: 1.5rem;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gallery-link:hover .gallery-overlay i {
    transform: scale(1);
}

/* Typography Enhancements for Story */
.entry-body {
    font-size: 1.15rem;
    line-height: 1.8;
}

.entry-body p:first-of-type::first-letter {
    font-size: 3.5rem;
    float: left;
    margin-right: 1rem;
    line-height: 0.8;
    font-family: var(--font-heading);
    color: var(--accent-color);
}

.entry-body img,
.entry-body video,
.entry-body iframe {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.entry-body figure {
    margin: 2rem 0;
}

.entry-body table {
    width: 100%;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
}

/* Contact Animation */
.contact-animation-container {
    position: relative;
    width: 100%;
    min-height: 300px;

    /* Ensure space is reserved */
    overflow: hidden;
}

.contact-animation-container svg {
    width: 100%;
    height: auto;
    max-height: 100%;
    overflow: visible;
}

/* Share Functionality */
.post-share-section {
    display: flex;
    justify-content: center;
    align-items: center;
}

#native-share-btn {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: transform var(--transition-speed), background-color var(--transition-speed);
}

#native-share-btn:hover {
    transform: translateY(-2px);
}

.social-share-links {
    align-items: center;
}

.share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    transition: all var(--transition-speed);
    text-decoration: none;
}

.share-icon:hover,
.share-icon:focus {
    transform: translateY(-2px);
    border-color: var(--accent-color);
    background-color: var(--accent-color);
    color: #fff;
}

/* Fieldwork entry uses light buttons on dark background */
.fieldwork-entry-main .share-icon {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.fieldwork-entry-main .share-icon:hover,
.fieldwork-entry-main .share-icon:focus {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.9);
    color: var(--text-color);
}

/* -------------------------------------------------------------------------- */

/*                              Mobile Optimization                           */

/* -------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
    #mainNav .navbar-collapse {
        background-color: rgba(255, 255, 255, 0.98);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: 0.75rem 1rem 1rem;
        margin-top: 0.75rem;
        box-shadow: var(--shadow-md);
        transition: height 0.35s ease, opacity 0.18s ease, padding 0.28s ease, margin-top 0.28s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    }

    #mainNav .navbar-collapse.nav-collapse-closing {
        opacity: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
        border-color: transparent;
        box-shadow: none;
    }

    #mainNav .navbar-nav {
        gap: 0.35rem;
    }

    #mainNav .nav-link {
        width: 100%;
        border-radius: 999px;
        padding: 0.65rem 0.85rem !important;
    }

    #mainNav .nav-link::after {
        display: none;
    }

    #mainNav .nav-link.active {
        background-color: var(--accent-light);
    }

    #mainNav .nav-link--cta {
        margin-top: 0.35rem;
    }
}

@media (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1.15rem;
    }

    .hero-logo-slot {
        display: flex;
        justify-content: center;
        margin-top: -1rem;
        margin-bottom: 0.75rem;
    }

    .hero-logo-slot .logo-animation-container {
        max-width: 200px;
        max-height: 240px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        display: inline-flex;
        justify-content: center;
    }

    .cta-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .blog-meta {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }

    .fieldwork-diary-grid {
        grid-template-columns: 1fr;
    }

    .f-content {
        padding: 1.25rem;
    }

    .f-title {
        font-size: 1.3rem;
    }

    .gallery-img {
        height: 210px;
    }
}

@media (max-width: 575.98px) {
    section {
        padding: 2.5rem 0;
    }

    .container,
    .container-fluid {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .page-header {
        padding: 5.5rem 0 2.5rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header .page-subtitle,
    .page-header .lead {
        font-size: 1rem;
    }

    .section-heading {
        font-size: 1.75rem;
    }

    .divider {
        width: 48px;
        margin-bottom: 1.5rem;
    }

    .card-body,
    .feature-box,
    .focus-card,
    .featured-context,
    .contact-info,
    .contact-form,
    .contact-cta,
    .profile-card {
        padding: 1.5rem;
    }

    .stat {
        padding: 1.25rem;
    }

    .stats-grid {
        gap: 1rem;
    }

    .publication-item {
        padding: 2rem 0;
    }

    .publication-item h4 {
        font-size: 1.4rem;
    }

    .publication-abstract {
        font-size: 1rem;
    }

    .fieldwork-img {
        height: 180px;
    }

    .gallery-img {
        height: 200px;
    }

    .blog-card-content {
        padding: 1.5rem;
    }

    .blog-card h2 {
        font-size: 1.2rem;
    }

    .blog-excerpt {
        font-size: 0.9rem;
    }

    .blog-post-header h1 {
        font-size: clamp(1.9rem, 7vw, 2.6rem);
    }

    .blog-post-header .blog-post-meta {
        font-size: 0.75rem;
        letter-spacing: 0.08em;
    }

    .entry-content-section {
        padding-top: 2.5rem !important;
        padding-bottom: 3.5rem !important;
    }

    .entry-hero {
        height: 45vh;
        min-height: 260px;
    }

    .entry-title {
        font-size: clamp(1.9rem, 7vw, 2.6rem);
    }

    .entry-meta {
        font-size: 0.85rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .entry-body {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    .entry-body p:first-of-type::first-letter {
        font-size: 2.6rem;
        margin-right: 0.6rem;
    }

    .bio-content-section {
        padding: 2.5rem 0 5rem;
    }

    .bio-text {
        font-size: 1.05rem;
    }

    .bio-lead {
        font-size: 1.2rem;
    }

    .bio-image {
        width: 220px;
        height: 220px;
    }

    .fieldwork-story-row {
        padding-bottom: 5rem;
    }

    .gallery-stream-item {
        margin: 2.5rem auto;
    }

    .detail-title-wrapper {
        padding: 2.5rem 1.5rem;
    }

    .detail-title {
        font-size: clamp(2rem, 7vw, 2.8rem);
    }

    .detail-body {
        padding: 2.5rem 1.25rem 5rem;
    }

    .detail-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        margin-top: 2.5rem;
    }

    .close-detail-btn {
        top: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.5rem;
    }

    .footer {
        text-align: center;
    }

    .footer .text-lg-start,
    .footer .text-lg-end {
        text-align: center !important;
    }

    .footer-back-to-top {
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .navbar-brand {
        font-size: 1.05rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-photo {
        max-height: 220px;
    }
}
