/* ==========================================================================
   About Page Layout & Typography
   ========================================================================== */

/* The main container establishing the split layout */
.about-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + var(--space-xl)) var(--space-sm) var(--space-xl);
}

/* ==========================================================================
   Sidebar (Table of Contents)
   ========================================================================== */
.about-sidebar {
    position: relative;
}

.sidebar-sticky {
    position: sticky;
    top: calc(var(--nav-height) + 40px);
    /* Sticks right below the fixed nav */
}

.sidebar-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toc-link {
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast), padding-left var(--transition-fast);
    display: block;
    position: relative;
}

.toc-link:hover {
    color: var(--text-color);
    padding-left: 5px;
}

.toc-link.active {
    color: var(--text-color);
    font-weight: 700;
}

.toc-link.active::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--text-color);
    border-radius: 50%;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.about-content {
    max-width: 800px;
    min-width: 0;
    /* Prevents CSS grid blowout */
}

.content-section {
    margin-bottom: var(--space-xl);
    scroll-margin-top: calc(var(--nav-height) + 40px);
    /* For smooth scrolling offset */
}

.content-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: var(--space-md);
    text-transform: lowercase;
}

.section-body {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: var(--space-lg);
}

.section-body p {
    margin-bottom: 1.5rem;
}

.section-body p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Images & Media
   ========================================================================== */
.about-image-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.about-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

/* Hover effect on about images */
.about-image-wrapper:hover img {
    transform: scale(1.02);
}

.image-caption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: right;
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
}

/* Image Grid Defaults */
.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    max-width: 500px;
    margin: 0 auto;
    /* Constrain image size slightly so they don't dominate */
}

/* Make image grid wrapper have no bottom margin since grid gap handles it */
.image-grid .about-image-wrapper {
    margin-bottom: 0;
    height: 100%;
    min-width: 0;
    /* Prevents grid blowout from large images */
}

.image-grid .about-image-wrapper img {
    height: 100%;
    /* Ensure all images fill grid cells */
}

.span-2 {
    grid-column: span 2;
}

/* ==========================================================================
   Photo Trolley (Carousel)
   ========================================================================== */
.photo-trolley {
    width: 100%;
    margin-top: var(--space-lg);
    overflow: hidden;
    position: relative;
    padding: var(--space-md) 0;
}

.photo-trolley-track {
    display: flex;
    width: max-content;
    animation: scroll-trolley 40s linear infinite;
}

.photo-trolley-track:hover {
    /* Optional: pauses animation when looking at unrolled images */
    animation-play-state: paused;
}

.photo-trolley-track img {
    height: 220px;
    /* Force uniform height */
    width: auto;
    /* Natural width ratio */
    object-fit: contain;
    margin-right: calc(var(--space-md) / 2);
    flex-shrink: 0;
}

@keyframes scroll-trolley {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* ==========================================================================
   Quotes VStack
   ========================================================================== */
.quotes-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    /* Increased padding between quotes */
}

.quote-card {
    padding: var(--space-md) var(--space-md) var(--space-md) var(--space-xl);
    /* Added right padding */
    margin: 0;
    border-left: 2px solid var(--text-color);
    background-color: transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    word-break: break-word;
    /* Prevent long titles from breaking layout */
}

.quote-card p {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.5;
    margin-bottom: var(--space-sm);
    font-style: italic;
    color: var(--text-color);
}

.quote-card footer {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: right;
}

.quote-card cite {
    font-style: normal;
    color: var(--text-color);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 900px) {
    .about-container {
        grid-template-columns: 200px 1fr;
        gap: var(--space-md);
    }
}

@media (max-width: 768px) {
    .about-container {
        grid-template-columns: minmax(0, 1fr);
        /* Replace 1fr to fix grid blowout */
        padding-top: calc(var(--nav-height) + var(--space-md));
        overflow-x: hidden;
    }

    /* Hide the sticky sidebar on mobile */
    .about-sidebar {
        display: none;
    }

    .about-content {
        width: 100%;
    }

    .section-body {
        font-size: 1.05rem;
    }

    .quotes-grid {
        display: flex;
        flex-direction: column;
        gap: var(--space-md);
    }

    .quote-card {
        padding: var(--space-md) var(--space-sm) var(--space-md) var(--space-md);
    }

    .section-title {
        font-size: clamp(2rem, 8vw, 2.5rem);
        word-break: break-word;
    }
}