/* ============================================
   ALTHEA M. RAO PORTFOLIO - STYLESHEET
   ============================================
   Background: Warm white (#fff9f5)
   Typography: Inter with refined hierarchy
   Layout: Left sidebar navigation
   ============================================ */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    /* Colors - warm, refined palette */
    --bg-color: #fff9f5;
    --text-color: #1a1a1a;
    --text-muted: #4a4a4a;
    --text-light: #777777;
    --link-color: #1a1a1a;
    --link-hover: #555555;
    --accent-warm: #e8ddd4;
    --border-light: rgba(0, 0, 0, 0.06);
    --shadow-subtle: rgba(0, 0, 0, 0.04);

    /* Typography - refined scale */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-lg: 15px;
    --font-size-xl: 18px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --letter-spacing-tight: -0.02em;
    --letter-spacing-normal: -0.01em;
    --line-height-tight: 1.3;
    --line-height-relaxed: 1.75;

    /* Spacing - generous breathing room */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 4rem;
    --spacing-2xl: 6rem;

    /* Layout */
    --sidebar-width: 260px;
    --content-max-width: 1100px;
    --grid-gap: 2rem;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size-base);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    font-weight: var(--font-weight-light);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: var(--line-height-relaxed);
    min-height: 100vh;
}

::selection {
    background-color: var(--accent-warm);
    color: var(--text-color);
}

/* ============================================
   MEDIA PROTECTION
   ============================================ */
img, video {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: auto;
}

/* Prevent saving images via long-press on mobile */
img, video {
    -webkit-touch-callout: none;
}

/* ============================================
   LAYOUT: Sidebar + Main Content
   ============================================ */
.site-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   LEFT SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    padding: var(--spacing-lg) var(--spacing-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

/* Site Title */
.site-header {
    margin-bottom: var(--spacing-xl);
}

.site-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-normal);
    line-height: var(--line-height-tight);
}

.site-title a {
    display: block;
    text-decoration: none;
    color: var(--text-color);
    transition: color var(--transition-base);
}

.site-title a:hover {
    color: var(--text-muted);
}

.chinese-name {
    display: block;
    font-weight: var(--font-weight-light);
    font-size: var(--font-size-base);
    margin-top: 0.35em;
    color: var(--text-muted);
}

/* ============================================
   NAVIGATION
   ============================================ */
.main-nav {
    flex: 1;
}

.nav-section {
    margin-bottom: var(--spacing-lg);
}

.nav-section-title {
    font-size: 10px;
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
}

.nav-list {
    list-style: none;
}

.nav-list li {
    margin-bottom: 0.4rem;
}

.nav-list a {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-light);
    color: var(--text-muted);
    text-decoration: none;
    display: inline-block;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-list a:hover {
    color: var(--text-color);
}

/* Animated underline on hover */
.nav-list a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--text-color);
    transition: width var(--transition-base);
}

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

/* Active page indicator */
.nav-list a.active {
    color: var(--text-color);
    font-weight: var(--font-weight-normal);
}

.nav-list a.active::after {
    width: 100%;
}

/* Project navigation */
.nav-projects a {
    font-size: var(--font-size-xs);
    line-height: 1.5;
}

/* Collapsible project list */
.nav-projects-more {
    display: none;
}

.nav-projects-more.expanded {
    display: block;
}

/* Collapsible info list */
.nav-info-more {
    display: none;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.nav-info-more.expanded {
    display: block;
}

.nav-toggle {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-light);
    color: var(--text-light);
    background: none;
    border: none;
    padding: 0;
    margin-top: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    transition: color var(--transition-fast);
}

.nav-toggle:hover {
    color: var(--text-color);
}

.nav-toggle-icon {
    display: inline-block;
    transition: transform var(--transition-fast);
}

.nav-toggle.expanded .nav-toggle-icon {
    transform: rotate(180deg);
}

/* Info navigation */
.nav-info {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
}

.nav-info a {
    font-size: var(--font-size-sm);
}

/* Sidebar footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: var(--spacing-lg);
}

.social-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.social-link:hover {
    color: var(--text-color);
}

.social-link svg {
    width: 18px;
    height: 18px;
}

/* Legacy support */
.instagram-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.instagram-link:hover {
    color: var(--text-color);
}

.instagram-link svg {
    width: 18px;
    height: 18px;
}

.copyright {
    font-size: var(--font-size-xs);
    color: var(--text-light);
    margin-top: var(--spacing-sm);
    opacity: 0.7;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: var(--spacing-lg) var(--spacing-xl);
    max-width: calc(var(--content-max-width) + var(--spacing-xl) * 2);
}

/* ============================================
   PROJECT GRID
   ============================================ */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--grid-gap);
}

.project-item {
    position: relative;
}

.project-link {
    display: block;
    text-decoration: none;
    color: var(--text-color);
}

.project-thumbnail {
    position: relative;
    overflow: hidden;
    background-color: var(--accent-warm);
    aspect-ratio: 4 / 3;
    border-radius: 2px;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

/* Subtle lift on hover */
.project-link:hover .project-thumbnail {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--shadow-subtle);
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow), opacity var(--transition-base);
}

.project-link:hover .project-thumbnail img {
    transform: scale(1.03);
    opacity: 0.95;
}

.project-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    margin-top: var(--spacing-sm);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-normal);
}

.project-year {
    font-weight: var(--font-weight-light);
    color: var(--text-light);
    margin-left: 0.3em;
}

/* ============================================
   PAGE CONTENT (Bio, CV, Artist Statement)
   ============================================ */
.page-content {
    max-width: 640px;
}

.page-content h1 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-normal);
    margin-bottom: var(--spacing-xl);
    letter-spacing: var(--letter-spacing-tight);
    line-height: var(--line-height-tight);
}

.page-content h2 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-medium);
    margin-top: var(--spacing-2xl);
    margin-bottom: var(--spacing-md);
    letter-spacing: var(--letter-spacing-normal);
}

.page-content h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.page-content p {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-md);
    line-height: var(--line-height-relaxed);
    color: var(--text-muted);
}

.page-content ul,
.page-content ol {
    margin-bottom: var(--spacing-md);
    padding-left: 1.25rem;
    color: var(--text-muted);
}

.page-content li {
    margin-bottom: 0.4rem;
    line-height: var(--line-height-relaxed);
}

/* Links in content */
.page-content a {
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-color: var(--accent-warm);
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    transition: text-decoration-color var(--transition-fast);
}

.page-content a:hover {
    text-decoration-color: var(--text-color);
}

/* ============================================
   BIO PAGE
   ============================================ */
.bio-headshot {
    width: 100%;
    max-width: 280px;
    height: auto;
    margin-bottom: var(--spacing-lg);
}

/* ============================================
   CV PAGE
   ============================================ */
.cv-content h2 {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-color);
}

.cv-content h2:first-of-type {
    margin-top: 0;
}

.cv-entry {
    margin-bottom: var(--spacing-xs);
    display: flex;
    gap: 1.25rem;
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.cv-entry .year {
    color: var(--text-light);
    min-width: 3rem;
    flex-shrink: 0;
}

.cv-entry .details {
    flex: 1;
    color: var(--text-muted);
}

/* ============================================
   PROJECT PAGE
   ============================================ */
.project-header {
    margin-bottom: var(--spacing-xl);
}

.project-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-normal);
    margin-bottom: var(--spacing-sm);
    letter-spacing: var(--letter-spacing-tight);
    line-height: var(--line-height-tight);
}

.project-meta {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: 1.6;
}

.project-meta + .project-meta {
    margin-top: var(--spacing-xs);
    color: var(--text-muted);
    font-style: italic;
}

.project-description {
    max-width: 640px;
    margin-bottom: var(--spacing-xl);
}

.project-description p {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--spacing-md);
    color: var(--text-muted);
}

.project-description p:first-child {
    font-size: var(--font-size-lg);
    color: var(--text-color);
}

.project-description blockquote {
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md) var(--spacing-lg);
    border-left: 3px solid var(--accent-warm);
    background-color: rgba(232, 221, 212, 0.15);
    font-style: italic;
    color: var(--text-muted);
}

.project-description blockquote cite {
    display: block;
    margin-top: var(--spacing-sm);
    font-style: normal;
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

.project-description img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: var(--spacing-md);
}

.project-description a > img {
    transition: opacity var(--transition-base);
}

.project-description a > img:hover {
    opacity: 0.85;
}

/* Project Gallery */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.project-gallery a {
    display: block;
    border-radius: 2px;
    overflow: hidden;
}

.project-gallery img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: opacity var(--transition-base);
}

.project-gallery img:hover {
    opacity: 0.92;
}

.project-gallery .full-width {
    grid-column: 1 / -1;
}

.photo-credit {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    font-style: italic;
    margin-top: var(--spacing-lg);
}

/* Project embeds and videos */
.project-embed,
.project-video {
    margin-bottom: var(--spacing-lg);
}

.project-video video {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

/* Project external links */
.project-link {
    margin-top: var(--spacing-lg);
}

.project-link a {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    transition: color var(--transition-fast);
}

.project-link a:hover {
    color: var(--text-color);
}

/* ============================================
   VIDEO STYLES
   ============================================ */
.project-media {
    margin-bottom: var(--spacing-xl);
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-bottom: var(--spacing-sm);
    border-radius: 2px;
    overflow: hidden;
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
    background-color: #000;
}

/* For YouTube/Vimeo embeds */
.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
    border-radius: 2px;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-caption {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    font-style: italic;
}

/* ============================================
   RESPONSIVE - Tablet
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
        --spacing-xl: 3rem;
    }

    .main-content {
        padding: var(--spacing-lg);
    }

    .project-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }

    .project-gallery {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* ============================================
   RESPONSIVE - Mobile
   ============================================ */
@media (max-width: 768px) {
    :root {
        --font-size-3xl: 26px;
        --font-size-2xl: 20px;
        --spacing-lg: 2rem;
        --spacing-xl: 2.5rem;
    }

    .site-wrapper {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--border-light);
    }

    .site-header {
        margin-bottom: var(--spacing-md);
    }

    .main-content {
        margin-left: 0;
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .site-title {
        font-size: var(--font-size-base);
    }

    .chinese-name {
        display: inline;
        margin-left: 0.5em;
        margin-top: 0;
    }

    .nav-section {
        margin-bottom: var(--spacing-sm);
    }

    .nav-projects {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem 0.75rem;
    }

    .nav-projects li {
        margin-bottom: 0;
    }

    .nav-info {
        display: flex;
        gap: 1rem;
        margin-top: var(--spacing-sm);
        padding-top: var(--spacing-sm);
    }

    .nav-info li {
        margin-bottom: 0;
    }

    .sidebar-footer {
        display: none;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .project-gallery {
        grid-template-columns: 1fr;
    }

    .page-content,
    .project-description {
        max-width: 100%;
    }
}

/* ============================================
   GLIGHTBOX CUSTOMIZATION
   ============================================ */
.glightbox-clean .gslide-description {
    background: transparent;
}

.glightbox-clean .gslide-title {
    font-family: var(--font-main);
    font-weight: var(--font-weight-light);
    color: #fff;
}

/* ============================================
   WELCOME POPUP MODAL
   ============================================ */
.welcome-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.welcome-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.welcome-popup {
    background-color: var(--bg-color);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: var(--spacing-lg);
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: translateY(20px);
    transition: transform var(--transition-base);
}

.welcome-popup-overlay.active .welcome-popup {
    transform: translateY(0);
}

.welcome-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.welcome-popup-header h2 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-medium);
    margin: 0;
    letter-spacing: var(--letter-spacing-normal);
}

.welcome-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.welcome-popup-close:hover {
    color: var(--text-color);
}

.welcome-popup-content {
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    color: var(--text-muted);
}

.welcome-popup-content p {
    margin-bottom: var(--spacing-sm);
}

.welcome-popup-content p:last-child {
    margin-bottom: 0;
}

/* ============================================
   TEXT STYLING
   ============================================ */
/* Work titles (italicized) */
.work-title {
    font-style: italic;
}

/* Credits list styling */
.credits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.credits-list li {
    margin-bottom: 0.25rem;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.credit-role {
    font-weight: var(--font-weight-medium);
}

/* Artist credits (performer + role) */
.artist-credits {
    list-style: none;
    padding: 0;
    margin: 0;
}

.artist-credits li {
    margin-bottom: 0.25rem;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.artist-role {
    color: var(--text-light);
    font-style: italic;
}

/* Screening/exhibition list */
.screening-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.screening-list li {
    margin-bottom: 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.screening-year {
    font-weight: var(--font-weight-medium);
    display: inline-block;
    min-width: 3.5rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-light { color: var(--text-light); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
