@import url('https://fonts.googleapis.com/css?family=Raleway:400,600,700,800&display=swap');

/* ===== Theme ===== */
:root {
    --bg1: #1e2f5e;
    --bg2: #2856a6;
    --ink: #eaf2ff;
    --ink-dim: #cfdcff;
    --ink-muted: #b7c8f4;
    --glass: rgba(34, 54, 104, .22);
    --glass-strong: rgba(34, 54, 104, .35);
    --panel: rgba(29, 44, 84, .85);
    --bdr: rgba(255, 255, 255, .13);
    --bdr-soft: rgba(255, 255, 255, .09);
    --r-lg: 22px;
    --r-md: 14px;
    --r-sm: 10px;
    --sh-lg: 0 12px 48px rgba(34, 54, 104, .18);
    --sh-md: 0 6px 22px rgba(34, 54, 104, .18);
    --sh-sm: 0 3px 12px rgba(34, 54, 104, .12);
    --focus: #8fb3ff;
    --container: 1240px;
    /* nice readable max width */
}

/* ===== Base ===== */
* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: 'Raleway', sans-serif;
    color: var(--ink);
    background: linear-gradient(135deg, var(--bg1), var(--bg2) 90%);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ink);
    text-decoration: none;
    transition: color .15s
}

a:hover {
    color: #fff
}

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-radius: 8px
}

/* ===== Header / Hero ===== */
.search-school-hero {
    position: relative;
    margin-top: 80px;
    padding: clamp(18px, 2vw, 26px) clamp(14px, 4vw, 40px);
    background: linear-gradient(135deg, rgba(30, 47, 94, .35), rgba(40, 86, 166, .28));
    border-bottom: 1px solid var(--bdr-soft);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Center content without changing markup */
.search-school-hero>.search-school-breadcrumbs,
.search-school-hero>.search-bar-wrap,
.search-school-hero>.event-headline {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
}

/* Breadcrumbs */
.search-school-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--ink-muted);
    font-weight: 600;
}

.search-school-breadcrumbs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: .5rem .8rem;
    background: var(--glass);
    border: 1px solid var(--bdr-soft);
    border-radius: 999px;
    /* chip */
    box-shadow: var(--sh-sm);
    transition: background .15s, border .15s, transform .12s;
}

.search-school-breadcrumbs a:hover {
    background: var(--glass-strong);
    border-color: var(--bdr);
    transform: translateY(-1px);
}

/* ===== Search Rail ===== */
.search-bar-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.search-bar-wrap input {
    width: 100%;
    height: 56px;
    /* taller, confident */
    padding: 0 1.1rem;
    font-size: 1.05rem;
    color: var(--ink);
    background: linear-gradient(180deg, rgba(40, 86, 166, .22), rgba(34, 54, 104, .22));
    border: 1.5px solid var(--bdr);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), var(--sh-sm);
    transition: border .17s, background .17s, box-shadow .17s;
}

.search-bar-wrap input::placeholder {
    color: var(--ink-muted);
    opacity: .9
}

.search-bar-wrap input:focus {
    border-color: #97b9ff;
    background: linear-gradient(180deg, rgba(40, 86, 166, .32), rgba(34, 54, 104, .32));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 6px 20px rgba(40, 86, 166, .18);
}

/* Event subhead under the rail */
.event-headline {
    max-width: var(--container);
    margin: 0 auto;
    font-size: .98rem;
    color: var(--ink-muted);
    font-weight: 600;
    letter-spacing: .01em;
    padding-top: 2px;
}

/* ===== Results Grid ===== */
.results-list {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 26px clamp(14px, 4vw, 40px) 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

/* Cards */
.result-card {
    background: var(--panel);
    border: 1.5px solid var(--bdr);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .17s, box-shadow .17s, border-color .17s;
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-lg);
    border-color: rgba(255, 255, 255, .18)
}

/* Uniform thumbnails */
.result-img {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

@supports not (aspect-ratio:1) {
    .result-img::before {
        content: "";
        display: block;
        padding-top: 75%
    }

    .result-img {
        height: 0
    }
}

.result-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .22s ease-out;
}

.result-card:hover .result-img img {
    transform: scale(1.02)
}

.result-meta {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 92px;
}

.result-photographer a {
    font-weight: 800;
    color: var(--ink)
}

.result-event a {
    color: var(--ink-muted);
    font-size: .97rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-date {
    font-size: .85rem;
    color: var(--ink-muted)
}

/* Empty state */
.empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--ink-muted);
    padding: 64px 20px;
    font-size: 1.05rem
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, .78);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    background: #0f1220;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    padding: 12px;
    max-width: 92%;
    max-height: 92%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain
}

.lightbox-download-btn {
    align-self: flex-start;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    background: var(--bg2);
    color: #fff;
    padding: .6rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: .9rem;
    transition: filter .15s
}

.lightbox-download-btn:hover {
    filter: brightness(1.06)
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 11px;
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4e6ab8 30%, var(--bg1) 90%);
    border-radius: 7px;
    border: 2px solid rgba(255, 255, 255, .12)
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7393de 0%, var(--bg2) 90%)
}

html {
    scrollbar-color: #4e6ab8 #212f52;
    scrollbar-width: thin
}

/* ===== Responsive ===== */
@media (max-width:900px) {
    .results-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr))
    }
}

@media (max-width:700px) {
    .search-school-hero {
        gap: 12px
    }

    .results-list {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 14px;
        padding: 18px 16px 28px
    }

    .result-img {
        aspect-ratio: 1/1
    }

    /* chunkier on phones */
}

/* ===== Subtle load-in ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

.search-school-hero,
.results-list,
.result-card {
    animation: fadeUp .28s ease both
}