/* ============================================================
   Artist Index — A–Z Accordion Styles
   ============================================================ */

/* ---- Container ---- */
.artist-index {
    max-width: 960px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
}

/* ---- Popular Artists ---- */
.artist-popular {
    margin-bottom: 32px;
    padding: 20px 24px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
}

.artist-popular-heading {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 700;
    color: #92400e;
}

.artist-popular-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}

.artist-popular-item {
    margin: 0;
    padding: 0;
}

.artist-popular-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    text-decoration: none;
    color: #374151;
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.artist-popular-link:hover {
    border-color: #f59e0b;
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.2);
    color: #1d4ed8;
}

.artist-popular-portrait {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.artist-popular-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    display: block;
}

.artist-popular-name {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}

.artist-popular-years {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
}

/* ---- Search Box ---- */
.artist-search-wrap {
    position: relative;
    margin-bottom: 24px;
}

.artist-search-input {
    width: 100%;
    padding: 14px 48px 14px 18px;
    font-size: 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.artist-search-input:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
    background: #fff;
}

.artist-search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0.4;
    pointer-events: none;
}

/* ---- A–Z Navigation ---- */
.artist-az-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 28px;
    position: sticky;
    top: 0;
    background: #fff;
    padding: 12px 0;
    z-index: 10;
    border-bottom: 1px solid #e5e7eb;
}

.artist-az-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #374151;
    background: #f3f4f6;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.artist-az-link:hover,
.artist-az-link:focus {
    background: #1d4ed8;
    color: #fff;
    text-decoration: none;
}

.artist-az-link:focus-visible {
    outline: 3px solid rgba(29, 78, 216, 0.5);
    outline-offset: 2px;
}

.artist-az-link.empty {
    color: #cbd5e1;
    background: #f9fafb;
    cursor: default;
    pointer-events: none;
    opacity: 0.5;
}

/* ---- Sections ---- */
.artist-sections {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.artist-section {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s;
}

.artist-section:has(.artist-letter-toggle[aria-expanded="true"]) {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* ---- Toggle Button ---- */
.artist-letter-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 16px 20px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
    background: #fafafa;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.artist-letter-toggle:hover {
    background: #f0f4ff;
}

.artist-letter-toggle:focus-visible {
    outline: 3px solid rgba(29, 78, 216, 0.5);
    outline-offset: -2px;
}

.letter-label {
    font-size: 22px;
    font-weight: 800;
    color: #1d4ed8;
    min-width: 30px;
}

.artist-count {
    font-size: 13px;
    color: #6b7280;
    font-weight: 400;
}

.toggle-icon {
    margin-left: auto;
    font-size: 20px;
    font-weight: 300;
    color: #9ca3af;
    transition: transform 0.25s;
}

.artist-letter-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(45deg);
}

/* ---- Artist List ---- */
.artist-list {
    padding: 0 20px 16px;
}

.artist-list[hidden] {
    display: none;
}

.artist-list-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px 24px;
}

.artist-item {
    margin: 0;
    padding: 0;
}

.artist-item-link {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 0;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.artist-item-link:hover {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
}

.artist-item-name {
    font-weight: 500;
}

.artist-item-years {
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

/* ---- Empty State ---- */
.artist-index-empty {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-size: 16px;
}

/* ---- No results (applied by JS) ---- */
.artist-item.hidden-by-search {
    display: none;
}

.artist-section.hidden-by-search {
    display: none;
}

/* ---- Search highlight ---- */
.artist-item mark {
    background: #fef08a;
    color: #1f2937;
    border-radius: 2px;
    padding: 0 2px;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .artist-search-input {
        padding: 12px 40px 12px 14px;
        font-size: 15px;
    }

    .artist-az-nav {
        gap: 4px;
        padding: 8px 0;
    }

    .artist-az-link {
        min-width: 30px;
        height: 30px;
        font-size: 12px;
        border-radius: 4px;
    }

    .artist-letter-toggle {
        padding: 12px 14px;
        font-size: 15px;
    }

    .letter-label {
        font-size: 18px;
    }

    .artist-list-grid {
        grid-template-columns: 1fr;
    }

    .artist-popular {
        padding: 14px 16px;
    }

    .artist-popular-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Archive page header ---- */
.artist-archive-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.artist-archive-portrait {
    flex-shrink: 0;
}

.artist-portrait-img {
    border-radius: 6px;
    max-width: 200px;
    height: auto;
    display: block;
}

.artist-archive-info {
    flex: 1;
}

.artist-archive-years {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 8px;
}

.artist-archive-bio {
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
}

.artist-title-years {
    font-weight: 400;
    color: #6b7280;
    font-size: 0.8em;
}

@media (max-width: 600px) {
    .artist-archive-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .artist-portrait-img {
        max-width: 150px;
    }
}
