/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    line-height: 1.6;
    scroll-behavior: smooth;
}

* {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #d4c4a8; /* Light brown text */
    background-color: #1a1a1a; /* Dark background */
    line-height: 1.6;
}

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

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    border-bottom: 1px solid #444;
    margin-bottom: 3rem;
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: saturate(120%) blur(6px);
}

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

.nav-brand-link {
    font-size: 1.5rem;
    font-weight: 600;
    color: #a8d5a8; /* Light green */
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-brand-link:hover {
    color: #90c090;
}

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

.nav-link {
    color: #c4b5a0; /* Light brown */
    text-decoration: none;
    font-weight: 400;
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #a8d5a8; /* Light green */
}

/* Main content */
.main {
    min-height: calc(100vh - 200px);
}

/* Home page */
/* Banner with XPan ratio (2.7:1) */
.banner {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 37.037037037%; /* Exact 1/2.7 * 100% for precise 2.7:1 XPan ratio */
    background-image: url('https://pub-a495ed422022427aa6830854f677ccec.r2.dev/banner.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-top: -2.5rem;
    margin-bottom: 2rem;
    overflow: visible;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}


.banner-portrait {
    position: absolute;
    bottom: -5%;
    left: 1rem;
    z-index: 10;
}

.banner-location {
    position: absolute;
    bottom: 0.5rem;
    right: 1rem;
    z-index: 10;
    color: rgba(212, 196, 168, 0.6); /* Very subtle light brown */
    font-size: 0.7rem;
    font-weight: 300;
    font-style: italic;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.portrait-image {
    width: 120px;
    height: 120px;
    max-width: 120px;
    max-height: 120px;
    min-width: 120px;
    min-height: 120px;
    border-radius: 50%;
    border: 3px solid #a8d5a8;
    object-fit: cover;
    object-position: center;
    box-shadow: 0 3px 15px rgba(168, 213, 168, 0.3);
    display: block;
}


/* Sections */
section {
    margin-bottom: 3rem;
    scroll-margin-top: 100px; /* Add space for fixed header */
}

section h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #a8d5a8; /* Light green */
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #444;
    padding-bottom: 0.5rem;
}

.about {
    margin-bottom: 3rem;
}

.about-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #d4c4a8; /* Light brown */
}

.about-content p {
    margin-bottom: 1rem;
}

.about-content a {
    color: #a8d5a8; /* Light green to match site theme */
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.about-content a:hover {
    color: #c4b5a0; /* Light brown on hover */
    border-bottom: 1px solid #a8d5a8; /* Subtle underline on hover */
    text-decoration: none;
}

/* Publications */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.publication-item {
    padding: 0.8rem 1.2rem;
    border: 1px solid #444;
    border-radius: 8px;
    background-color: #2a2a2a;
    transition: box-shadow 0.2s ease;
}

.publication-item:hover {
    box-shadow: 0 2px 8px rgba(168, 213, 168, 0.2);
}

.publication-item:hover .publication-links {
    opacity: 1;
    max-height: 2rem;
    margin-top: 0.5rem;
}

.publication-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #a8d5a8; /* Light green */
    margin-bottom: 0.2rem;
}

.publication-authors {
    color: #c4b5a0; /* Light brown */
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.publication-venue {
    color: #b5a895; /* Lighter brown */
    font-size: 0.85rem;
    margin-bottom: 0;
    font-style: italic;
}

.presentation-badge {
    display: inline-block;
    background-color: #a8d5a8; /* Light green */
    color: #1a1a1a; /* Dark background */
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.publication-links {
    display: flex;
    gap: 0.5rem;
    margin-top: 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.publication-link {
    color: #a8d5a8; /* Light green */
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.15rem 0.4rem;
    border: 1px solid #a8d5a8;
    border-radius: 3px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.publication-link:hover {
    background-color: #a8d5a8;
    color: #1a1a1a;
}

/* Posts */
.post {
    max-width: 700px;
    margin: 0 auto;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.post-title {
    font-size: 2.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

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

.post-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.post-content h1 {
    font-size: 2rem;
}

.post-content h2 {
    font-size: 1.5rem;
}

.post-content h3 {
    font-size: 1.3rem;
}

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

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

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

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

.post-content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: #666;
    font-style: italic;
}

.post-content code {
    background-color: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
}

.post-content pre {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

/* List pages */
.list-page {
    max-width: 700px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.page-title {
    font-size: 2.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}

.page-content {
    font-size: 1rem;
    line-height: 1.7;
    color: #555;
    margin-bottom: 2rem;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-preview {
    padding: 1.5rem;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background-color: #fafafa;
    transition: box-shadow 0.2s ease;
}

.post-preview:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-preview-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.post-preview-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-preview-title a:hover {
    color: #0066cc;
}

.post-preview-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.post-preview-summary {
    color: #555;
    line-height: 1.6;
}

/* Footer */
.site-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid #eee;
    text-align: center;
    color: #666;
}

.footer-content p {
    margin-bottom: 0.5rem;
}

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

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


/* Interactive buttons */
.btn-toggle {
    background-color: #a8d5a8; /* Light green */
    color: #1a1a1a;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
    margin: 1rem 0;
}

.btn-toggle:hover {
    background-color: #90c090;
}

.publications-header {
    position: relative;
    margin-bottom: 1.5rem;
}

.publications-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #a8d5a8; /* Light green */
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #444;
    padding-bottom: 0.5rem;
}

.publications-header .btn-toggle {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
}

.photography-header {
    position: relative;
    margin-bottom: 1.5rem;
}

.photography-header h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #a8d5a8; /* Light green */
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #444;
    padding-bottom: 0.5rem;
}

.photography-header .btn-toggle {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
}

.publications-toggle,
.photo-toggle {
    text-align: center;
    margin: 2rem 0;
}

/* Photo gallery */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.photo-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.photo-item:hover {
    transform: scale(1.02);
    cursor: pointer;
}

.photo-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.photo-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid rgba(168, 213, 168, 0.3);
    border-top: 3px solid #a8d5a8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

.photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 1rem;
    font-size: 0.9rem;
}

/* Photo slideshow modal */
.photo-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-modal.show {
    opacity: 1;
}

.photo-modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 98%;
    max-width: 95vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.photo-slideshow {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    cursor: pointer;
}

.photo-slide {
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.photo-slide img {
    max-width: calc(100% - 120px);
    max-height: 75vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    cursor: default;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.photo-slide img.loaded {
    opacity: 1;
}

.photo-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 4px solid rgba(168, 213, 168, 0.3);
    border-top: 4px solid #a8d5a8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

.photo-loading-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 50px));
    color: #a8d5a8;
    font-size: 1rem;
    font-weight: 500;
    z-index: 10;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.photo-slide-caption {
    color: white;
    padding: 1rem 0;
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
    max-width: 600px;
}

.photo-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.photo-close:hover {
    color: #bbb;
    background-color: rgba(255, 255, 255, 0.1);
}

.photo-prev,
.photo-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    padding: 20px;
    user-select: none;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1001;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

.photo-prev {
    left: 30px;
}

.photo-next {
    right: 30px;
}

.photo-prev:hover,
.photo-next:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.photo-thumbnails {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    overflow-x: auto;
    max-height: 120px;
    scrollbar-width: thin;
    scrollbar-color: #a8d5a8 rgba(0, 0, 0, 0.3);
}

.photo-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.photo-thumbnails::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.photo-thumbnails::-webkit-scrollbar-thumb {
    background: #a8d5a8;
    border-radius: 4px;
}

.photo-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #90c090;
}

.photo-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.photo-thumbnail:hover {
    opacity: 1;
    border-color: #a8d5a8;
    transform: scale(1.05);
}

.photo-thumbnail.active {
    opacity: 1;
    border-color: #a8d5a8;
    box-shadow: 0 0 10px rgba(168, 213, 168, 0.5);
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Interests entries */
.life-entries,
.life-entries-preview,
.life-entries-full {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.life-entry,
.life-entry-preview {
    padding: 1.5rem;
    border: 1px solid #444;
    border-radius: 8px;
    background-color: #2a2a2a;
    transition: box-shadow 0.2s ease;
}

.life-entry:hover,
.life-entry-preview:hover {
    box-shadow: 0 2px 8px rgba(168, 213, 168, 0.2);
}

.life-entry h3,
.life-entry-preview h3 {
    color: #a8d5a8; /* Light green */
    margin-bottom: 1rem;
    font-size: 1.4rem;
}


/* Responsive design */
@media (max-width: 768px) {
    
    .container {
        padding: 0 15px;
    }
    
    .nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
    
    
    .portrait-image {
        width: 120px;
        height: 120px;
        max-width: 120px;
        max-height: 120px;
        min-width: 120px;
        min-height: 120px;
    }
    
    .post-title,
    .page-title {
        font-size: 2.1rem;
    }
    
    .publications-header .btn-toggle,
    .photography-header .btn-toggle {
        position: static;
        margin-top: 1rem;
        align-self: flex-start;
    }
    
    .publication-links {
        flex-wrap: wrap;
        gap: 0.3rem;
        opacity: 1;
        max-height: none;
    }
    
    .publication-link {
        text-align: center;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .photo-modal-content {
        width: 95%;
    }
    
    .photo-slideshow {
        padding: 1rem;
    }
    
    .photo-slide img {
        max-width: calc(100% - 80px);
        max-height: 60vh;
    }
    
    .photo-prev,
    .photo-next {
        padding: 15px;
        font-size: 24px;
    }
    
    .photo-prev {
        left: 15px;
    }
    
    .photo-next {
        right: 15px;
    }
    
    .photo-thumbnails {
        padding: 15px;
        max-height: 100px;
    }
    
    .photo-thumbnail {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 480px) {
    
    .portrait-image {
        width: 100px;
        height: 100px;
        max-width: 100px;
        max-height: 100px;
        min-width: 100px;
        min-height: 100px;
    }
    
    .banner-portrait {
        left: 1rem;
    }
    
    .banner-location {
        bottom: 0.3rem;
        right: 0.3rem;
        font-size: 0.6rem;
    }
    
    .post-title,
    .page-title {
        font-size: 1.7rem;
    }
    
    .publication-item,
    .post-preview {
        padding: 0.6rem 0.8rem;
    }
    
    .photo-grid {
        grid-template-columns: 1fr;
    }
}
