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

:root {
    --black:       #000;
    --white:       #fff;
    --gray-100:    #f7f7f7;
    --gray-200:    #e5e5e5;
    --gray-300:    #c2c2c2;
    --gray-500:    #707070;
    --gray-700:    #333;
    --font:        "Helvetica Neue", Helvetica, Arial, sans-serif;
    --max-width:   1440px;
    --transition:  .15s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--white);
    color: var(--black);
    line-height: 1.5;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
button { font-family: var(--font); cursor: pointer; }

/* ===== LAYOUT ===== */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 40px;
}

.section         { padding: 60px 0; }
.section--sm     { padding: 40px 0; }
.section--lg     { padding: 80px 0; }

.section__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid var(--black);
    padding-bottom: 12px;
    margin-bottom: 32px;
    gap: 16px;
}

.section__title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.section__subtitle {
    color: var(--gray-500);
    font-size: .875rem;
    margin-top: 4px;
}

.view-all {
    font-size: .8rem;
    font-weight: 400;
    color: var(--black);
    white-space: nowrap;
    border-bottom: 1px solid var(--black);
    padding-bottom: 1px;
    transition: opacity var(--transition);
}
.view-all:hover { opacity: .6; }

/* ===== HEADER ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--gray-300);
}

.site-header .container {
    display: flex;
    align-items: center;
    height: 56px;
    gap: 0;
}

.logo {
    flex-shrink: 0;
    margin-right: 40px;
}

.logo__text {
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--black);
}

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

.nav-link {
    padding: 0 14px;
    height: 56px;
    display: flex;
    align-items: center;
    font-size: .8rem;
    font-weight: 400;
    color: var(--gray-700);
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
    white-space: nowrap;
}
.nav-link:hover { color: var(--black); }
.nav-link.active { color: var(--black); border-bottom-color: var(--black); }

/* Header Search */
.header-search {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: auto;
    border-left: 1px solid var(--gray-300);
}

.header-search__input {
    width: 200px;
    padding: 0 16px;
    height: 56px;
    border: none;
    font-family: var(--font);
    font-size: .8rem;
    background: transparent;
    color: var(--black);
    outline: none;
}
.header-search__input::placeholder { color: var(--gray-500); }
.header-search__input:focus { background: var(--gray-100); }

.header-search__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: none;
    border: none;
    border-left: 1px solid var(--gray-300);
    color: var(--black);
    transition: background var(--transition);
}
.header-search__btn:hover { background: var(--gray-100); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: auto;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 1px;
    background: var(--black);
}

/* ===== HERO ===== */
.section--hero {
    padding: 0;
    position: relative;
    overflow: hidden;
    background: var(--black);
}

.hero__slide {
    position: relative;
    width: 100%;
    aspect-ratio: 16/7;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
}

.hero__slide-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .75;
}

.hero__slide-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #111 100%);
}

.hero__slide-content {
    position: relative;
    z-index: 1;
    padding: 40px;
    color: var(--white);
    max-width: 640px;
}

.hero__label {
    font-size: .72rem;
    font-weight: 400;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.65);
    margin-bottom: 10px;
}

.hero__title {
    font-size: clamp(1.6rem, 4vw, 3rem);
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 12px;
    color: var(--white);
}

.hero__subtitle {
    font-size: .9rem;
    color: rgba(255,255,255,.75);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* ===== STATS BAR ===== */
.stats-bar {
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
}

.stats-bar__inner {
    display: flex;
    divide-x: 1px solid var(--gray-200);
}

.stats-bar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    border-right: 1px solid var(--gray-200);
    text-decoration: none;
    color: var(--black);
    transition: background var(--transition);
}
.stats-bar__item:last-child { border-right: none; }
.stats-bar__item:hover { background: var(--gray-100); }

.stats-bar__num {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--black);
}

.stats-bar__label {
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ===== ARTWORK CARDS ===== */
.artworks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 32px 24px;
}

.artworks-grid--5 {
    grid-template-columns: repeat(5, 1fr);
}

.artwork-card {
    display: block;
    color: inherit;
}
.artwork-card:hover .artwork-card__image { opacity: .88; }

.artwork-card__image-wrap {
    position: relative;
    overflow: hidden;
    background: var(--gray-100);
    margin-bottom: 12px;
}

.artwork-card__image {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    transition: opacity var(--transition);
}

.artwork-card__image-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
}

.artwork-card__image-placeholder svg {
    width: 48px;
    height: 48px;
}

.artwork-card__body { padding: 0; }

.artwork-card__title {
    font-size: .9rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 2px;
    color: var(--black);
}

.artwork-card__artist {
    font-size: .8rem;
    color: var(--gray-500);
    margin-bottom: 2px;
}

.artwork-card__meta {
    font-size: .75rem;
    color: var(--gray-500);
}

.artwork-card__badge {
    display: none; /* Artsy style: no badge pills */
}

/* ===== ARTIST CARDS ===== */
.artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 32px 24px;
}

.artist-card {
    display: block;
    color: inherit;
}
.artist-card:hover .artist-card__photo,
.artist-card:hover .artist-card__photo-placeholder { opacity: .88; }

.artist-card__photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    background: var(--gray-100);
    margin-bottom: 12px;
    transition: opacity var(--transition);
}

.artist-card__photo-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: opacity var(--transition);
    color: var(--gray-300);
}

.artist-card__body { padding: 0; }

.artist-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.artist-card__flag { font-size: 1rem; }

.artist-card__count {
    font-size: .75rem;
    color: var(--gray-500);
}

.artist-card__name {
    font-size: .9rem;
    font-weight: 400;
    margin-bottom: 2px;
    line-height: 1.3;
}

.artist-card__country {
    font-size: .8rem;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.artist-card__bio {
    font-size: .8rem;
    color: var(--gray-500);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== COUNTRIES GRID ===== */
.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0;
    border-top: 1px solid var(--gray-200);
    border-left: 1px solid var(--gray-200);
}

.country-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    border-right: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
    color: var(--black);
    transition: background var(--transition);
}
.country-card:hover { background: var(--gray-100); }

.country-card__flag { font-size: 1.4rem; flex-shrink: 0; }
.country-card__name { font-size: .875rem; font-weight: 400; }
.country-card__count { font-size: .75rem; color: var(--gray-500); margin-top: 2px; }

.countries-grid--large { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.country-card--large { padding: 24px; }
.country-card--large .country-card__flag { font-size: 1.8rem; }

/* ===== DIVIDER ===== */
.section-divider {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 0;
}

/* ===== CTA SECTION ===== */
.section--cta {
    background: var(--black);
    color: var(--white);
    text-align: center;
    padding: 80px 40px;
}

.section--cta .section__title {
    color: var(--white);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 300;
    margin-bottom: 16px;
}

.section--cta p {
    color: rgba(255,255,255,.6);
    font-size: 1rem;
    margin-bottom: 32px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-family: var(--font);
    font-size: .8rem;
    font-weight: 400;
    letter-spacing: .04em;
    transition: all var(--transition);
    cursor: pointer;
    border-radius: 0;
    text-transform: none;
}

.btn--primary {
    background: var(--black);
    color: var(--white);
    border: 1px solid var(--black);
}
.btn--primary:hover { background: var(--gray-700); border-color: var(--gray-700); }

.btn--outline {
    background: transparent;
    color: var(--black);
    border: 1px solid var(--black);
}
.btn--outline:hover { background: var(--black); color: var(--white); }

.btn--outline-light {
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(255,255,255,.5);
}
.btn--outline-light:hover { background: var(--white); color: var(--black); border-color: var(--white); }

/* ===== PAGE HEADER ===== */
.page-header {
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--gray-200);
}

.page-header__title {
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 6px;
}

.page-header__desc {
    font-size: .875rem;
    color: var(--gray-500);
}

/* ===== FILTERS ===== */
.filters-bar {
    display: flex;
    gap: 0;
    align-items: flex-end;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 40px;
    padding: 24px 0;
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: .68rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--gray-500);
}

.filter-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 0;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23000' d='M5 7L0 2h10z'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    font-family: var(--font);
    font-size: .8rem;
    color: var(--black);
    cursor: pointer;
    min-width: 180px;
}
.filter-select:focus { outline: 1px solid var(--black); }

/* ===== ARTIST DETAIL ===== */
.artist-detail { padding: 48px 0 64px; }

.artist-detail__header {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 56px;
    margin-bottom: 56px;
    align-items: start;
}

.artist-detail__photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.artist-detail__photo-placeholder {
    width: 100%;
    aspect-ratio: 1;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
    font-size: 4rem;
}

.artist-detail__name {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 300;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
    line-height: 1.1;
}

.artist-detail__country {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .875rem;
    color: var(--gray-500);
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.artist-detail__bio {
    font-size: .9rem;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: 20px;
}

.artist-statement {
    font-style: italic;
    font-size: .9rem;
    line-height: 1.7;
    color: var(--gray-700);
    border-left: 2px solid var(--black);
    padding: 4px 0 4px 20px;
    margin: 20px 0;
}

.artist-detail__links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* ===== ARTWORK DETAIL ===== */
.artwork-detail { padding: 48px 0 64px; }

.artwork-detail__layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 56px;
    align-items: start;
}

.artwork-detail__image {
    width: 100%;
    display: block;
}

.artwork-detail__image-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-300);
    font-size: 5rem;
}

.artwork-detail__title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 4px;
}

.artwork-detail__artist-link {
    font-size: .9rem;
    color: var(--gray-700);
    margin-bottom: 24px;
    display: block;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}
.artwork-detail__artist-link:hover { color: var(--black); }

.artwork-detail__meta {
    margin-bottom: 24px;
}

.meta-row {
    display: flex;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: .8rem;
}
.meta-row:first-child { border-top: 1px solid var(--gray-200); }
.meta-label {
    color: var(--gray-500);
    width: 90px;
    flex-shrink: 0;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding-top: 1px;
}

.artwork-detail__desc {
    font-size: .875rem;
    line-height: 1.7;
    color: var(--gray-700);
    margin-bottom: 28px;
}

/* ===== ABOUT PAGE ===== */
.about-content { padding: 56px 0; }
.about-content__inner { max-width: 680px; }
.about-section { margin-bottom: 48px; padding-bottom: 48px; border-bottom: 1px solid var(--gray-200); }
.about-section:last-child { border-bottom: none; }
.about-section h2 { font-size: 1.4rem; font-weight: 300; letter-spacing: -0.02em; margin-bottom: 16px; }
.about-section p { font-size: .9rem; color: var(--gray-700); line-height: 1.8; margin-bottom: 12px; }

/* ===== SEARCH ===== */
.search-form { margin-bottom: 40px; border-bottom: 1px solid var(--gray-200); padding-bottom: 24px; }
.search-form__inner { display: flex; gap: 0; max-width: 600px; }
.search-form__input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--black);
    border-right: none;
    font-family: var(--font);
    font-size: .9rem;
    outline: none;
    border-radius: 0;
}
.search-form__input:focus { outline: none; }
.search-section-title {
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 24px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
    letter-spacing: -0.01em;
}
.search-empty { color: var(--gray-500); padding: 60px 0; font-size: .9rem; }

/* ===== FOOTER ===== */
.site-footer {
    background: var(--black);
    color: rgba(255,255,255,.5);
    padding: 48px 0 32px;
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer__brand .logo__text { color: var(--white); display: block; margin-bottom: 12px; }
.footer__brand p { font-size: .8rem; line-height: 1.6; }

.footer__links h4 {
    color: var(--white);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 400;
    margin-bottom: 16px;
}
.footer__links ul { display: flex; flex-direction: column; gap: 10px; }
.footer__links a { font-size: .8rem; transition: color var(--transition); }
.footer__links a:hover { color: var(--white); }

.footer__bottom {
    font-size: .75rem;
    text-align: center;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-top: 48px;
    border-top: 1px solid var(--gray-200);
    padding-top: 32px;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--gray-200);
    border-right: none;
    font-size: .8rem;
    font-weight: 400;
    transition: all var(--transition);
}
.pagination a:last-child, .pagination span:last-child { border-right: 1px solid var(--gray-200); }
.pagination a:hover { background: var(--gray-100); }
.pagination .active { background: var(--black); color: var(--white); border-color: var(--black); }

/* ===== 404 ===== */
.page-404 {
    text-align: center;
    padding: 120px 24px;
}
.page-404 h1 {
    font-size: 8rem;
    font-weight: 200;
    letter-spacing: -0.05em;
    color: var(--gray-200);
    line-height: 1;
    margin-bottom: 24px;
}
.page-404 h2 { font-size: 1.4rem; font-weight: 300; margin-bottom: 12px; }
.page-404 p { color: var(--gray-500); margin-bottom: 32px; font-size: .9rem; }

/* ===== FLASH ===== */
.flash {
    padding: 14px 20px;
    font-size: .85rem;
    border: 1px solid;
    margin-bottom: 20px;
    border-radius: 0;
}
.flash--success { background: #f0faf4; color: #1a6636; border-color: #a3d9b8; }
.flash--error   { background: #fdf2f2; color: #8b1a1a; border-color: #e8b4b4; }

/* ===== INLINE BREADCRUMB ===== */
.breadcrumb { font-size: .8rem; color: var(--gray-500); margin-bottom: 12px; }
.breadcrumb a { color: var(--gray-500); border-bottom: 1px solid var(--gray-300); }
.breadcrumb a:hover { color: var(--black); border-color: var(--black); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .container { padding: 0 24px; }
    .artworks-grid--5 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
    .artist-detail__header { grid-template-columns: 1fr; }
    .artist-detail__photo, .artist-detail__photo-placeholder { max-width: 240px; }
    .artwork-detail__layout { grid-template-columns: 1fr; }
    .footer__grid { grid-template-columns: 1fr 1fr; }
    .artworks-grid--5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }

    .site-nav {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
        gap: 0;
        border-top: 1px solid var(--gray-200);
        z-index: 200;
        overflow-y: auto;
    }
    .site-nav.open { display: flex; }
    .site-nav .nav-link { height: 48px; padding: 0 4px; font-size: .9rem; width: 100%; border-bottom: 1px solid var(--gray-200); border-right: none; }

    .nav-toggle { display: flex; }
    .header-search { display: none; }

    .hero__slide { aspect-ratio: 4/3; min-height: 300px; }
    .hero__slide-content { padding: 24px; }

    .stats-bar__inner { flex-direction: column; }
    .stats-bar__item { border-right: none; border-bottom: 1px solid var(--gray-200); padding: 16px; }

    .section__header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .footer__grid { grid-template-columns: 1fr; gap: 24px; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filter-select { width: 100%; }
    .artworks-grid--5 { grid-template-columns: repeat(2, 1fr); }
    .artworks-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
    .artists-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
}
