/* Staff Profile Styles */
:root {
    --mint-border: #e6f3f0;
    --primary-color: #00875A;
    --primary-gradient: linear-gradient(90deg,#00986a,#00b07f);
    --text-dark: #1A1A1A;
    --text-light: #4A5568;
    --background: #FFFFFF;
    --border-light: #E2E8F0;
    --muted: #6B7280;
}

/* Profile Card & Layout */
.staff-profile {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Make the outer container fluid on very large screens */
@media (min-width: 1600px) {
    .staff-profile {
        max-width: 1400px;
    }
}

.staff-card {
    background: var(--background);
    border-radius: 16px;
    border: 1px solid var(--mint-border);
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(9,30,40,0.06);
}

/* Header Container */
.staff-header-container {
    background: var(--background);
    border-bottom: 2px solid var(--mint-border);
    padding-bottom: 0;
}

.staff-card-content {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    padding: 2rem;
}

/* Tabs Section Container */
.staff-tabs-section {
    background: #ffffff;
    padding: 1.5rem 0;
}

/* Adjust layout for medium screens */
@media (max-width: 1024px) {
    .staff-card-content {
        grid-template-columns: 1fr 1.1fr;
        gap: 1.25rem;
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .staff-card-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .staff-image {
        margin: 0 auto;
    }

    .staff-tabs-section {
        padding: 1rem 0;
    }

    .staff-tabs {
        gap: 0.75rem;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem 0.5rem;
        max-width: 100%;
        justify-content: flex-start;
        margin: 0 1rem;
    }

    .staff-tabs::-webkit-scrollbar {
        display: none;
    }
}

/* Profile Image */
.staff-image {
    width: 200px;
    height: 240px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(11,34,25,0.06);
    border: 4px solid rgba(0,135,90,0.06);
}

.staff-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Profile Info */
.staff-info {
    padding: 1rem 0;
}

.staff-info h1 {
    color: var(--color1);
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.staff-title {
    color: var(--text-dark);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.staff-type {
    display:inline-block;
    margin-left:0.35rem;
    padding: 0.15rem 0.5rem;
    background: rgba(0,135,90,0.06);
    color: var(--color1);
    font-size: 0.85rem;
    border-radius: 999px;
    vertical-align: middle;
    font-weight:600;
}

.staff-department {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
}

/* Navigation Tabs (centered card with bordered tabs) */
.staff-tabs {
    display: flex;
    justify-content: center; /* center the group */
    padding: 0.75rem;
    gap: 0.75rem;
    margin: 0 auto; /* center horizontally */
    max-width: 760px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: #ffffff;
}

/* Allow wrapping of tabs on narrow widths and improve scrolling */
@media (max-width: 640px) {
    .staff-tabs {
        justify-content: flex-start;
        gap: 0.4rem;
        padding: 0.45rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    .tab-item {
        white-space: nowrap;
        padding: 0.32rem 0.6rem;
        font-size: 0.92rem;
    }
}

.tab-item {
    color: var(--text-light);
    font-weight: 600;
    /* slightly smaller pill for all views */
    padding: 0.32rem 0.7rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.22s ease;
    border: 1px solid;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    box-shadow: none;
    min-height: 36px;
}

.tab-item:hover {
    color: var(--color1);
    border-color: var(--color1);
}

.tab-item.active {
    color: #fff;
  background: var(--color1);
  border-color: var(--color1);
  box-shadow: 0 4px 12px rgba(0, 135, 90, 0.2);
}

/* Visible focus styles for keyboard users */
.tab-item:focus {
    outline: none; /* prefer focus-visible for browsers that support it */
}


/* Content Sections */
.staff-content {
    padding: 2rem;
    border-top: 1px solid var(--border-light);
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.content-section:first-child {
    display: block;
}

/* About Section */
.about-section {
    color: var(--text-light);
    line-height: 1.8;
    font-size: 1rem;
}

.content-section h3 {
    color: var(--text-dark);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

/* Research Interests */
.research-interests h3 {
    color: var(--text-dark);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.research-interests ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    color: var(--text-light);
    line-height: 1.8;
}

/* Publications */
.publications-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.publications-list li {
    padding: 0;
    border-bottom: none;
    margin: 0;
}

.publications-list li:last-child {
    border-bottom: none;
}

.publications-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color1);
    background: linear-gradient(var(--color5));
    text-decoration: none;
    transition: all 0.3s ease;
    line-height: 1.5;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid var(--color1);
}

.publications-list a:hover {
   background: linear-gradient(90deg, var(--color1), var(--color1));
   color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 135, 90, 0.15);
}

.publications-list a::after {
    content: "↗";
    font-size: 0.9em;
    font-weight: 600;
}

/* Get in Touch Section */
.get-in-touch {
    text-align: center;
    padding: 3rem;
    background: linear-gradient(var(--color5));
    border-radius: 16px;
    margin: 2rem 0;
}

.get-in-touch h2 {
    color: var(--color1);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.get-in-touch p {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

/* Contact Methods Grid */
.contact-info {
    margin: 2rem 0;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-method {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 135, 90, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.contact-method:hover {
    background: rgba(0, 135, 90, 0.04);
    background: linear-gradient(var(--color5));
    box-shadow: 0 6px 16px rgba(0, 135, 90, 0.08);
}

.contact-detail {
    flex: 1;
}

.contact-label {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
}

.contact-link {
    color: var(--color1);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    word-break: break-word;
}

.contact-link:hover {
    text-decoration: underline;
}

.contact-text {
    color: var(--text-light);
    line-height: 1.5;
    font-size: 0.95rem;
}

.contact-action {
    text-align: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
    margin-top: -2rem;
    border-top: 1px solid rgba(0, 135, 90, 0.1);
    background-color: #fff;
}

.contact-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--color1);
    color: var(--background);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.contact-button:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 22px rgba(2, 70, 45, 0.12);
}

/* Responsive contact methods */
@media (max-width: 768px) {
    .contact-methods {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .contact-method {
        padding: 1rem;
    }
    .contact-icon {
        font-size: 1.5rem;
    }
    .contact-button {
        width: 100%;
        padding: 0.9rem 1.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .staff-profile {
        padding: 0 1rem;
    }

    .staff-card-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }

    .staff-image {
        margin: 0 auto;
    }

    .staff-tabs {
        gap: 0.75rem;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem 0.5rem;
        max-width: 100%;
        justify-content: flex-start;
    }

    /* show a thin, touch-friendly scrollbar for tabs on mobile */
    .staff-tabs {
        scrollbar-width: thin;
        scrollbar-color: rgba(0,0,0,0.18) transparent;
    }
    .staff-tabs::-webkit-scrollbar { height: 7px; }
    .staff-tabs::-webkit-scrollbar-track { background: transparent; }
    .staff-tabs::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 999px; }

    .get-in-touch {
        margin: 1rem;
        padding: 2rem;
    }

    /* Stack contact info on small screens */
    .contact-info dl {
        grid-template-columns: 1fr;
        gap: 0.35rem 0.5rem;
        text-align: left;
    }
    .contact-info dt {
        font-size: 0.9rem;
    }
    .contact-info dd {
        font-size: 0.95rem;
    }
}

/* Very small screens adjustments */
@media (max-width: 420px) {
    .staff-image {
        width: 160px;
        height: 200px;
    }
    .staff-info h1 {
        font-size: 1.25rem;
    }
    .staff-card-content {
        padding: 1rem;
    }
    .staff-content {
        padding: 1rem;
    }
    .tab-item {
        padding: 0.28rem 0.5rem;
        font-size: 0.88rem;
    }
}

/* Desktop density tweaks */
@media (min-width: 1200px) {
    .staff-card {
        border-radius: 18px;
    }
    .staff-card-content {
        padding: 2.5rem;
    }
}

/* Breadcrumbs */
.staff-breadcrumbs {
    max-width: 100%;
    margin: 0.75rem 0 0 0;
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    background: linear-gradient(var(--color5));
    border-bottom: 1px solid var(--mint-border);
    margin-bottom: 1.5rem;
}

.staff-breadcrumbs a {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.staff-breadcrumbs a:hover {
    color: var(--color1);
}

.staff-breadcrumbs .divider {
    margin: 0 0.25rem;
    color: var(--color1);
    font-weight: 300;
    opacity: 0.6;
}

.staff-breadcrumbs .current {
    color: var(--color1);
    font-weight: 700;
    padding: 0.5rem 0.75rem;
}

/* Responsive breadcrumbs */
@media (max-width: 768px) {
    .staff-breadcrumbs {
        margin-bottom: 0.25rem;
    }
    .staff-breadcrumbs a,
    .staff-breadcrumbs .current {
        padding: 0.35rem 0.5rem;
    }
    .staff-breadcrumbs .divider {
        margin: 0 0.15rem;
    }
}

/* Compact, single-line breadcrumbs on very small screens while keeping
   the existing visual design (background + border). This reduces padding
   and gaps, prevents wrapping, and allows horizontal scrolling with
   truncated labels so the breadcrumb stays on a single line. */
@media (max-width: 480px) {
    .staff-breadcrumbs {
        padding: 0.35rem 0.6rem; /* slightly smaller padding */
        font-size: 0.84rem;
        gap: 0.12rem; /* tighten gaps between items */
        flex-wrap: nowrap; /* force single line */
        white-space: nowrap;
        overflow-x: auto; /* allow horizontal scroll when long */
        -webkit-overflow-scrolling: touch;
        align-items: center;
        /* keep the existing background and border for design consistency */
    }

    /* hide native scrollbar for a cleaner look where supported */
    .staff-breadcrumbs::-webkit-scrollbar { display: none; }
    .staff-breadcrumbs { scrollbar-width: none; }

    /* Make each link compact and truncate long text with ellipsis */
    .staff-breadcrumbs a,
    .staff-breadcrumbs .current {
        display: inline-block;
        padding: 0.18rem 0.36rem; /* tighter padding */
        max-width: 60vw; /* limit width so current/links truncate */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        border-radius: 6px;
    }

    .staff-breadcrumbs .divider {
        margin: 0 0.12rem;
    }

    /* Slightly reduce emphasis on the current item while keeping its color */
    .staff-breadcrumbs .current {
        padding-left: 0.28rem;
        padding-right: 0.28rem;
    }
}

/* Arrow-style list marker for Qualifications, Teaching, Research areas, etc. */
/* Use <ul class="profile-arrow-list"> or rely on direct ul children of .content-section (except .publications-list) */
.content-section > ul:not(.publications-list),
.content-section ul.profile-arrow-list {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
}

.content-section > ul:not(.publications-list) li,
.content-section ul.profile-arrow-list li {
    margin: 0.5rem 0;
    padding: 0;
    display: flex;
    align-items: flex-start;
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 1rem;
}

.content-section > ul:not(.publications-list) li::before,
.content-section ul.profile-arrow-list li::before {
    content: "→";
    margin-right: 0.6rem;
    color: var(--color1);
    font-weight: 600;
    display: inline-block;
    line-height: 1;
}

/* Keep nested lists compact and readable */
.content-section ul.profile-arrow-list ul,
.content-section > ul:not(.publications-list) ul {
    margin-top: 0.25rem;
    padding-left: 0.6rem;
}