@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@300;400;700&display=swap');

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

/* Base Styles */
body {
    font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
    color: #3f454a;
    background-color: #ffffff;
    line-height: 1.5;
}

html, body {
    overflow-x: hidden;
}

/* Typography Overrides */
h1, h2, h3, h4, h5, h6 {
    font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-weight: 700;
    color: #3f454a;
}

.font-serif {
    font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
}

.font-sans {
    font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
}

/* Glassmorphism Navigation */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.nav-item {
    position: relative;
    font-weight: 500;
    color: #475569; /* slate-600 */
    transition: color 0.2s;
}

.nav-item:hover {
    color: #1e293b; /* slate-800 */
}

.nav-item::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: #d4a562; /* accent */
    transition: width 0.3s ease;
}

.nav-item:hover::after {
    width: 100%;
}

/* Hero Section */
.profile-image-container {
    position: relative;
    z-index: 10;
}

/* Section Styling */
section {
    position: relative;
}

.section-header h2 {
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 40%;
    height: 3px;
    background-color: rgba(212, 165, 98, 0.3); /* accent with opacity */
    z-index: -1;
}

/* Main Layout Grid */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.profile-column,
.content-column {
    min-width: 0;
    max-width: 100%;
}

@media (min-width: 1024px) {
    .grid-layout {
        grid-template-columns: 320px 1fr;
        gap: 4rem;
        align-items: start;
    }
}

/* Cards */
.news-card, .research-card, .contact-card {
    transition: all 0.3s ease;
}

.news-card:hover, .research-card:hover, .contact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1; /* slate-300 */
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Utility */
.text-accent {
    color: #d4a562;
}

.bg-accent {
    background-color: #d4a562;
}

.border-accent {
    border-color: #d4a562;
}

.hover\:text-accent:hover {
    color: #d4a562;
}

/* Research Highlights (Accordion/Details Style if needed, but using clean list for now) */
details summary {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: justify;
}

/* New Publication List Styles */
.pub-year-group {
    margin-bottom: 1.4rem;
}

.pub-year-header {
    font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-size: 1.18rem;
    font-weight: 700;
    font-style: normal;
    letter-spacing: 0;
    color: #3f454a;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e6e8eb;
    padding-bottom: 0.2rem;
    display: inline-block;
}

.pub-list-ul {
    list-style-type: disc;
    padding-left: 1.5rem;
}

.pub-list-item {
    margin-bottom: 0.8rem;
    line-height: 1.45;
}

.pub-line-1 {
    font-size: 0.95rem;
    margin-bottom: 0.08rem;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.24rem 0.42rem;
}

.pub-venue-tag {
    display: inline-block;
    padding: 0.06rem 0.32rem;
    border: 0;
    border-radius: 2px;
    background: #00369f;
    color: #ffffff;
    font-family: "Courier New", Courier, monospace;
    font-weight: 700;
    font-size: 0.7rem;
    line-height: 1.25;
    letter-spacing: 0;
    text-transform: uppercase;
    box-shadow: none;
    vertical-align: baseline;
}

.pub-title-text {
    min-width: 0;
    font-weight: 600;
    color: #224b8d;
    overflow-wrap: anywhere;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.pub-link-btn {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #475569;
    margin-left: 0;
    text-decoration: none;
    transition: all 0.2s;
    vertical-align: middle;
    background-color: white;
}

.pub-link-btn:hover {
    border-color: #d4a562;
    color: #d4a562;
    background-color: #fffbeb;
}

.tag-arxiv {
    background: #e9edf4;
    color: #224b8d;
}

.tag-conference {
    background: #00369f;
    color: #ffffff;
}

.pub-title-link {
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.pub-title-link:hover {
    color: #d4a562; /* accent */
    border-bottom-color: #d4a562;
}

.pub-line-2 {
    font-size: 0.92rem;
    color: #494e52;
    margin-bottom: 0.04rem;
}

.pub-line-2 strong, .pub-line-2 b {
    color: #3f454a;
    font-weight: 700;
}

.pub-line-3 {
    font-size: 0.9rem;
    color: #494e52;
    font-style: normal;
}

/* Publication Card Typography (Legacy/Unused for now) */
.pub-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b; /* primary */
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.pub-authors {
    font-size: 0.95rem;
    color: #64748b; /* muted */
    margin-bottom: 0.5rem;
}

.pub-venue {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b; /* muted */
    margin-bottom: 1rem;
    font-style: italic;
}

.pub-highlight {
    font-size: 0.85rem;
    color: #d97706; /* amber-600 */
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Publication CCF Ranks and Badges */
.pub-badge-highlight {
    display: inline-block;
    background-color: #ef4444; /* Red */
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    vertical-align: middle;
    line-height: 1.2;
}

.ccf-rank {
    display: inline-block;
    padding: 0.06rem 0.32rem;
    border-radius: 2px;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.7rem;
    font-style: italic;
    font-weight: 700;
    line-height: 1.25;
    vertical-align: baseline;
}

.ccf-a {
    color: #b91c1c;
    background: #fff1f2;
    border: 1px solid #fecdd3;
}

.ccf-b {
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.ccf-c {
    color: #15803d;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.publication:hover {
    border-color: #d4a562; /* accent */
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.visitor-map-widget {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 72px;
    max-width: 200px;
    margin: 0 auto;
    overflow: hidden;
}

.visitor-map-widget img,
.visitor-map-widget iframe,
.visitor-map-widget canvas,
.visitor-map-widget a {
    max-width: 180px !important;
}

.visitor-map-fallback {
    color: #7a8288;
    font-size: 0.8rem;
    text-align: center;
}

.visitor-map-placeholder {
    color: #7a8288;
    font-size: 0.8rem;
    text-align: center;
}

.visitor-map-fallback {
    display: grid;
    gap: 0.25rem;
    justify-items: center;
    text-decoration: none;
}

.visitor-map-fallback-globe {
    display: grid;
    place-items: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    border: 1px solid #e2c38d;
    background: radial-gradient(circle at 35% 30%, #fff7df 0, #ead19e 65%, #d4a562 100%);
    color: #8a5a17;
    font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-size: 1.8rem;
    line-height: 1;
}

/* Venue Logo - Hidden for Text-Only Style */
.venue-logo {
    display: none;
}

/* News Item Dashed Line */
.news-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1.5rem;
    align-items: baseline;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #e2e8f0;
}

.news-date {
    font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #494e52;
    white-space: nowrap;
}

.news-content {
    font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-size: 0.95rem;
    color: #494e52;
    line-height: 1.5;
    min-width: 0;
    overflow-wrap: break-word;
}

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

/* Standalone archive pages */
.archive-page {
    min-height: 100vh;
    background: #ffffff;
}

.archive-nav {
    position: sticky;
    top: 0;
    z-index: 50;
}

.archive-nav-inner {
    width: 100%;
    max-width: 1120px;
    height: 4.5rem;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.archive-brand {
    color: #1e293b;
    font-size: 1.35rem;
    font-weight: 700;
    text-decoration: none;
}

.archive-nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.archive-nav-links a {
    color: #475569;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
}

.archive-nav-links a:hover {
    color: #d4a562;
}

.archive-main {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 3.25rem 1rem 4rem;
}

.archive-shell {
    display: grid;
    gap: 1.4rem;
}

.archive-kicker {
    min-height: 1.5rem;
}

.archive-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #d4a562;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
}

.archive-back-link:hover {
    color: #b88a4d;
}

.archive-header {
    border-bottom: 1px solid #e6e8eb;
    padding-bottom: 1.25rem;
}

.archive-header h1 {
    position: relative;
    display: inline-block;
    margin: 0;
    color: #1e293b;
    font-size: 2.25rem;
    line-height: 1.15;
}

.archive-header h1::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0.05rem;
    width: 46%;
    height: 0.22rem;
    background-color: rgba(212, 165, 98, 0.3);
    z-index: -1;
}

.archive-header p {
    margin: 0.55rem 0 0;
    max-width: 44rem;
    color: #64748b;
    font-size: 1rem;
}

.archive-panel {
    min-width: 0;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 40px -28px rgba(15, 23, 42, 0.32);
    overflow: hidden;
}

.news-archive-page .archive-news-list {
    display: grid;
    gap: 0;
}

.news-archive-page .news-item {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid #eef0f3;
}

.news-archive-page .news-date,
.news-archive-page .news-content,
.news-archive-page .news-content span {
    min-width: 0;
    max-width: 100%;
}

.news-archive-page .news-date {
    color: #1e293b;
    font-family: "Courier New", Courier, monospace;
    font-size: 0.86rem;
    font-weight: 700;
}

.news-archive-page .news-content {
    color: #3f454a;
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.news-archive-page .news-content span {
    display: block;
    max-width: 48rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

.news-archive-page .news-content a {
    color: #224b8d;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.archive-footer {
    border-top: 1px solid #eef0f3;
    padding: 1.6rem 1rem;
    text-align: center;
}

.archive-footer p {
    margin: 0;
    color: #64748b;
    font-size: 0.88rem;
}

@media (max-width: 640px) {
    .archive-nav-inner {
        height: auto;
        min-height: 4.25rem;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        gap: 0.5rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .archive-nav-links {
        width: 100%;
        gap: 1rem;
        overflow-x: auto;
        padding-bottom: 0.1rem;
    }

    .archive-main {
        width: 100%;
        max-width: 100vw;
        padding-top: 2rem;
    }

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

    .news-archive-page .news-item {
        gap: 0.35rem;
        padding: 1rem 0;
    }

    .news-archive-page .news-content {
        width: 100%;
        max-width: 100%;
        padding-right: 0;
    }

    .news-archive-page .news-content span {
        max-width: calc(100vw - 4rem);
    }

    .news-archive-page .archive-panel {
        width: 100%;
        max-width: 100%;
        border-left: 0;
        border-right: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }
}

/* Formal Text */
.formal-font {
    font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.55;
    text-align: left;
    min-width: 0;
    overflow-wrap: break-word;
}

.formal-font.text-justify {
    text-align: left;
}

/* Service Section */
.service-category {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 1.5rem;
}

.service-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.service-category h3 {
    font-size: 1rem; /* Match education header size */
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.35rem;
    font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
}

.service-items {
    font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;
    font-size: 0.9rem; /* Match education text size (approx) */
    color: #475569;
    line-height: 1.5;
}

/* Honors Section Styling */
.honor-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 1.5rem;
    align-items: baseline;
    margin-bottom: 1.5rem;
}

.honor-year {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    font-size: 0.9rem;
    color: #d4a562; /* accent */
    text-align: right;
    white-space: nowrap;
}

.honor-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b; /* primary */
}

/* Publication Thumbnail & Layout */
.pub-content-wrapper {
    width: 100%;
}

.pub-list-item.with-thumbnail-expanded {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    padding: 1rem;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.pub-thumbnail-box {
    width: 200px; /* Fixed width for thumbnail */
    flex-shrink: 0;
    order: -1; /* Move to the left */
    border: none;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.pub-thumbnail-box img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pub-list-item.with-thumbnail-expanded .pub-content-wrapper {
    flex-grow: 1;
}

/* Adjust text spacing in expanded mode */
.pub-list-item.with-thumbnail-expanded .pub-line-1 {
    margin-bottom: 0.5rem;
}

.pub-list-item.with-thumbnail-expanded .pub-title-text {
    font-size: 1.1rem; /* Larger title in expanded mode */
}

.pub-btn-preview {
    cursor: pointer;
}

.pub-btn-preview.active {
    background-color: #1e293b;
    color: white;
    border-color: #1e293b;
}

/* Make sure mobile layout stacks */
@media (max-width: 640px) {
    .pub-list-item.with-thumbnail-expanded {
        flex-direction: column;
    }
    .pub-thumbnail-box {
        width: 100%;
        max-width: 300px;
        margin-top: 0.5rem;
    }
}
