/* ==========================================================================
   /news/ — the article search bar.

   The same design as the game search on /slot (slot-explorer-27.css,
   section 2): a pill with the icon, the field, a `/` shortcut hint and a
   gradient Search button. Copied rather than shared, so /news/ does not
   load the whole /slot stylesheet for one form.

   Every class and custom property here ends in -29, so nothing collides
   with the sheets this page already loads (tailwind.css, style2.css,
   news.css). Logical properties throughout, so right-to-left locales
   mirror without any rule in app/rtl.py.
   ========================================================================== */

:root {
    --nw-purple-29: #a948f8;
    --nw-teal-29: #22e2b6;
    --nw-ink-29: #f5f3ff;
    --nw-muted-29: #a3a1ae;
    --nw-faint-29: #77748a;
    --nw-line-strong-29: rgba(255, 255, 255, 0.12);
    --nw-grad-loop-29: linear-gradient(90deg, #a948f8, #22e2b6, #a948f8);
    --nw-shadow-29: 0 24px 60px -30px rgba(0, 0, 0, 0.85);
    --nw-ease-29: cubic-bezier(.22, 1, .36, 1);
    --nw-font-29: 'Roboto', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

.nw-sr-29 {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nw-search-29 {
    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 60px;
    margin: 0;
    padding: 6px;
    padding-inline-start: 18px;
    border-radius: 999px;
    background:
        radial-gradient(120% 180% at 0% 0%, rgba(169, 72, 248, 0.14), transparent 55%),
        linear-gradient(180deg, rgba(37, 34, 46, 0.92), rgba(22, 20, 27, 0.95));
    border: 1px solid var(--nw-line-strong-29);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--nw-shadow-29);
    font-family: var(--nw-font-29);
    transition: border-color .25s ease, box-shadow .25s ease;
}

[dir="rtl"] .nw-search-29 {
    background:
        radial-gradient(120% 180% at 100% 0%, rgba(169, 72, 248, 0.14), transparent 55%),
        linear-gradient(180deg, rgba(37, 34, 46, 0.92), rgba(22, 20, 27, 0.95));
}

.nw-search-29 *,
.nw-search-29 *::before,
.nw-search-29 *::after {
    box-sizing: border-box;
}

.nw-search-29:focus-within {
    border-color: rgba(169, 72, 248, 0.65);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 4px rgba(169, 72, 248, 0.16),
        0 24px 60px -28px rgba(169, 72, 248, 0.5);
}

.nw-search-icon-29 {
    flex: none;
    width: 20px;
    height: 20px;
    color: var(--nw-muted-29);
    transition: color .25s ease;
}

.nw-search-29:focus-within .nw-search-icon-29 {
    color: var(--nw-teal-29);
}

.nw-search-input-29 {
    flex: 1 1 auto;
    min-width: 0;
    height: 46px;
    margin: 0;
    padding: 0 6px;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: var(--nw-ink-29);
    /* 16px keeps iOS from zooming the page when the field gets focus. */
    font: 500 16px/1.2 var(--nw-font-29);
    -webkit-appearance: none;
    appearance: none;
}

.nw-search-input-29:focus {
    outline: 0;
    box-shadow: none;
}

.nw-search-input-29::placeholder {
    color: var(--nw-faint-29);
    opacity: 1;
}

.nw-search-input-29::-webkit-search-cancel-button,
.nw-search-input-29::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.nw-search-clear-29 {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--nw-muted-29);
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.nw-search-clear-29:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.nw-search-clear-29:focus-visible,
.nw-search-submit-29:focus-visible {
    outline: 2px solid var(--nw-teal-29);
    outline-offset: 2px;
}

.nw-search-clear-29[hidden] {
    display: none;
}

.nw-kbd-29 {
    display: none;
    flex: none;
    min-width: 26px;
    height: 26px;
    padding-inline: 8px;
    border-radius: 7px;
    border: 1px solid var(--nw-line-strong-29);
    background: rgba(255, 255, 255, 0.04);
    color: var(--nw-faint-29);
    font: 600 12px/24px var(--nw-font-29);
    text-align: center;
}

/* The `/` hint only where there is a keyboard to press it on, and only
   while the field is empty and not already in use. */
@media (min-width: 1024px) and (hover: hover) {
    .nw-kbd-29 {
        display: inline-block;
    }

    .nw-search-29:focus-within .nw-kbd-29,
    .nw-search-input-29:not(:placeholder-shown) ~ .nw-kbd-29 {
        display: none;
    }
}

.nw-search-submit-29 {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding-inline: 22px;
    border: 0;
    border-radius: 999px;
    background: var(--nw-grad-loop-29);
    background-size: 200% 100%;
    color: #fff;
    font: 700 15px/1 var(--nw-font-29);
    cursor: pointer;
    box-shadow: 0 10px 26px -12px rgba(169, 72, 248, 0.8);
    transition: background-position .5s var(--nw-ease-29), transform .2s ease;
}

.nw-search-submit-29:hover {
    background-position: 100% 0;
}

.nw-search-submit-29:active {
    transform: scale(.97);
}

.nw-search-submit-29 svg {
    width: 18px;
    height: 18px;
}

/* Phones: the button becomes a round icon, so the field keeps its room. */
@media (max-width: 479px) {
    .nw-search-29 {
        min-height: 54px;
        padding-inline-start: 14px;
    }

    .nw-search-input-29 {
        height: 42px;
    }

    .nw-search-submit-29 {
        width: 42px;
        height: 42px;
        padding: 0;
    }

    .nw-search-submit-29 span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }
}

@media (min-width: 480px) {
    .nw-search-submit-29 svg {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nw-search-29,
    .nw-search-29 * {
        transition-duration: .01ms !important;
    }
}
