/*
 * asearch — styled on Aytict's real brand identity (vendored from
 * cdn.aytict.fi's ayt-brand.css: magenta/violet gradient on ink, the
 * hexagon AT monogram). This file only adds the search-specific layout on
 * top of ayt-brand.css's tokens/utility classes (--ayt-magenta, --ayt-ink,
 * .ayt-card, .ayt-btn, .ayt-chip, .ayt-rule, …) — see
 * assets/vendor/ayt-brand.css for those.
 *
 * Not using "Ayt Sans" here: checked its actual glyph coverage
 * (AytSans-Regular/Bold.ttf) and it ships zero lowercase letters — a
 * caps-only display face, like every other custom Ayt font, meant to be
 * paired with text-transform:uppercase (that's how the CDN's own pages use
 * them). Mixed-case text like our "AytSearch" wordmark or a URL needs real
 * lowercase glyphs, so this sticks to a plain system sans everywhere and
 * gets its brand identity from color/gradient/shape instead of type.
 */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--ayt-ink);
    background-image:
        radial-gradient(60% 80% at 15% 0%, rgba(255, 47, 208, .10), transparent 60%),
        radial-gradient(50% 70% at 90% 15%, rgba(138, 43, 226, .12), transparent 60%);
    color: var(--ayt-mist);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body { padding-inline: 20px; }

a { color: var(--ayt-magenta-lt); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 780px;
    margin: 0 auto;
}

/* --- Logo (ayt-logo hex mark + AytSearch wordmark) -------------------- */

.ayt-logo-lockup {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    user-select: none;
}
.ayt-logo-lockup .wordmark {
    font-weight: 700;
    letter-spacing: -0.01em;
}
.ayt-logo-lockup.large .wordmark { font-size: 2.5rem; }
.ayt-logo-lockup.small .wordmark { font-size: 1.3rem; }

/* --- Home page ------------------------------------------------------- */

.home-shell {
    min-height: 82vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 28px;
}

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

.search-form { width: 100%; }

.search-box {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    font: inherit;
    font-size: 1.05rem;
    padding: 13px 46px 13px 18px;
    border: 1px solid rgba(138, 43, 226, .4);
    border-radius: 999px;
    outline: none;
    background: linear-gradient(180deg, rgba(22, 10, 31, .85), rgba(13, 6, 18, .85));
    color: var(--ayt-mist);
    box-shadow: 0 14px 44px rgba(120, 0, 110, .25);
    transition: border-color .15s ease, box-shadow .2s ease;
}
.search-input::placeholder { color: var(--ayt-dim); }
.search-input:focus {
    border-color: var(--ayt-magenta-lt);
    box-shadow: var(--ayt-glow);
}

.search-submit {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--ayt-brand-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--ayt-glow);
}
.search-submit svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; }

/* --- Suggestions dropdown ---------------------------------------------- */

.suggest-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--ayt-ink-2);
    border: 1px solid rgba(138, 43, 226, .4);
    border-radius: 12px;
    box-shadow: 0 14px 44px rgba(120, 0, 110, .35);
    overflow: hidden;
    z-index: 20;
    text-align: left;
}
.suggest-item {
    padding: 10px 18px;
    cursor: pointer;
    color: var(--ayt-mist);
    font-size: .95rem;
}
.suggest-item:hover, .suggest-item.active {
    background: var(--ayt-brand-gradient-soft);
}

/* --- Results page header ----------------------------------------------- */

.results-header {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 18px 0;
    border-bottom: 1px solid rgba(138, 43, 226, .3);
    margin-bottom: 6px;
}
.results-header .search-box { max-width: 480px; margin: 0; }
.results-meta {
    color: var(--ayt-dim);
    font-size: .85rem;
    padding: 14px 0 4px;
}

/* --- Results list -------------------------------------------------------- */

.results-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.result-item {
    padding: 16px 20px;
}

.result-url {
    font-size: .82rem;
    color: var(--ayt-dim);
    word-break: break-all;
}

.result-title-link {
    font-size: 1.15rem;
    display: block;
    margin: 2px 0 6px;
    color: var(--ayt-magenta-lt);
}

.result-snippet {
    color: var(--ayt-mist);
    opacity: .85;
    font-size: .94rem;
    line-height: 1.5;
    margin: 0;
}
.result-snippet mark {
    background: none;
    color: var(--ayt-magenta-lt);
    font-weight: 700;
    text-shadow: 0 0 12px rgba(255, 0, 200, .5);
}

.no-results { color: var(--ayt-dim); padding: 40px 0; }

/* --- Pagination / infinite scroll --------------------------------------- */

.pagination {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 26px 0 60px;
}
.pagination a, .pagination span {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(138, 43, 226, .4);
    color: var(--ayt-mist);
}
.pagination a:hover { border-color: var(--ayt-magenta-lt); text-decoration: none; }

.loading-indicator {
    text-align: center;
    color: var(--ayt-dim);
    padding: 18px 0;
    font-size: .9rem;
}
.loading-indicator[hidden] { display: none; }

footer.site-footer {
    text-align: center;
    color: var(--ayt-dim);
    font-size: .8rem;
    padding: 30px 0;
}

@media (max-width: 480px) {
    .ayt-logo-lockup.large .wordmark { font-size: 2rem; }
    .results-header { flex-wrap: wrap; gap: 12px; }
}
