/* -------- Global -------- */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* background-color: #f8f8f8; */
    background-color: #FCFCFC;
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Centered content container */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    background-color: #ffffff;
}

/* -------- Header -------- */
header {
    position: sticky;
    top: 0;
    width: 100%;
    border-bottom: none;
    padding: 1.5rem 1.5rem;
    margin-bottom: 0;
    background-color: #1a3a5c;
    z-index: 1000;
}

header h1 {
    color: #ffffff !important;
}

/* Name section below header */
.name-section {
    /* background-color: #ffffff; */
    background-color: #fcfcfc99; /* transparent white */
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
    margin-top: 0;
    text-align: left;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.name-section h1 {
    margin: 0;
    font-size: 56px;
    font-weight: 400;
    font-family: "Raleway", "Lato", "Helvetica", Arial, sans-serif;
    color: #184056;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

nav a {
    color: #e0e8f0;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

nav a:hover {
    color: #ffffff;
}

/* -------- Typography -------- */
h1 {
    font-size: 2rem;
    font-weight: 400;
    margin: 0 0 1.5rem 0;
    color: #333 !important;
}

h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin: 3rem 0 1.5rem 0;
    color: #e67e22 !important;
}

h2:first-of-type {
    margin-top: 2rem;
}

h3 {
    font-size: 1.25rem;
    font-weight: 400;
    margin: 0 0 0.75rem 0;
    color: #333 !important;
}

main h1,
main h2,
main h3 {
    color: #e67e22 !important;
}

p {
    margin: 0 0 1rem 0;
}

/* -------- News Items -------- */
.news-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

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

.news-tile-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-tile-link:hover .tile {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
    transition: box-shadow 0.2s, transform 0.2s;
}

.news-tile {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.news-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1rem;
    object-fit: cover;
}

.news-date {
    font-weight: 500;
    color: #e67e22;
    margin-bottom: 0.5rem;
    text-transform: lowercase;
    font-size: 0.9rem;
}

.news-title {
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: #333;
    font-size: 1rem;
}

.news-content {
    color: #666;
    line-height: 1.6;
    font-size: 0.9rem;
    flex-grow: 1;
}

.news-content a {
    color: #0066cc;
    text-decoration: none;
}

.news-content a:hover {
    text-decoration: underline;
}

.item-tags,
.compact-tile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.item-tags {
    margin: 0 0 0.75rem 0;
}

.compact-tile-tags {
    padding: 0 1rem 0.75rem;
}

.compact-tile-no-image .compact-tile-tags {
    padding: 0 0 0.75rem;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #d7e1eb;
    background-color: #f5f8fc;
    color: #35516b;
    font-size: 0.75rem;
    line-height: 1.3;
    white-space: nowrap;
}

/* News article page styling */
.news-article {
    max-width: 800px;
    margin: 0 auto;
}

.news-article-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.news-article-icon {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.news-article-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 2rem 0;
    object-fit: cover;
}

.news-article-content {
    line-height: 1.8;
    color: #333;
}

.news-article-content p {
    margin-bottom: 1.5rem;
}

.news-article-content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.95em;
    background-color: #f5f8fc;
    border: 1px solid #e4ebf3;
    border-radius: 4px;
    padding: 0.05rem 0.25rem;
}

.news-article-content pre {
    overflow-x: auto;
    background-color: #f5f8fc;
    border: 1px solid #e4ebf3;
    border-radius: 4px;
    padding: 1rem;
    margin: 0 0 1.5rem 0;
}

.news-article-content pre code {
    display: block;
    background: none;
    border: 0;
    padding: 0;
    white-space: pre;
}

/* -------- Research/Project Tiles -------- */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 320px));
    justify-content: flex-start;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Horizontally scrollable tiles */
.tile-scroll {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    -webkit-overflow-scrolling: touch;
}

.tile-scroll::-webkit-scrollbar {
    height: 8px;
}

.tile-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.tile-scroll::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

.tile-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

.tile-scroll .tile {
    flex: 0 0 320px;
    min-width: 320px;
}

.tile {
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1.5rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.compact-tile {
    width: 320px;
    height: 260px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.compact-tile-image {
    width: 100%;
    height: 185px;
    object-fit: cover;
    border-radius: 0;
    margin: 0;
}

.compact-tile-image-placeholder {
    background: linear-gradient(135deg, #f3f3f3 0%, #e8e8e8 100%);
}

.compact-tile-title {
    margin: 0;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.35;
    color: #333;
}

.compact-tile-no-image {
    padding: 1rem;
}

.compact-tile-no-image .compact-tile-title {
    padding: 0;
    margin-bottom: 0.75rem;
}

.compact-tile-preview {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.tile:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #ccc;
}

.tile h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    color: #333;
}

.tile p {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.tile-links {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.tile-links a {
    color: #0066cc;
    text-decoration: none;
    margin-right: 1rem;
}

.tile-links a:hover {
    text-decoration: underline;
}

.section-empty {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.video-card {
    background-color: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1rem;
}

.video-card video {
    width: 100%;
    display: block;
    border-radius: 4px;
    background-color: #000;
    min-height: 220px;
    aspect-ratio: 16 / 9;
}

.video-card-title {
    margin: 1rem 0 0.35rem;
    font-size: 1rem;
    color: #333;
}

.video-card-meta {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.video-card-links {
    margin-top: 0.85rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.video-card-links a {
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9rem;
}

.video-card-links a:hover {
    text-decoration: underline;
}

/* -------- Publications/Research List -------- */
.publication-item,
.research-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

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

.publication-title {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #333;
}

.publication-authors {
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.publication-venue {
    color: #666;
    font-style: italic;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.publication-links {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.publication-links a {
    color: #0066cc;
    text-decoration: none;
    margin-right: 1rem;
}

.publication-links a:hover {
    text-decoration: underline;
}

/* -------- About Section -------- */
.about-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.about-photo {
    width: 100%;
    border-radius: 4px;
}

.about-bio {
    color: #666;
    line-height: 1.7;
}

.about-bio strong {
    color: #333;
    font-weight: 500;
}

/* -------- Contact Section -------- */
.contact-info {
    margin-top: 2rem;
}

.contact-info p {
    margin-bottom: 1rem;
    color: #666;
}

.contact-info a {
    color: #0066cc;
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* -------- Footer -------- */
footer {
    text-align: center;
    padding: 2rem 1.5rem;
    font-size: 0.9rem;
    color: #999;
    border-top: 1px solid #e0e0e0;
    margin-top: 4rem;
}

footer a {
    color: #666;
    text-decoration: none;
}

footer a:hover {
    color: #000;
    text-decoration: underline;
}

/* -------- Responsive -------- */
@media (max-width: 768px) {
    main {
        padding: 1.5rem 1rem 3rem;
    }
    
    header {
        padding: 1.5rem 1rem 1rem;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    nav {
        gap: 1rem;
    }
    
    .tile-grid {
        grid-template-columns: 1fr;
    }

    .tile-scroll .section-empty {
        min-width: 100%;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-photo {
        max-width: 200px;
        margin: 0 auto;
    }
}
