/* Modern CSS for Jongho Park's Personal Website */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
    font-size: 16px;
}

/* Container and Layout */
.container {
    max-width: 950px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: #4a5568;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: #2d3748;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #2d3748;
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* Main Content */
.main {
    padding: 1.5rem 0;
    min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 2rem 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    padding-left: 2rem;
}

.hero-image {
    width: 250px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    border: none;
    flex-shrink: 0;
}

.hero-text h1 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.hero-text h1 .korean-name {
    font-size: 1.4rem;
    font-weight: 400;
    color: #718096;
}

.hero-text h2 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    border-bottom: 3px solid #e2e8f0;
    padding-bottom: 0.3rem;
}

.hero-text .subtitle {
    font-size: 1.2rem;
    color: #718096;
    margin-bottom: 1rem;
}

.hero-text p {
    color: #4a5568;
    font-size: 1.0rem;
    line-height: 1.7;
}

.hero-text .intro-text {
    max-width: 600px;
}

/* Social links next to intro */
.social-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.25rem 0 0.75rem;
}

.social-links a {
    text-decoration: none;
}

.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #2d3748;
    background: transparent;
    border: 1.5px solid #2d3748;
    transition: transform 0.15s ease, background-color 0.2s ease, color 0.2s ease;
}

.icon-badge:hover {
    transform: translateY(-1px);
    background: #2d3748;
    color: #fff;
}

/* Remove brand colors for monochrome look */
.icon-badge.scholar,
.icon-badge.x,
.icon-badge.linkedin { background: transparent; color: #2d3748; border-color: #2d3748; }

/* Ensure inline SVG icons inherit currentColor and scale nicely */
.icon-badge .icon {
    width: 16px;
    height: 16px;
    display: block;
}

/* Match intro text font size for selected paragraphs */
.match-intro-size {
    font-size: 1.0rem;
}

/* Sections */
.section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.section h2 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-top: 0.0rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    border-bottom: 3px solid #e2e8f0;
    padding-bottom: 0.3rem;
}

/* Filter buttons */
.filter-buttons {
    display: inline-block;
    margin-left: 1rem;
}

.filter-button {
    background: none;
    border: 1px solid #e2e8f0;
    color: #718096;
    font-size: 0.8rem;
    font-weight: 400;
    padding: 0.25rem 0.5rem;
    margin: 0 0.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-button.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

.filter-button:hover {
    background: #e2e8f0;
    color: #4a5568;
}

/* Hidden publications */
.publication.hidden {
    display: none;
}

.section h3 {
    font-size: 1rem;
    color: #4a5568;
    margin: 1rem 0 0.6rem 0;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.3rem;
}

.section h4 {
    font-size: 0.95rem;
    color: #4a5568;
    margin: 0.8rem 0 0.4rem 0;
    font-weight: 600;
}

/* Typography */
p {
    margin-bottom: 0.8rem;
    color: #4a5568;
    line-height: 1.6;
}

/* Research section specific typography */
.research-section p {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.6rem;
}

ul, ol {
    margin-bottom: 0.8rem;
    padding-left: 2rem;
}

li {
    margin-bottom: 0.3rem;
    color: #4a5568;
}

/* Research section lists */
.research-section ul, .research-section ol {
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
}

.research-section li {
    margin-bottom: 0.2rem;
}

/* Links */
a {
    color: #3182ce;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2c5282;
    text-decoration: underline;
}

/* Blog Styles - Substack inspired */
.blog-list {
    margin-top: 2rem;
}

.blog-post-item {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.blog-post-item:hover {
    opacity: 0.8;
}

.blog-post-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.blog-post-item h3 {
    font-size: 1.5rem;
    color: #000;
    margin-bottom: 0.5rem;
    font-weight: 700;
    line-height: 1.2;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.blog-post-item .subtitle {
    color: #6b7280;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 1.4;
}

.blog-post-item .date {
    color: #9ca3af;
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-post-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.blog-post-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Blog Post Page */
.blog-post {
    max-width: 800px;
    margin: 0 auto;
}

.blog-post-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.blog-post h1 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.blog-post .subtitle {
    color: #718096;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.blog-post .date {
    color: #a0aec0;
    font-size: 1rem;
}

/* Language Tabs */
.language-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.language-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #718096;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.language-tab.active {
    color: #2d3748;
    border-bottom-color: #3182ce;
}

.language-tab:hover {
    color: #4a5568;
}

.language-content {
    display: none;
}

.language-content.active {
    display: block;
}

/* Publications with Timeline Design */
.publication {
    margin-bottom: 0.0rem;
    padding-bottom: 0.0rem;
    border-bottom: none;
    position: relative;
    padding-left: 4.0rem;
}

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

/* Timeline vertical line - for all publications */
.publication::before {
    content: '';
    position: absolute;
    left: 2.5rem;
    top: 0;
    bottom: -0.5rem;
    width: 2px;
    background-color: #e2e8f0;
}

/* Timeline dot - only for publications with years */
.publication:has(.publication-year)::after {
    content: '';
    position: absolute;
    left: 2.25rem;
    top: 0.5rem;
    width: 8px;
    height: 8px;
    background-color: #3182ce;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #e2e8f0;
}

/* Year labels */
.publication-year {
    position: absolute;
    left: -1.0rem;
    top: 0.2rem;
    font-size: 0.8rem;
    color: #4a5568;
    font-weight: 600;
    background: white;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-width: 2.5rem;
    text-align: center;
}

.publication h4 {
    margin-bottom: 0.2rem;
    color: #2d3748;
    font-size: 0.95rem;
    line-height: 1.3;
    border-bottom: none;
    padding-bottom: 0;
}

.publication .authors {
    color: #4a5568;
    margin-bottom: 0.2rem;
    font-weight: 500;
    font-size: 0.85rem;
    line-height: 1.3;
}

.publication .venue {
    color: #718096;
    font-style: italic;
    margin-bottom: 0.2rem;
    font-size: 0.85rem;
    line-height: 1.3;
}

.publication a {
    color: #3182ce;
    font-weight: 500;
}

/* Misc Section - Collapsible */
.collapsible {
    background-color: #f7fafc;
    color: #2d3748;
    cursor: pointer;
    padding: 0.8rem 1.2rem;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 0.3rem;
    transition: background-color 0.3s ease;
}

.collapsible:hover {
    background-color: #edf2f7;
}

.collapsible.active {
    background-color: #e2e8f0;
}

.collapsible:after {
    content: '\02795';
    font-size: 13px;
    color: #718096;
    float: right;
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.collapsible.active:after {
    content: "\2796";
}

.content {
    padding: 0 1.2rem;
    background-color: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    border-radius: 0 0 8px 8px;
}

.content.active {
    max-height: 2000px;
    padding: 1.2rem;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
    margin: 0.8rem 0;
}

.image-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease, cursor 0.3s ease;
    cursor: pointer;
}

.image-gallery img:hover {
    transform: scale(1.05);
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    animation: zoomIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-close:hover {
    color: #ccc;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Footer */
.footer {
    background: #2d3748;
    color: #a0aec0;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #2d3748;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    color: #4a5568;
    background-color: #f7fafc;
}

.mobile-menu-toggle:focus {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
}

/* Hamburger Icon Animation */
.hamburger-icon {
    width: 20px;
    height: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #2d3748;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover .hamburger-icon span {
    background-color: #4a5568;
}

/* Hamburger icon animation when menu is active */
.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Header optimizations for mobile */
    .header {
        position: relative; /* Remove sticky on mobile to save space */
        z-index: 999; /* Ensure header stays above content */
    }
    
    .nav {
        padding: 0.8rem 0; /* Reduce padding */
        flex-direction: column;
        align-items: flex-start;
        position: relative; /* Create positioning context for absolute menu */
    }
    
    .logo {
        font-size: 1.3rem; /* Slightly smaller logo */
    }
    
    /* Show hamburger menu on all mobile devices */
    .mobile-menu-toggle {
        display: block;
        align-self: flex-end;
        margin-top: -2.5rem; /* Position next to logo */
    }
    
    .nav-menu {
        width: 50%; /* Half width menu */
        flex-direction: column;
        gap: 0; /* Remove gaps between items for full clickable area */
        background: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        padding: 0;
        margin: 0;
        margin-top: 0.5rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        position: absolute;
        top: 100%;
        right: 0;
        z-index: 1000;
    }
    
    .nav-menu.active {
        max-height: 180px; /* Compact height without extra padding */
        padding: 0;
        overflow: visible;
    }
    
    .nav-menu li {
        width: 100%;
        margin: 0;
        padding: 0;
        text-align: center;
    }
    
    .nav-menu a {
        display: block;
        width: 100%;
        padding: 0.6rem 1rem;
        margin: 0;
        border-bottom: 1px solid #f1f1f1;
        font-size: 0.9rem;
        font-weight: 500;
        color: #4a5568;
        text-decoration: none;
        text-align: center;
        background: white;
        transition: color 0.3s ease;
        box-sizing: border-box;
    }
    
    .nav-menu a:hover {
        color: #2d3748;
        text-decoration: none;
    }
    
    .nav-menu a.active {
        color: #2d3748;
        font-weight: 600;
    }
    
    .nav-menu li:last-child a {
        border-bottom: none;
    }
    
    .nav-menu li:first-child a {
        border-radius: 8px 8px 0 0;
    }
    
    .nav-menu li:last-child a {
        border-radius: 0 0 8px 8px;
    }
    
    /* Hero section mobile improvements */
    .hero {
        padding: 1.5rem 0; /* Reduce padding */
        margin-bottom: 1rem;
    }
    
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding-left: 0; /* Remove left padding on mobile */
        padding: 0 1rem; /* Add horizontal padding */
    }
    
    .hero-image {
        width: 300px; /* Bigger image on mobile with hamburger menu */
        align-self: center;
    }
    
    .hero-text {
        text-align: left; /* Keep text left-aligned for readability */
        width: 100%; /* Ensure full width */
        max-width: none; /* Remove any width constraints */
    }
    
    .hero-text h1 {
        font-size: 1.8rem; /* Smaller heading */
    }
    
    .hero-text .subtitle {
        font-size: 1.1rem;
    }
    
    .hero-text .intro-text {
        max-width: 100%; /* Full width on mobile */
        font-size: 0.95rem;
        margin: 0; /* Remove any default margins */
        text-align: justify; /* Better text flow on mobile */
        hyphens: auto; /* Allow word breaking for better flow */
    }
    
    .match-intro-size {
        font-size: 0.95rem;
    }

    .icon-badge {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .icon-badge .icon {
        width: 18px;
        height: 18px;
    }
    
    /* Main content adjustments */
    .main {
        padding: 1rem 0; /* Reduce main padding */
    }
    
    .section {
        padding: 1.2rem;
        margin-bottom: 1rem; /* Reduce margin between sections */
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* Blog grid */
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    /* Extra small mobile devices */
    .nav-menu {
        gap: 0; /* No gaps to avoid unclickable spaces */
    }
    
    .nav-menu a {
        font-size: 0.85rem;
        padding: 0.3rem 0.6rem;
    }
    
    .hero {
        padding: 1rem 0; /* Minimal padding */
    }
    
    .hero-content {
        padding: 0 0.8rem; /* Tighter horizontal padding */
        gap: 1rem;
    }
    
    .hero-image {
        width: 220px; /* Keep image reasonably large on small screens */
    }
    
    .hero-text h1 {
        font-size: 1.6rem; /* Smaller heading for very small screens */
    }
    
    .hero-text .korean-name {
        font-size: 1.2rem;
    }
    
    .hero-text .subtitle {
        font-size: 1rem;
    }
    
    .hero-text .intro-text {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .match-intro-size {
        font-size: 0.9rem;
    }

    .icon-badge {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .icon-badge .icon {
        width: 18px;
        height: 18px;
    }
    
    .section h2 {
        font-size: 1.3rem; /* Smaller section headings */
    }
    
    .blog-post h1 {
        font-size: 1.8rem;
    }
    
    .main {
        padding: 0.8rem 0; /* Minimal main padding */
    }
    
    .section {
        padding: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .container {
        padding: 0 12px; /* Tighter container padding */
    }
}

/* Ultra small screens - additional adjustments */
@media (max-width: 360px) {
    .hero-content {
        padding: 0 0.5rem; /* Even tighter spacing */
    }
    
    .hero-image {
        width: 200px; /* Keep image substantial even on tiny screens */
    }
    
    .hero-text h1 {
        font-size: 1.4rem;
    }
    
    .hero-text .korean-name {
        font-size: 1rem;
    }
    
    /* Increase menu width slightly on very small screens for better usability */
    .nav-menu {
        width: 65%; /* Slightly wider on tiny screens */
        min-width: 200px; /* Ensure minimum width for readability */
    }
    
    .nav-menu.active {
        max-height: 160px; /* Compact on tiny screens */
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
