/* ========================================
   SEARCH PAGE

   style.css      — the shell
   components.css — album cards, artist cards, chips,
                    show-all and follow buttons
   search.css     — only what is new here
======================================== */


/* ========================================
   HEADING
======================================== */

.search-heading {
    display: flex;
    align-items: baseline;
    gap: 14px;

    margin-bottom: 16px;
}

.search-heading h1 {
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.search-heading span {
    color: var(--muted);

    font-size: 0.76rem;
    letter-spacing: 0.02em;
}


/* ========================================
   TOP RESULT
======================================== */

.top-card {
    position: relative;

    display: block;

    max-width: 340px;

    padding: 20px;

    color: var(--white);

    background: rgba(10, 26, 48, 0.78);

    border: 1px solid var(--line);
    border-radius: var(--radius-medium);

    text-decoration: none;

    transition: 0.25s ease;
}

.top-card:hover {
    border-color: var(--line-bright);
    background: rgba(14, 38, 70, 0.9);

    transform: translateY(-4px);

    box-shadow: 0 20px 40px rgba(0, 88, 190, 0.32);
}

.top-art,
.top-face {
    display: grid;
    place-items: center;

    width: 96px;
    height: 96px;

    margin-bottom: 16px;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 72% 18%,
            rgba(255, 255, 255, 0.42),
            transparent 36%
        ),
        linear-gradient(
            150deg,
            var(--cover-one, #1d5c9e),
            var(--cover-two, #061628)
        );

    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.55);
}

.top-art {
    border-radius: 8px;
}

.top-face {
    color: #f2f8ff;

    border: 1px solid rgba(190, 225, 255, 0.28);
    border-radius: 50%;

    font-size: 1.7rem;
    font-weight: 700;
}

.top-art b {
    padding: 0 10px;

    color: #eaf3ff;

    text-align: center;

    font-size: 0.5rem;
    font-weight: 800;
    line-height: 1.6;
    letter-spacing: 0.16em;

    white-space: pre-line;

    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.top-kind {
    display: block;

    margin-bottom: 6px;

    color: var(--cyan);

    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

.top-card strong {
    display: block;

    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.16;
}

.top-card small {
    display: block;

    margin-top: 7px;

    color: var(--muted);

    font-size: 0.78rem;
}


/* ========================================
   SONG ROWS — an album column between the
   title and the length
======================================== */

.search-header,
.search-tracks article {
    grid-template-columns:
        44px
        46px
        minmax(140px, 1fr)
        minmax(110px, 180px)
        70px
        44px;
}

.from-album {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.from-album a {
    color: var(--muted);

    text-decoration: none;

    border-bottom: 1px solid transparent;

    transition: 0.2s ease;
}

.from-album a:hover {
    color: var(--cyan);

    border-bottom-color: var(--cyan);
}


/* ========================================
   CHIP ROWS — recent searches and the
   start-here genres
======================================== */

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.recent-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 10px 16px;

    color: var(--milk);

    background: rgba(10, 26, 48, 0.7);

    border: 1px solid var(--line);
    border-radius: 999px;

    font-size: 0.78rem;
    font-weight: 600;

    cursor: pointer;
    transition: 0.25s ease;
}

.recent-chip svg {
    width: 14px;
    height: 14px;

    fill: none;
    stroke: var(--muted);
    stroke-width: 1.8;
}

.recent-chip:hover {
    color: var(--white);

    border-color: var(--line-bright);

    transform: translateY(-2px);
}

.recent-chip:hover svg {
    stroke: var(--cyan);
}

.clear-recent {
    margin-left: auto;

    padding: 6px 12px;

    color: var(--muted);

    background: transparent;

    border: 1px solid transparent;
    border-radius: 999px;

    font-size: 0.72rem;
    font-weight: 600;

    cursor: pointer;
    transition: 0.2s ease;
}

.clear-recent:hover {
    color: var(--cyan);

    border-color: var(--line);
}


/* ========================================
   EMPTY STATE
======================================== */

.empty-block {
    display: grid;
    justify-items: center;

    padding: 56px 24px;

    text-align: center;

    background: rgba(10, 26, 48, 0.5);

    border: 1px solid var(--line);
    border-radius: var(--radius-large);
}

.empty-block svg {
    width: 38px;
    height: 38px;

    margin-bottom: 16px;

    fill: none;
    stroke: var(--muted-dark);
    stroke-width: 1.6;
}

.empty-block strong {
    margin-bottom: 7px;

    font-size: 1.05rem;
}

.empty-block small {
    color: var(--muted);

    font-size: 0.82rem;
}


/* ========================================
   SECTIONS THAT HIDE THEMSELVES
======================================== */

#start[hidden],
#empty[hidden],
#recentSection[hidden],
#topSection[hidden],
#songsSection[hidden],
#albumsSection[hidden],
#artistsSection[hidden],
#genresSection[hidden] {
    display: none;
}


/* ========================================
   TABLET
======================================== */

@media (max-width: 1050px) {
    .search-header,
    .search-tracks article {
        grid-template-columns:
            44px
            46px
            minmax(120px, 1fr)
            70px
            44px;
    }

    .from-album {
        display: none;
    }
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 650px) {
    .search-heading {
        margin-bottom: 12px;
    }

    .top-card {
        max-width: none;
    }

    .search-header {
        display: none;
    }

    /* style.css hides the index and the extra columns on a phone */
    .search-tracks article {
        grid-template-columns:
            44px
            minmax(0, 1fr)
            44px;
    }

    .chip-row {
        gap: 8px;
    }

    .empty-block {
        padding: 40px 18px;
    }
}
