﻿/* ══════════════════════════════════════════════════════════════════
   SearchResults.razor.css  |  Antologa – Search Results Page
   ══════════════════════════════════════════════════════════════════ */

.sr-wrapper *,
.sr-wrapper *::before,
.sr-wrapper *::after {
    box-sizing: border-box;
}

.sr-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f4f5f3;
    font-family: 'Nunito', sans-serif;
    overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════════════════
   HERO — mirrors exp-hero proportions and alignment
   ══════════════════════════════════════════════════════════════════ */
.sr-hero {
    position: relative;
    width: 100%;
    height: 24vh;
    min-height: 26rem;
    max-height: 38rem;
    overflow: hidden;
    display: flex;
    align-items: flex-end; /* search bar anchors to the bottom, like Explore */
}

.sr-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    display: block;
    transform: scale(1.04);
    animation: srHeroZoom 18s ease-in-out infinite alternate;
}

@keyframes srHeroZoom {
    from {
        transform: scale(1.04) translateX(0);
    }

    to {
        transform: scale(1.10) translateX(-1%);
    }
}

/* Lighter on top, darker at bottom — same 3-stop structure as Explore */
.sr-hero__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient( to bottom, rgba(0, 35, 55, 0.18) 0%, rgba(0, 50, 70, 0.45) 50%, rgba(0, 30, 48, 0.82) 100% );
    z-index: 1;
}

/* Search slot sits at the bottom with breathing room — mirrors exp-hero__body */
.sr-hero__search-slot {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.836rem 2.754rem;
    animation: srFadeUp 0.9s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ══════════════════════════════════════════════════════════════════
   MAIN CONTAINER — true 12-col CSS grid
   ══════════════════════════════════════════════════════════════════ */
.sr-container {
    width: 100%;
    max-width: 130rem;
    margin: 0 auto;
    padding: 2.754rem 1.836rem 6.12rem;
    overflow: hidden;
}

.sr-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 1.6rem;
    align-items: start;
    min-width: 0;
}

/* ── Column placements ────────────────────────────────────────────── */
.sr-ad--left {
    grid-column: 1 / 3;
    min-width: 0;
    overflow: hidden;
}

.sr-sidebar {
    grid-column: 3 / 5;
    min-width: 0;
    overflow: hidden;
}

.sr-main {
    grid-column: 5 / 11;
    min-width: 0;
    overflow: hidden;
}

.sr-ad--right {
    grid-column: 11 / 13;
    min-width: 0;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════
   TOOLBAR
   ══════════════════════════════════════════════════════════════════ */
.sr-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.918rem;
    margin-bottom: 1.836rem;
    animation: srFadeIn 0.4s 0.25s ease both;
    min-width: 0;
    overflow: hidden;
}

.sr-toolbar__left {
    display: flex;
    align-items: center;
    min-width: 0;
}

.sr-toolbar__right {
    display: flex;
    align-items: center;
    gap: 0.765rem;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

/* ── Result count ─────────────────────────────────────────────────── */
.sr-count {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9562rem;
    color: #9a9a95;
    font-weight: 600;
    white-space: nowrap;
}

.sr-count__query {
    color: var(--antologa-dark);
    font-weight: 700;
}

/* ── Sort select dropdown ─────────────────────────────────────────── */
.sr-sort-select {
    min-width: 13rem;
    max-width: 16rem;
    font-size: 0.9562rem !important;
}

/* ── Grid / List view toggle — mirrors exp-sort-group container ───── */
.sr-view-toggle {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #e0dfd9;
    border-radius: 0.612rem;
    padding: 0.2295rem;
    gap: 0.153rem;
    flex-shrink: 0;
}

.sr-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 0.3825rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

    .sr-view-btn:hover {
        background: #f4f5f3;
    }

.sr-view-btn--on {
    background: var(--antologa-primary);
    box-shadow: 0 2px 10px rgba(7, 130, 130, 0.26);
}

.sr-view-icon {
    font-size: 1.224rem !important;
    color: #7a7a75 !important;
    transition: color 0.2s ease !important;
}

.sr-view-btn--on .sr-view-icon {
    color: #ffffff !important;
}

/* ── Mobile filter toggle — mirrors .exp-filter-toggle exactly ────── */
.sr-filter-toggle {
    display: none;
    align-items: center;
    gap: 0.459rem;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9562rem;
    font-weight: 700;
    color: var(--antologa-dark);
    background: #ffffff;
    border: 1.5px solid #e0dfd9;
    border-radius: 0.612rem;
    padding: 0.5em 1.2em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

    .sr-filter-toggle:hover {
        border-color: var(--antologa-primary);
        color: var(--antologa-primary);
    }

.sr-filter-toggle__icon {
    font-size: 1.224rem !important;
}

/* ══════════════════════════════════════════════════════════════════
   SPINNER
   ══════════════════════════════════════════════════════════════════ */
.sr-spinner-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
    padding: 6rem 2rem;
}

.sr-spinner {
    color: var(--antologa-primary) !important;
}

.sr-spinner-label {
    font-family: 'Nunito', sans-serif !important;
    font-size: 1rem !important;
    color: #9a9a95 !important;
}

/* ══════════════════════════════════════════════════════════════════
   EMPTY STATE — mirrors .exp-empty
   ══════════════════════════════════════════════════════════════════ */
.sr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 4.59rem 1.53rem;
    gap: 0.918rem;
}

.sr-empty__icon {
    font-size: 3.672rem !important;
    color: var(--antologa-light-gray) !important;
}

.sr-empty__title {
    font-family: 'Inter', sans-serif !important;
    font-weight: 700 !important;
    color: var(--antologa-dark) !important;
    font-size: 1.377rem !important;
}

.sr-empty__sub {
    color: #9a9a95 !important;
    font-size: 1.071rem !important;
    max-width: 36rem;
}

.sr-empty__reset {
    margin-top: 0.612rem;
    font-family: 'Nunito', sans-serif;
    font-size: 0.9945rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--antologa-primary);
    border: none;
    border-radius: 7.65rem;
    padding: 0.7em 2em;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .sr-empty__reset:hover {
        background: var(--antologa-secondary);
    }

/* ══════════════════════════════════════════════════════════════════
   CARD GRID — mirrors .exp-card-grid
   ══════════════════════════════════════════════════════════════════ */
.sr-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.224rem;
    animation: srFadeIn 0.4s 0.1s ease both;
    min-width: 0;
    overflow: hidden;
}

.sr-card-list {
    display: flex;
    flex-direction: column;
    gap: 1.224rem;
    animation: srFadeIn 0.4s 0.1s ease both;
    min-width: 0;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════════ */
.sr-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 2.754rem;
    flex-wrap: wrap;
}

.sr-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    border: 1.5px solid #e0dfd9;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.22s ease;
    padding: 0;
}

    .sr-page-btn:hover:not(:disabled) {
        border-color: var(--antologa-primary);
        background: var(--antologa-primary);
    }

        .sr-page-btn:hover:not(:disabled) .sr-page-icon {
            color: #ffffff !important;
        }

    .sr-page-btn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

.sr-page-icon {
    font-size: 1.8rem !important;
    color: #7a7a75 !important;
    transition: color 0.22s ease !important;
}

.sr-page-num {
    min-width: 3.6rem;
    height: 3.6rem;
    border-radius: 50%;
    border: 1.5px solid #e0dfd9;
    background: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #7a7a75;
    cursor: pointer;
    transition: all 0.22s ease;
    padding: 0 0.4rem;
}

    .sr-page-num:hover {
        border-color: var(--antologa-primary);
        color: var(--antologa-primary);
    }

.sr-page-num--on {
    background: var(--antologa-primary);
    border-color: var(--antologa-primary);
    color: #ffffff;
}

/* ══════════════════════════════════════════════════════════════════
   KEYFRAMES
   ══════════════════════════════════════════════════════════════════ */
@keyframes srHeroZoom {
    from {
        transform: scale(1.04) translateX(0);
    }

    to {
        transform: scale(1.10) translateX(-1%);
    }
}

@keyframes srFadeUp {
    from {
        opacity: 0;
        transform: translateY(1.53rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes srFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE — mirrors Explore breakpoints exactly
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 1279px) {
    .sr-ad--left,
    .sr-ad--right {
        display: none !important;
    }

    .sr-sidebar {
        grid-column: 1 / 4;
        top: 7rem;
    }

    .sr-main {
        grid-column: 4 / 13;
    }

    .sr-filter-toggle {
        display: inline-flex;
    }
}

@media (max-width: 959px) {
    .sr-sidebar {
        display: none;
    }

    .sr-main {
        grid-column: 1 / 13 !important;
    }

    .sr-container {
        padding: 2rem 1.4rem 5rem;
    }

    .sr-hero {
        height: 55vw;
        min-height: 22rem;
        max-height: 36rem;
    }

    .sr-card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.2rem;
    }
}

@media (max-width: 768px) {
    .sr-card-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .sr-card-list {
        gap: 1rem;
    }

    .sr-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .sr-toolbar__right {
        width: 100%;
        justify-content: space-between;
    }

    .sr-view-toggle {
        display: none;
    }

    .sr-sort-select {
        min-width: 0;
        flex: 1;
    }
}

@media (max-width: 480px) {
    .sr-hero {
        height: 100dvh;
        min-height: 0;
        max-height: none;
    }

    .sr-container {
        padding: 1.4rem 1rem 4rem;
    }

    .sr-count {
        font-size: 0.85rem;
    }

    .sr-filter-toggle {
        font-size: 0.85rem;
        padding: 0.45em 0.9em;
    }

    .sr-pagination {
        gap: 0.3rem;
    }

    .sr-page-btn,
    .sr-page-num {
        width: 3.1rem;
        height: 3.1rem;
        min-width: 3.1rem;
        font-size: 0.82rem;
    }
}
