/* Design tokens, base type and the event search box.
 *
 * Every events page links this file first, so the tokens declared here feed
 * filters.css, cards.css and home.css as well.
 */

/* Figtree, self-hosted so the page never waits on a third-party request. */
@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("fonts/figtree-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
        U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
        U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("fonts/figtree-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
        U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
        U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F,
        U+A720-A7FF;
}

:root {
    --ink: #16241b;
    --muted: #4f5d54;
    --canvas: #f6f7f3;
    --surface: #ffffff;
    --line: #c9d3cb;
    --chip: #e7ede6;
    --leaf: #1f6b45;
    --leaf-dark: #154d34;
    --focus: #f2b632;
    --error: #b42318;
    --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
        Arial, sans-serif;
    --page-width: 1200px;
    --radius-card: 18px;
    --radius-pill: 999px;
    --touch: 44px;
}

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

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--canvas);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--leaf);
}

img {
    max-width: 100%;
}

:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

/* ---------- Search box ---------- */

.event-search {
    margin: 0 0 28px;
}

.search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.search-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 5px 5px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    box-shadow: 0 1px 2px rgba(22, 36, 27, 0.05);
}

.search-controls:focus-within {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.search-icon {
    display: inline-flex;
    flex: none;
    color: var(--muted);
}

.search-controls input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: var(--touch);
    padding: 0 4px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 1.05rem;
    color: var(--ink);
}

.search-controls input::placeholder {
    color: var(--muted);
    opacity: 1;
}

.search-controls input:focus-visible {
    outline: none;
}

.search-controls button {
    flex: none;
    min-height: var(--touch);
    padding: 0 24px;
    border: 0;
    border-radius: var(--radius-pill);
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--leaf);
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-controls button:hover {
    background: var(--leaf-dark);
}

/* ---------- Search results page ---------- */

.search-page {
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.search-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 20px;
}

.search-header h1 {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.search-back {
    font-weight: 600;
    text-decoration: none;
}

.search-back:hover {
    text-decoration: underline;
}

/* How a plain-language search was read, e.g. "Kids & Family · Brooklyn". */
.understood {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
}

.understood p {
    margin: 0;
    color: var(--muted);
}

.understood-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.understood-terms li {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: var(--chip);
    font-weight: 600;
}

.understood a {
    color: var(--leaf);
    font-size: 0.95rem;
}

.search-heading {
    margin: 32px 0 4px;
    font-size: 1.35rem;
    letter-spacing: -0.01em;
}

.result-count {
    margin: 0;
    color: var(--muted);
}

.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 20px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.search-results > li {
    display: flex;
}

.search-results .event {
    flex: 1 1 auto;
    color: var(--ink);
    text-decoration: none;
}

.search-empty {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    color: var(--muted);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    min-height: var(--touch);
    display: inline-flex;
    align-items: center;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--ink);
    text-decoration: none;
}

.pagination a:hover {
    border-color: var(--leaf);
}

.pagination span[aria-current="page"] {
    background: var(--chip);
    border-color: transparent;
    color: var(--muted);
}

@media (max-width: 560px) {
    .search-page {
        padding: 20px 16px 48px;
    }

    .search-controls {
        padding-left: 14px;
    }

    .search-controls button {
        padding: 0 18px;
    }
}
