/* Modern responsive CSS for Jaakko Lehtinen's homepage */

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

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

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Main Container - CSS Grid Layout */
.container {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Navigation Sidebar */
nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

nav figure {
    margin: 0;
    padding: 0;
}

nav img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

nav #navlinks {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

nav a {
    font-weight: bold;
    color: #555;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
    padding: 0.25rem 0;
}

nav a:hover,
nav a:focus {
    color: #000;
    text-decoration: underline;
}

/* Logo styling */
.nav-logos {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.nav-logos img {
    width: 100%;
    height: auto;
}

.nvidia-logo {
    width: 75%;
}

.fcai-logo {
    width: 75%;
}

/* Main Content Area */
article {
    max-width: 800px;
}

article h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    color: #000;
}

article h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    color: #000;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.25rem;
}

article h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem 0;
    color: #333;
}

article h4 {
    font-size: 1.1rem;
    margin: 1.25rem 0 0.5rem 0;
    color: #333;
}

/* Titles section (position, affiliation) */
.titles {
    font-size: 1.1rem;
    font-weight: normal;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Links */
a {
    color: #666;
    text-decoration: none;
}

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

/* Button styled as link (for JavaScript interactions) */
.link-button {
    background: none;
    border: none;
    color: #666;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
    display: inline;
}

.link-button:hover,
.link-button:focus {
    color: #000;
    text-decoration: underline;
}

/* Sections */
section {
    margin-bottom: 2rem;
}

/* Lists */
ul {
    padding-left: 2rem;
    margin: 1rem 0;
}

li {
    margin: 0.5rem 0;
}

/* Strong text */
strong {
    font-weight: 600;
}

/* Emphasis */
em {
    font-style: italic;
}

/* Paper List Styles */
.paperlist {
    margin-top: 2rem;
}

.paperlist h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    color: #000;
}

.paperentry {
    margin: 1.5rem 0;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.paperentry:last-child {
    border-bottom: none;
}

.papertitle {
    font-style: italic;
    font-size: 1.05rem;
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.authorlist {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
}

.authorname {
    /* Individual author styling if needed */
}

.publication-info {
    margin-bottom: 0.5rem;
    color: #333;
}

.papernote {
    font-style: italic;
    color: #666;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.paperlinks {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.paperlink {
    display: inline-block;
}

.paperlink::before {
    content: "[";
}

.paperlink::after {
    content: "]";
}

.paperlink a,
.paperlink button {
    color: #666;
    text-decoration: none;
}

.paperlink a:hover,
.paperlink a:focus,
.paperlink button:hover,
.paperlink button:focus {
    color: #000;
    text-decoration: underline;
}

/* BibTeX blocks */
.bibtex {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre;
}

/* Conflicts section */
#conflicts {
    padding: 1rem;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 1rem 0;
}

/* Focus styles for accessibility */
a:focus,
button:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Responsive Design - Tablet */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 180px 1fr;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
    }
    
    article h1 {
        font-size: 1.75rem;
    }
    
    article h2 {
        font-size: 1.35rem;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    nav {
        border-bottom: 2px solid #ddd;
        padding-bottom: 1.5rem;
        margin-bottom: 1rem;
    }
    
    nav figure {
        text-align: center;
    }
    
    nav figure img {
        max-width: 200px;
        margin: 0 auto;
    }
    
    nav #navlinks {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
        margin-top: 1rem;
    }
    
    nav #navlinks br {
        display: none;
    }
    
    .nav-logos {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 1rem;
    }
    
    .nav-logos img {
        width: auto;
        max-width: 120px;
        height: 40px;
        object-fit: contain;
    }
    
    .nvidia-logo,
    .fcai-logo {
        width: auto;
        max-width: 100px;
    }
    
    article h1 {
        font-size: 1.5rem;
    }
    
    article h2 {
        font-size: 1.25rem;
    }
    
    article h3 {
        font-size: 1.1rem;
    }
    
    .titles {
        font-size: 1rem;
    }
    
    .paperlinks {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Responsive Design - Very Small Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    article h1 {
        font-size: 1.35rem;
    }
    
    article h2 {
        font-size: 1.15rem;
    }
    
    .bibtex {
        font-size: 0.8rem;
        padding: 0.75rem;
    }
    
    ul {
        padding-left: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .skip-link,
    nav,
    .paperlinks {
        display: none;
    }
    
    .container {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .bibtex {
        page-break-inside: avoid;
    }
    
    .paperentry {
        page-break-inside: avoid;
    }
}
