/* ============================================================
   Catalogue Raisonné - Public Site Styles
   Noguchi-inspired minimal design
   ============================================================ */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-text: #333230;
    --color-text-muted: #888;
    --color-bg: #ffffff;
    --color-bg-alt: #f7f7f5;
    --color-border: #e0e0e0;
    --color-border-light: #eee;
    --color-accent: #333230;
    --color-link: #555;
    --color-success: #27ae60;
    --color-danger: #c0392b;
    --color-warning: #f39c12;
    --font-serif: 'Noto Serif JP', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
    --font-sans: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
    --font-en: 'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
    --max-width: 1300px;
}

html { font-size: 16px; }
body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    font-weight: 300;
}

a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-text); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 400; line-height: 1.3; }

/* Utility */
.header-wrap, .footer-wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 40px; }

/* Buttons */
.btn {
    display: inline-block; padding: 10px 28px; font-size: 0.85rem; font-weight: 400;
    cursor: pointer; border: 1px solid var(--color-border); text-decoration: none;
    color: var(--color-text); background: transparent; transition: all 0.2s; letter-spacing: 0.05em;
    font-family: var(--font-sans); line-height: 1.4;
}
.btn:hover { border-color: var(--color-text); color: var(--color-text); text-decoration: none; }
.btn-primary { background: var(--color-text); color: #fff; border-color: var(--color-text); }
.btn-primary:hover { background: #1a1918; color: #fff; }
.btn-outline { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn-outline:hover { border-color: var(--color-text); }
.btn-lg { padding: 14px 36px; font-size: 0.9rem; }
.btn-sm { padding: 6px 16px; font-size: 0.8rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* Forms */
.form-control {
    width: 100%; padding: 10px 14px; border: 1px solid var(--color-border);
    font-size: 0.9rem; font-family: var(--font-sans); font-weight: 300;
    background: var(--color-bg); color: var(--color-text);
}
.form-control:focus { outline: none; border-color: var(--color-text); }
.form-control-lg { padding: 14px 18px; font-size: 1rem; }
label { display: block; font-size: 0.8rem; font-weight: 400; margin-bottom: 4px; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* Badges */
.badge {
    display: inline-block; padding: 2px 10px; font-size: 0.7rem; font-weight: 400;
    background: var(--color-bg-alt); color: var(--color-text-muted); letter-spacing: 0.03em;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-muted { background: #e9ecef; color: #6c757d; }
.badge-sm { font-size: 0.65rem; padding: 1px 8px; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
    background: var(--color-bg);
}

.header-top {
    padding: 20px 0 12px;
    text-align: center;
}

.site-logo {
    font-family: var(--font-en);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: 0.12em;
}
.site-logo:hover { color: var(--color-text); text-decoration: none; }

.header-title-bar {
    padding: 16px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    text-align: center;
}

.site-headline {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--color-text);
}
.site-headline a { color: var(--color-text); text-decoration: none; }
.site-headline a:hover { text-decoration: none; }

/* Header Nav */
.header-nav {
    border-bottom: 1px solid var(--color-border);
    padding: 0;
}

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

.nav-left {
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-family: var(--font-en);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text-muted);
    text-decoration: none;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.2s;
}
.nav-link:hover { color: var(--color-text); text-decoration: none; }

.nav-browse {
    font-family: var(--font-en);
    color: var(--color-text);
    font-weight: 500;
    margin-right: 16px;
    padding-right: 16px;
    border-right: 1px solid var(--color-border);
}

.nav-search-form {
    display: flex;
    align-items: center;
    position: relative;
}

.nav-search-input {
    border: 1px solid var(--color-border);
    padding: 7px 36px 7px 12px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    font-weight: 300;
    width: 220px;
    background: var(--color-bg);
    color: var(--color-text);
}
.nav-search-input:focus { outline: none; border-color: var(--color-text); }
.nav-search-input::placeholder { color: #bbb; }

.nav-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
}
.nav-search-btn:hover { color: var(--color-text); }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 24px;
    position: relative;
    padding: 0;
}
.nav-toggle span {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--color-text);
    position: absolute;
    left: 0;
    transition: all 0.3s;
}
.nav-toggle span:first-child { top: 4px; }
.nav-toggle span:last-child { bottom: 4px; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    margin-top: 80px;
    padding: 32px 0;
    border-top: 1px solid var(--color-border);
}

.footer-content {
    text-align: center;
}

.footer-copy {
    font-family: var(--font-en);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
}

/* ============================================================
   Home Page
   ============================================================ */
.home-hero {
    text-align: center;
    padding: 80px 40px 60px;
    max-width: var(--max-width);
    margin: 0 auto;
}
.home-hero-title {
    font-family: var(--font-en);
    font-size: 2.2rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
}
.home-hero-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    letter-spacing: 0.15em;
    margin-bottom: 24px;
    font-weight: 300;
}
.home-hero-stats {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 40px;
    font-weight: 300;
}
.home-hero-stats strong {
    color: var(--color-text);
    font-weight: 500;
    font-size: 1.1rem;
}
.home-hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Home Categories */
.home-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}
.home-section + .home-section { margin-top: 60px; }

.home-section-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 400;
    text-align: center;
    letter-spacing: 0.08em;
    margin-bottom: 32px;
    color: var(--color-text-muted);
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
}
.category-tab {
    display: inline-block;
    padding: 8px 20px;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text-muted);
    text-decoration: none;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.category-tab:hover { color: var(--color-text); text-decoration: none; }
.category-tab.active {
    color: var(--color-text);
    border-color: var(--color-border);
    font-weight: 500;
}
.category-tab .tab-count {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-left: 2px;
}

.home-section-action {
    text-align: center;
    margin-top: 40px;
}

/* ============================================================
   Catalog Page
   ============================================================ */
.catalog-page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

/* Category Tabs */
.catalog-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border);
}
.catalog-tab {
    display: inline-block;
    padding: 8px 24px;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--color-text-muted);
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.2s;
    white-space: nowrap;
}
.catalog-tab:hover { color: var(--color-text); text-decoration: none; }
.catalog-tab.active {
    color: var(--color-text);
    font-weight: 500;
}

/* Catalog Info Bar */
.catalog-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--color-border-light);
}

.catalog-results-count {
    font-size: 0.9rem;
    color: var(--color-text);
    font-weight: 300;
}
.catalog-results-count strong {
    font-weight: 500;
}

.catalog-filters-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filter-label {
    font-family: var(--font-en);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
}

.filter-dropdown {
    position: relative;
    display: inline-block;
}

.filter-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    cursor: pointer;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: var(--font-en);
    transition: border-color 0.2s;
}
.filter-dropdown-btn:hover { border-color: var(--color-text); }
.filter-dropdown-btn .plus {
    font-size: 1rem;
    line-height: 1;
    font-weight: 300;
}

.filter-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    min-width: 200px;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.filter-dropdown-menu.open { display: block; }

.filter-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 300;
    border-bottom: 1px solid var(--color-border-light);
}
.filter-dropdown-menu a:last-child { border-bottom: none; }
.filter-dropdown-menu a:hover { background: var(--color-bg-alt); }
.filter-dropdown-menu a.active { font-weight: 500; }

/* Sort dropdown */
.sort-dropdown {
    position: relative;
    display: inline-block;
}
.sort-dropdown select {
    appearance: none;
    padding: 8px 32px 8px 12px;
    font-size: 0.8rem;
    font-family: var(--font-sans);
    font-weight: 300;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    background: var(--color-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E") no-repeat right 10px center;
    cursor: pointer;
    letter-spacing: 0.03em;
}
.sort-dropdown select:focus { outline: none; border-color: var(--color-text); }

/* ============================================================
   Works Grid (Masonry-style)
   ============================================================ */
.works-grid {
    column-count: 3;
    column-gap: 24px;
    padding: 32px 0;
}

.work-card {
    break-inside: avoid;
    margin-bottom: 32px;
    display: inline-block;
    width: 100%;
}

.work-card-link {
    display: block;
    text-decoration: none;
    color: var(--color-text);
}
.work-card-link:hover { text-decoration: none; }
.work-card-link:hover .work-card-image img {
    opacity: 0.85;
    transition: opacity 0.3s;
}

.work-card-image {
    overflow: hidden;
    background: var(--color-bg-alt);
    line-height: 0;
}
.work-card-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s;
}

.no-image {
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 0.8rem;
    background: var(--color-bg-alt);
}

.work-card-info {
    padding: 12px 0 0;
}
.work-card-number {
    font-family: var(--font-en);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
    font-weight: 400;
}
.work-card-title {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 400;
    margin: 2px 0 4px;
    line-height: 1.4;
    font-style: italic;
}
.work-card-meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 300;
}
.work-card-category {
    margin-left: 8px;
}

/* ============================================================
   Work Detail Page
   ============================================================ */
.work-detail {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

.breadcrumb {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 32px;
    padding-top: 24px;
    font-weight: 300;
}
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-text); }

.work-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.work-images {
    position: sticky;
    top: 24px;
    align-self: start;
}
.work-primary-image {
    background: var(--color-bg-alt);
    overflow: hidden;
    margin-bottom: 12px;
    line-height: 0;
}
.work-primary-image img { width: 100%; cursor: zoom-in; }
.work-thumbnails { display: flex; gap: 8px; flex-wrap: wrap; }
.work-thumb {
    width: 72px; height: 72px; border: 2px solid transparent;
    overflow: hidden; cursor: pointer; background: none; padding: 0; position: relative;
}
.work-thumb.active { border-color: var(--color-text); }
.work-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-type {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.6); color: #fff; font-size: 0.55rem;
    text-align: center; padding: 1px;
}
.no-image-lg {
    background: var(--color-bg-alt); aspect-ratio: 4/3;
    display: flex; align-items: center; justify-content: center;
    color: #ccc; font-size: 0.9rem;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.92);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.25s ease;
    cursor: zoom-out;
}
.lightbox-overlay.active { opacity: 1; }
.lightbox-overlay img {
    max-width: 90vw; max-height: 90vh;
    object-fit: contain;
    user-select: none; -webkit-user-drag: none;
}
.lightbox-close {
    position: absolute; top: 20px; right: 24px;
    background: none; border: none; color: #fff;
    font-size: 2rem; cursor: pointer; line-height: 1;
    font-family: var(--font-en); font-weight: 300;
    opacity: 0.7; transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }

.work-header { margin-bottom: 32px; }
.work-catalog-number {
    font-family: var(--font-en);
    font-size: 0.8rem; color: var(--color-text-muted);
    letter-spacing: 0.1em; font-weight: 400;
}
.work-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
    margin: 4px 0 8px;
}
.work-title-en {
    font-family: var(--font-en);
    font-size: 1rem; color: var(--color-text-muted);
    font-style: italic; font-weight: 400;
}
.work-alt-titles {
    font-size: 0.85rem; color: var(--color-text-muted); margin-top: 4px; font-weight: 300;
}

.work-data {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 2px 20px;
    font-size: 0.9rem;
    font-weight: 300;
}
.work-data dt {
    color: var(--color-text-muted);
    font-weight: 400;
    padding: 6px 0;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}
.work-data dd { padding: 6px 0; }

.work-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border-light);
}
.work-section h2 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    font-weight: 400;
    letter-spacing: 0.05em;
}

.provenance-list { list-style: decimal; padding-left: 24px; }
.provenance-list li { padding: 8px 0; font-size: 0.9rem; line-height: 1.6; font-weight: 300; }
.prov-location { color: var(--color-text-muted); }
.prov-date { color: var(--color-text-muted); margin-left: 4px; }
.prov-method { font-style: italic; color: var(--color-text-muted); font-size: 0.85rem; }

.reference-list { list-style: none; }
.reference-list li {
    padding: 10px 0; font-size: 0.9rem; line-height: 1.6; font-weight: 300;
    border-bottom: 1px solid var(--color-border-light);
}
.reference-list li:last-child { border-bottom: none; }
.ref-year { color: var(--color-text-muted); margin-right: 8px; }
.auth-text, .archive-note {
    font-size: 0.85rem; color: var(--color-text-muted); margin-top: 4px; line-height: 1.5; font-weight: 300;
}

/* ============================================================
   Search Page
   ============================================================ */
.search-page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 40px 0;
}
.search-page h1 {
    font-size: 1.3rem;
    margin-bottom: 24px;
    font-weight: 400;
    letter-spacing: 0.05em;
}
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.search-bar .form-control { flex: 1; }

.advanced-search { margin-bottom: 24px; }
.advanced-search summary {
    cursor: pointer; font-size: 0.8rem;
    color: var(--color-text-muted); letter-spacing: 0.05em;
}
.advanced-search summary:hover { color: var(--color-text); }
.advanced-fields { padding-top: 16px; }
.search-results-info {
    font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 16px; font-weight: 300;
}

/* ============================================================
   Artist Page
   ============================================================ */
.artist-page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}
.artist-header {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 40px;
    padding-top: 16px;
}
.artist-portrait {
    width: 200px;
    flex-shrink: 0;
    overflow: hidden;
    line-height: 0;
}
.artist-info h1 {
    font-size: 2rem;
    font-weight: 400;
}
.artist-name-en {
    font-size: 1rem;
    color: var(--color-text-muted);
    font-style: italic;
    font-weight: 300;
}
.artist-dates {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 8px;
    font-weight: 300;
}
.artist-biography { margin-top: 32px; }
.artist-biography h2 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: 400;
}
.biography-text {
    line-height: 1.9;
    font-size: 0.95rem;
    font-weight: 300;
}
.artist-works-link { margin-top: 40px; }

/* Error Page */
.error-page-content {
    text-align: center;
    padding: 100px 40px;
    max-width: var(--max-width);
    margin: 0 auto;
}
.error-page-content h1 { font-size: 4rem; color: #ddd; font-weight: 300; }
.error-page-content p { font-size: 1rem; color: var(--color-text-muted); margin: 16px 0 32px; font-weight: 300; }

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 0;
    color: var(--color-text-muted);
    font-weight: 300;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 48px;
    padding-bottom: 20px;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--color-border);
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--color-text);
    text-decoration: none;
    transition: border-color 0.2s;
}
.page-link:hover { border-color: var(--color-text); text-decoration: none; }
.page-link.active {
    background: var(--color-text);
    color: #fff;
    border-color: var(--color-text);
}
.page-dots { padding: 0 8px; color: var(--color-text-muted); }

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.form-group { margin-bottom: 12px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .works-grid { column-count: 2; }
}

@media (max-width: 768px) {
    .header-wrap, .footer-wrap,
    .catalog-page, .work-detail, .search-page, .artist-page,
    .home-hero, .home-section { padding-left: 20px; padding-right: 20px; }

    .home-hero { padding-top: 48px; padding-bottom: 40px; }
    .home-hero-title { font-size: 1.6rem; }
    .home-hero-actions { flex-direction: column; align-items: center; }

    /* Header */
    .nav-toggle { display: block; }
    .nav-inner {
        display: none;
        flex-direction: column;
        height: auto;
        padding: 16px 0;
        gap: 16px;
    }
    .nav-inner.active { display: flex; }
    .nav-left { flex-direction: column; gap: 12px; width: 100%; }
    .nav-right { flex-direction: column; gap: 12px; width: 100%; }
    .nav-browse { border-right: none; margin-right: 0; padding-right: 0; }
    .nav-search-input { width: 100%; }
    .nav-search-form { width: 100%; }

    /* Catalog */
    .catalog-tabs { flex-wrap: wrap; gap: 0; }
    .catalog-tab { padding: 8px 12px; font-size: 0.8rem; }
    .catalog-info-bar { flex-direction: column; gap: 12px; align-items: flex-start; }

    .works-grid { column-count: 2; column-gap: 16px; }
    .work-card { margin-bottom: 20px; }

    /* Work detail */
    .work-detail-grid { grid-template-columns: 1fr; gap: 32px; }
    .work-images { position: static; }
    .work-data { grid-template-columns: 80px 1fr; }

    /* Artist */
    .artist-header { flex-direction: column; }

    /* Search */
    .search-bar { flex-direction: column; }

    /* Category tabs */
    .category-tabs { gap: 4px; }
}

@media (max-width: 480px) {
    .works-grid { column-count: 1; }
    .site-logo { font-size: 1.3rem; }
    .site-headline { font-size: 0.9rem; }
}
