/* ============================================================
   Hi Art Studio — Student Legacy Directory
   Museum-grade, institutional aesthetic
   ============================================================ */

/* ---- Google Font additions (Cormorant Garamond serif) are loaded
        inline in the HTML <head> so this file stays self-contained ---- */

/* =====================================================
   SECTION WRAPPER
   ===================================================== */
#legacy-directory {
    background: #fafaf8;
    /* warm off-white — gallery wall */
    padding: 0 0 6rem 0;
    position: relative;
}

/* thin top rule — institutional separator */
#legacy-directory::before {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(to right, transparent, #c8c0b4 20%, #c8c0b4 80%, transparent);
    margin-bottom: 0;
}

/* =====================================================
   SECTION HEADER — INSTITUTIONAL TYPOGRAPHY
   ===================================================== */
.legacy-header {
    text-align: center;
    padding: 5rem 2rem 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.legacy-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #9e8f7e;
    margin-bottom: 1.25rem;
    display: block;
}

.legacy-title {
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: #1c1a18;
    margin-bottom: 1rem;
}

.legacy-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    color: #6b6158;
    line-height: 1.7;
    max-width: 580px;
    margin: 0 auto;
}

/* =====================================================
   LEGACY STATS BAR
   ===================================================== */
.legacy-stats-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    padding: 1.5rem 2rem;
    margin: 2rem auto 3.5rem;
    max-width: 860px;
    border-top: 1px solid #e0d8d0;
    border-bottom: 1px solid #e0d8d0;
}

.legacy-stat {
    flex: 1;
    text-align: center;
    padding: 0.5rem 1.5rem;
    position: relative;
}

/* vertical dividers between stats */
.legacy-stat + .legacy-stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: #d4ccc4;
}

.legacy-stat-number {
    display: block;
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 600;
    color: #1c1a18;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.legacy-stat-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #9e8f7e;
}

/* =====================================================
   CONTROLS — SEARCH + FILTERS
   ===================================================== */
.legacy-controls {
    max-width: 1320px;
    margin: 0 auto 2.5rem;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Search */
.legacy-search-wrap {
    position: relative;
    max-width: 380px;
}

.legacy-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    opacity: 0.45;
    pointer-events: none;
}

#legacy-search {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: #1c1a18;
    background: #ffffff;
    border: 1px solid #d4ccc4;
    border-radius: 2px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    letter-spacing: 0.01em;
}

#legacy-search::placeholder {
    color: #b0a89e;
}

#legacy-search:focus {
    border-color: #8a7b6e;
    box-shadow: 0 0 0 3px rgba(138, 123, 110, 0.12);
}

/* Filter pills */
.legacy-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.legacy-filter-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #9e8f7e;
    margin-right: 0.5rem;
}

.legacy-filter-btn {
    padding: 0.45rem 1.1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #6b6158;
    background: transparent;
    border: 1px solid #d4ccc4;
    border-radius: 1px;
    cursor: pointer;
    transition: all 0.22s ease;
    white-space: nowrap;
}

.legacy-filter-btn:hover {
    border-color: #8a7b6e;
    color: #1c1a18;
    background: rgba(28, 26, 24, 0.04);
}

.legacy-filter-btn.active {
    background: #1c1a18;
    border-color: #1c1a18;
    color: #fafaf8;
}

/* =====================================================
   DIRECTORY GRID CONTAINER
   ===================================================== */
.legacy-grid-wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 2rem;
    /* Desktop: full height with prominent scrollbar */
    height: 100vh;
    overflow-y: auto;
    /* Subtle custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #b0a89e #f0ece8;
    /* Smooth scroll inside container */
    scroll-behavior: smooth;
}

.legacy-grid-wrap::-webkit-scrollbar {
    width: 8px;
}

.legacy-grid-wrap::-webkit-scrollbar-track {
    background: #f0ece8;
    border-radius: 4px;
}

.legacy-grid-wrap::-webkit-scrollbar-thumb {
    background: #b0a89e;
    border-radius: 4px;
    border: 2px solid #f0ece8;
}

.legacy-grid-wrap::-webkit-scrollbar-thumb:hover {
    background: #8a7b6e;
}

/* The actual grid */
.legacy-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    padding: 0.5rem 0 2rem;
}

/* =====================================================
   STUDENT CARD
   ===================================================== */
.legacy-card {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    /* Entry animation */
    animation: cardReveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* staggered animation via inline --i custom property */
.legacy-card {
    animation-delay: calc(var(--i, 0) * 40ms);
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Thumbnail container — perfect square */
.legacy-card-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #e8e2dc;
    position: relative;
}

.legacy-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    /* Subtle desaturation on rest state */
    filter: saturate(0.88) brightness(0.97);
    transition: filter 0.55s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover overlay — institution-grade fade, not a bounce */
.legacy-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 26, 24, 0);
    transition: background 0.5s ease;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.legacy-card-cta {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #fafaf8;
    border-bottom: 1px solid rgba(250, 250, 248, 0.6);
    padding-bottom: 1px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease 0.08s, transform 0.4s ease 0.08s;
}

/* Hover states — slow, elegant */
.legacy-card:hover .legacy-card-img {
    filter: saturate(1) brightness(0.82);
    transform: scale(1.04);
}

.legacy-card:hover .legacy-card-overlay {
    background: rgba(28, 26, 24, 0.38);
}

.legacy-card:hover .legacy-card-cta {
    opacity: 1;
    transform: translateY(0);
}

/* Name & cohort below the image */
.legacy-card-info {
    padding: 0.75rem 0 0;
}

.legacy-card-name {
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 500;
    color: #1c1a18;
    line-height: 1.2;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.legacy-card-cohort {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9e8f7e;
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.legacy-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.legacy-empty p {
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: 1.4rem;
    color: #9e8f7e;
    font-style: italic;
}

/* =====================================================
   RESULT COUNT
   ===================================================== */
.legacy-result-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 400;
    color: #9e8f7e;
    letter-spacing: 0.06em;
    margin-top: 0.5rem;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1200px) {
    .legacy-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .legacy-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .legacy-stats-bar {
        gap: 0;
    }
}

@media (max-width: 768px) {
    .legacy-header {
        padding: 3.5rem 1.5rem 2rem;
    }

    .legacy-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Mobile: constrained height so user can scroll past the section */
    .legacy-grid-wrap {
        height: auto;
        max-height: 75vh;
        overflow-y: scroll;
    }

    .legacy-controls {
        padding: 0 1.5rem;
    }

    .legacy-stats-bar {
        flex-wrap: wrap;
        gap: 1.5rem;
        border: none;
        padding: 1rem 1.5rem;
    }

    .legacy-stat + .legacy-stat::before {
        display: none;
    }

    .legacy-stat {
        flex: 0 0 calc(50% - 0.75rem);
    }

    .legacy-search-wrap {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .legacy-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .legacy-title {
        font-size: 2rem;
    }
}

/* ============================================================
   GALLERY.HTML — Individual Portfolio Page Styles
   ============================================================ */

/* Page chrome */
.portfolio-body {
    background: #fafaf8;
    font-family: 'Inter', sans-serif;
    color: #1c1a18;
    -webkit-font-smoothing: antialiased;
}

/* top bar */
.portfolio-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2.5rem;
    background: rgba(250, 250, 248, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e0d8d0;
}

.portfolio-topbar-logo {
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: #1c1a18;
    text-decoration: none;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: opacity 0.2s ease;
}

.portfolio-topbar-logo:hover {
    opacity: 0.8;
}

.portfolio-topbar-back {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6b6158;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s ease;
}

.portfolio-topbar-back:hover {
    color: #1c1a18;
}

/* Main layout */
.portfolio-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 7rem 2.5rem 5rem;
}

/* Artist header */
.portfolio-artist-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    align-items: start;
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #e0d8d0;
}

.portfolio-avatar {
    width: 140px;
    height: 140px;
    object-fit: cover;
    object-position: center top;
    /* Square with thin dark border — passport aesthetic */
    border: 2px solid #1c1a18;
}

.portfolio-artist-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.portfolio-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #9e8f7e;
}

.portfolio-artist-name {
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 500;
    line-height: 1;
    color: #1c1a18;
    letter-spacing: -0.02em;
    margin: 0.25rem 0 0.75rem;
}

.portfolio-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.portfolio-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.portfolio-meta-key {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #9e8f7e;
}

.portfolio-meta-val {
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 400;
    color: #3a3430;
}

/* Artist statement */
.portfolio-statement-section {
    margin-bottom: 4rem;
}

.portfolio-section-eyebrow {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #9e8f7e;
    margin-bottom: 1.25rem;
    display: block;
}

.portfolio-statement {
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 400;
    font-style: italic;
    line-height: 1.65;
    color: #2c2826;
    max-width: 760px;
    /* elegant left quote rule */
    padding-left: 2rem;
    border-left: 2px solid #c8c0b4;
}

/* Share bar */
.portfolio-share-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: #f0ece8;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.portfolio-share-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #6b6158;
    flex-shrink: 0;
}

.portfolio-url-display {
    flex: 1;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    color: #6b6158;
    background: transparent;
    border: none;
    outline: none;
    min-width: 0;
    cursor: default;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#copy-portfolio-btn {
    padding: 0.6rem 1.4rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #fafaf8;
    background: #1c1a18;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}

#copy-portfolio-btn:hover {
    background: #3a3430;
}

#copy-portfolio-btn:active {
    transform: scale(0.97);
}

#copy-portfolio-btn.copied {
    background: #5a7a5c;
}

/* Gallery placeholder grid */
.portfolio-gallery-section {
    margin-bottom: 5rem;
}

.portfolio-gallery-heading {
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 500;
    color: #1c1a18;
    margin-bottom: 2rem;
}

.portfolio-works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.portfolio-work-item {
    aspect-ratio: 4 / 3;
    background: #e8e2dc;
    overflow: hidden;
    position: relative;
}

.portfolio-work-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(0.9);
    transition: filter 0.5s ease, transform 0.5s ease;
}

.portfolio-work-item:hover img {
    filter: saturate(1.05);
    transform: scale(1.04);
}

/* Not-found state */
.portfolio-not-found {
    text-align: center;
    padding: 8rem 2rem;
}

.portfolio-not-found h1 {
    font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
    font-size: 2.5rem;
    font-weight: 400;
    color: #6b6158;
    margin-bottom: 1rem;
}

.portfolio-not-found p {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #9e8f7e;
}

.portfolio-not-found a {
    display: inline-block;
    margin-top: 2rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #1c1a18;
    text-decoration: none;
    border-bottom: 1px solid #1c1a18;
    padding-bottom: 2px;
}

/* Portfolio responsive */
@media (max-width: 768px) {
    .portfolio-topbar {
        padding: 0.65rem 1.25rem;
    }

    .portfolio-topbar-logo img {
        height: 38px !important; /* 强制覆盖行内样式里的 68px */
    }

    .portfolio-topbar-back {
        font-size: 0.72rem;
        letter-spacing: 0.05em;
    }

    .portfolio-artist-header {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .portfolio-avatar {
        width: 100px;
        height: 100px;
    }

    .portfolio-main {
        padding: 6rem 1.5rem 4rem;
    }

    .portfolio-works-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-share-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .portfolio-url-display {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .portfolio-works-grid {
        grid-template-columns: 1fr;
    }
}
