/* ============================================
   Rucy Cui Website - Portable Version
   Styles for index.html and writing.html
   ============================================ */

/* CSS Variables for Easy Maintenance */
:root {
    --color-bg: #ffffff;
    --color-text: #666666;
    --color-text-dark: #333333;
    --color-accent-name-box: #fffacd;
    --color-accent-border: #c97b8f;
    --color-link-writing: #333333;
    --color-link-about: #333333;
    --font-body: 'Segoe UI', sans-serif;
    --spacing-unit: 1rem;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-weight: 500;
    line-height: 1.6;
    padding: 1rem;
}

a {
    color: var(--color-text);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* Container */
.site-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex; /* Default to stacked on mobile */
    flex-direction: column;
}

.header {
    /* Header will be the left column on desktop, but full width on mobile */
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.main-content {
    /* Main content will be the right column on desktop, but full width on mobile */
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 100%; /* Reset max-width to allow it to fill the container */
}

/* ============================================
   Header / Navigation Section
   ============================================ */

.header {
    /* Mobile: Header is full width, stacked content */
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center; /* Center header content on mobile */
}

.logo-box {
    border: 3px solid var(--color-text-dark);
    background-color: var(--color-accent-name-box);
    padding: 1rem;
    width: fit-content;
    position: relative;
    margin: 0 auto; /* Center the logo box on mobile */
}

.logo-box h1 {
    font-family: var(--font-body);
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    margin: 0;
    line-height: 1.2;
    color: var(--color-text-dark);
}

.logo-box::after {
    content: '';
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    width: 2rem;
    height: 3px;
    background-color: #0066cc;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* Remove width: fit-content for mobile to allow centering */
}

.nav-item {
    display: block; /* Use block for full control over width/centering */
    padding: 0.5rem 1rem;
    font-weight: bold;
    font-size: 0.9rem;
    border: 2px solid var(--color-text-dark);
    color: var(--color-text-dark);
    background-color: var(--color-bg);
    transition: all 0.2s ease;
    text-align: center; /* Center text inside the item */
    width: 100px; /* Set a fixed width for both items */
    height: 40px;
    margin: 0 auto; /* Center the item itself on mobile */
}

.nav-item:hover {
    opacity: 0.8;
}

.nav-item.writing {
    background-color: var(--color-link-writing);
    color: white;
    border-color: var(--color-link-writing);
    padding: 0.5rem 1rem; /* Reset padding and rely on text-align: center */
}

.nav-item.about {
    background-color: var(--color-link-about);
    color: white;
    border-color: var(--color-link-about);
    padding: 0.5rem 1rem; /* Reset padding and rely on text-align: center */
}

/* Social Icons */
.social-icons {
    display: flex;
    gap: 0.75rem;
    justify-content: center; /* Center icons on mobile */
    margin-top: 0.5rem;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid var(--color-text-dark);
    background-color: var(--color-bg);
    color: var(--color-text-dark);
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.social-icon:hover {
    background-color: var(--color-text-dark);
    color: var(--color-bg);
}

.social-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

svg {
    visibility: hidden;
}

.loaded svg {
    visibility: visible;
}

/* ============================================
   Main Content Layout
   ============================================ */

.main-content {
    /* Mobile: Main content is full width, stacked sections */
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 100%;
}

.profile-section {
    flex: 1;
    min-width: 50%;
}

.image-wrapper {
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.image-wrapper img {
    display: block;
    width: 100%;
    height: auto;
}

.content-section {
    flex: 1;
}

.content-section h2 {
    font-family: var(--font-body);
    font-size: 26px;
    font-weight: 500;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--color-text-dark);
    padding-bottom: 0.5rem;
    color: var(--color-text-dark);
    font-style: normal;
    line-height: 1.2em;
    letter-spacing: .01em;
}

.content-section p {
    margin-bottom: 1.5rem;
    line-height: 1.6em;
    color: var(--color-text);
    font-weight: 500;
    letter-spacing: .02em;
}

.content-section a {
    color: var(--color-text);
    border-bottom: 1px solid var(--color-text);
}

.content-section a:hover {
    opacity: 0.7;
}

/* ============================================
   Publications Section
   ============================================ */

.publication {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.publication h3 {
    font-family: var(--font-body);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-dark);
}

.publication-meta {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.publication blockquote {
    margin: 1rem 0 1rem 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid #ddd;
    font-style: italic;
    color: var(--color-text);
    line-height: 1.8;
}

/* ============================================
   Awards & Residencies Table
   ============================================ */

.awards-table {
    width: fit-content;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.awards-table th,
.awards-table td {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.awards-table th {
    font-weight: 700;
    background-color: #f9f9f9;
    color: var(--color-text-dark);
}

.awards-table tr:hover {
    background-color: #fafafa;
}

/* ============================================
   Mobile Responsive Design (Mobile-First)
   ============================================ */

@media (min-width: 768px) {
    body {
        padding: 2rem;
    }

    .site-wrapper {
        flex-direction: row; /* Desktop: Side-by-side layout */
        gap: 2rem;
    }

    .header {
        /* Fixed-width left column */
        flex: 0 0 250px; /* Adjust width as needed */
        flex-direction: column;
        gap: 2rem;
        margin-bottom: 0;
        position: sticky; /* Keep it visible */
        top: 2rem; /* Spacing from the top */
        height: fit-content;
    }

    .logo-box {
        width: 100%;
        margin-bottom: 0;
    }
    
.nav-and-social {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center; /* Center nav and social block on mobile */
}

.nav-menu {
    flex-direction: column; /* Stack nav items vertically */
    gap: 0.5rem;
    width: 100%;
    align-items: center; /* Center nav items block on desktop */
}

.nav-item {
    width: 100px; /* Set a fixed width for both items */
    text-align: center;
    padding: 0.5rem 0;
}
    
.nav-item.writing {
    padding: 0.5rem 0;
}
    
.nav-item.about {
    padding: 0.5rem 0;
}

.social-icons {
    margin: 0;
    justify-content: center;
}

    .main-content {
        /* Right column for content */
        flex: 1;
        flex-direction: row;
        gap: 3rem;
    }

    .profile-section {
        flex: 0 0 35%;
    }

    .content-section {
        flex: 1;
    }

    .image-wrapper {
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .site-wrapper {
        gap: 4rem;
    }
    
    .header {
        flex: 0 0 300px; /* Slightly wider column on larger screens */
    }

    .logo-box h1 {
        font-size: 1.75rem;
    }

    .content-section h2 {
        font-size: 1.75rem;
    }
}

/* ============================================
   Print Styles (Optional)
   ============================================ */

@media print {
    body {
        background-color: white;
        color: black;
    }

    .nav-menu,
    .social-icons {
        display: none;
    }
}

