/* =====================
    Hero
   ===================== */

.hero-artwork {
    background-image: url("../imgs/heroes/hero-data-flag.webp");
    background-position: center 5%;
}

/* Two separate hero text blocks (a longer .hero-text-default and a shorter
   .hero-text-compact) are both rendered in markup; only one shows at a time,
   swapped below on short viewports, since truncating the long copy with CSS
   alone couldn't produce genuinely different wording. */
.hero-text-compact {
    display: none;
}

@media (max-height: 900px) {
    .hero-text-default {
        display: none;
    }

    .hero-text-compact {
        display: block;
    }
}

@media (min-width: 1536px) {
    .hero-text p {
        margin-bottom: 12px;
    }
}

/* =====================
    Navigation
   ===================== */

.toolbar {
    display: flex;
    align-items: center;
    gap: 40px;
    min-height: 52px;
}

/* .show-artifacts is toggled on .toolbar by the tab click handler, swapping
   which tab's own search/filter controls are visible in the shared toolbar. */
.toolbar.show-artifacts .collection-controls {
    display: none;
}

.toolbar.show-artifacts .artifact-controls {
    display: flex;
}

.content-switch {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 42px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.collection-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.artifact-controls {
    display: none;
    align-items: center;
    gap: 12px;
    flex: 1;
}

/* .search-box's base style lives in style-common.css; .toolbar-select shares
   .dropdown-button's base look there too. */
.toolbar-select {
    gap: 12px;
    min-width: 120px;
    padding: 0 18px;
}

.toolbar-select i {
    width: 16px;
    height: 16px;
    color: var(--accent-muted);
}

.content-switch-tab {
    width: 128px;
    height: 42px;
    padding: 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: inherit;
    cursor: pointer;
    text-align: center;
    font: inherit;
    font-size: 22px;
    font-weight: 500;
    transition: color .2s;
}

.content-switch-tab:hover {
    color: var(--accent);
}

/* Marks the currently selected collections/artifacts tab, toggled alongside
   .toolbar.show-artifacts by the same click handler. */
.content-switch-tab.active {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

/* =====================
    Collections
   ===================== */

/* =====================
    Artifacts
   ===================== */

.list-card-thumbnail-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: #FAFAF8;
    color: var(--text-faint);
}

.list-card-thumbnail-fallback i {
    width: 28px;
    height: 28px;
    stroke-width: 1.4;
}

.list-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.list-card-header .list-card-tag {
    margin-bottom: 0;
}

.list-card-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.list-card-header-actions .list-card-tag {
    margin-bottom: 0;
}

/* Each action icon sits in a .header-action wrapper. The renderer
   (js/icons.js) swaps the <i> inside it for an <svg>, so the wrapper —
   not the icon itself — is the hover target and tooltip anchor. The svg
   inherits the wrapper's currentColor, so coloring the wrapper colors it. */
.list-card-header-actions .header-action {
    position: relative;
    display: flex;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-muted);
    transition: color .2s, background-color .2s;
}

.list-card-header-actions .header-action svg {
    width: 15px;
    height: 15px;
    stroke-width: 1.8;
}

.list-card-header-actions .header-action:hover,
.list-card-header-actions .header-action.active {
    background: var(--accent-soft);
    color: var(--accent);
    cursor: pointer;
    border-radius: 999px;
}

/* Artifacts without sources/packages yet: the icons read as future
   features, so they stay faded and never pick up the hover accent,
   tooltip, or active state. */
.list-card-header-actions .header-action.header-action-disabled {
    color: var(--text-faint);
    opacity: .5;
}

.list-card-header-actions .header-action.header-action-disabled:hover,
.list-card-header-actions .header-action.header-action-disabled.active {
    background: transparent;
    color: inherit;
    cursor: default;
}

.list-card-header-actions .header-action.header-action-disabled::after {
    opacity: 0 !important;
}

.list-card-header-actions .header-action::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    padding: 6px 10px;
    background: var(--text);
    color: var(--panel);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 1;
}

.list-card-header-actions .header-action:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* =====================
    Sources Panel
   ===================== */

.list-card-content {
    position: relative;
}

.artifact-sources-panel {
    position: absolute;

    width: 100%;

    padding: 8px;

    background: var(--panel);
    border: 1px solid var(--hover-border);
    border-radius: 10px;

    box-shadow:
        4px 6px 14px var(--accent-soft),
        2px 2px 8px var(--accent-soft);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(-4px);

    transition:
        opacity .2s ease,
        transform .2s ease,
        visibility .2s ease;

    z-index: 20;
}

.artifact-sources-panel.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: translateY(0);
}

.source-entry {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 12px;

    border-radius: 8px;

    text-decoration: none;
    color: inherit;

    transition:
        background-color .2s ease,
        color .2s ease;
}

/* Rounded tile behind each entry's type icon. */
.source-entry-icon {
    display: grid;
    place-items: center;
    
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    
    border-radius: 10px;
    background: rgba(28, 30, 42, 0.08);
    color: #41465C;
}

.source-entry-icon i,
.source-entry-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.8;
}

.source-entry-text {
    min-width: 0;
}

.source-entry-link {
    flex-shrink: 0;
    align-self: center;
    margin-left: auto;

    width: 16px;
    height: 16px;
    stroke-width: 1.8;

    color: var(--text-faint);
    transition: color .2s;
}

a.source-entry:hover .source-entry-icon {
    background: var(--accent-soft);
    color: var(--accent);
}

a.source-entry:hover .source-entry-link {
    color: var(--accent);
}

a.source-entry:hover {
    background: var(--accent-soft);
}

.source-title {
    font-family: 'Alegreya Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.source-subtitle {
    margin-top: 2px;

    font-family: 'Alegreya Sans', sans-serif;
    font-size: 12px;
    color: var(--text-muted);
}
