/* ══════════════════════════════════════════════════════════════════════
   AI pretraga — jedna forma, tri mjesta (topic, hero, stranica stiha).
   Forma se renderira u [data-bhr-search="topic|hero|verse"] (search.js).
   Topic i hero prate temu Voyage (bkcc widgeti); stih prati study.css.
   ══════════════════════════════════════════════════════════════════════ */

.bhr-search {
    --bs-accent: #e43d51;
    --bs-accent-hover: #c92f42;
    --bs-ink: #1a1a1a;
    --bs-muted: #777;
    --bs-rule: #e5e5e5;
    --bs-field: #fff;
    --bs-radius: 12px;
    width: 100%;
    box-sizing: border-box;
}
.bhr-search *, .bhr-search *::before, .bhr-search *::after { box-sizing: border-box; }

.bhr-search-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    font-size: 24px;
    line-height: 1.25;
    color: var(--bs-ink);
    margin: 0 0 12px;
    text-align: center;
}

.bhr-search-form { margin: 0; }
.bhr-search-row { display: flex; gap: 8px; }

/* Izbor servisa — kompaktni gumbi ispod polja; pravi radio je skriven, ali dostupan tipkovnici */
.bhr-search-engines { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.bhr-search-engine { position: relative; display: inline-flex; cursor: pointer; margin: 0; }
.bhr-search-engine input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.bhr-search-engine span {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    line-height: 1.3;
    color: var(--bs-muted);
    background: var(--bs-field);
    border: 1px solid var(--bs-rule);
    border-radius: 999px;
    transition: color .12s, border-color .12s, background .12s;
    user-select: none;
}
.bhr-search-engine:hover span { border-color: var(--bs-accent); color: var(--bs-ink); }
.bhr-search-engine input:checked + span { color: #fff; background: var(--bs-accent); border-color: var(--bs-accent); font-weight: 600; }
.bhr-search-engine input:focus-visible + span { outline: 2px solid var(--bs-accent); outline-offset: 2px; }

.bhr-search-input {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0 16px;
    font: inherit;
    font-size: 16px; /* 16px = iOS ne zumira pri fokusu */
    color: var(--bs-ink);
    background: var(--bs-field);
    border: 1px solid var(--bs-rule);
    border-radius: var(--bs-radius);
    outline: none;
    transition: border-color .12s, box-shadow .12s;
    -webkit-appearance: none;
    appearance: none;
}
.bhr-search-input::-webkit-search-cancel-button,
.bhr-search-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.bhr-search-input::placeholder { color: var(--bs-muted); }
.bhr-search-input:focus { border-color: var(--bs-accent); box-shadow: 0 0 0 3px rgba(228,61,81,.15); }

.bhr-search-submit {
    flex: none;
    height: 48px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--bs-accent);
    border: 0;
    border-radius: var(--bs-radius);
    cursor: pointer;
    transition: background .12s;
}
.bhr-search-submit:hover { background: var(--bs-accent-hover); }
.bhr-search-submit svg { width: 18px; height: 18px; flex: none; }

.bhr-search-hint { margin: 8px 2px 0; font-size: 13px; color: var(--bs-muted); }

@media (max-width: 480px) {
    .bhr-search-submit { padding: 0 14px; }
    .bhr-search-submit .bhr-search-label { display: none; }
}

/* ── topic ── */
.bhr-search--topic { max-width: 720px; margin: 20px auto 30px; }

/* ── hero: forma preko videa (roditelj slajda ima position:relative) ── */
.bhr-search--hero {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    width: calc(100% - 32px);
    max-width: 640px;
    padding: 18px 20px 20px;
    background: rgba(255,255,255,.90);
    border-radius: 16px;
    box-shadow: 0 12px 40px -12px rgba(0,0,0,.45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* ── stih: boje i fontovi iz study.css (varijable prate temu light/sepia/night) ── */
.bhr-search--verse {
    --bs-accent: var(--porphyry, #71283A);
    --bs-accent-hover: var(--porphyry, #71283A);
    --bs-ink: var(--ink, #1E1B17);
    --bs-muted: var(--muted, #89826F);
    --bs-rule: var(--rule, #CFC8B6);
    --bs-field: var(--paper, #E6E3DA);
    --bs-radius: 10px;
}
.bhr-search--verse .bhr-search-title {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    text-align: left;
    color: var(--bs-muted);
    margin-bottom: 10px;
}
.bhr-search--verse .bhr-search-input:focus { box-shadow: none; }
.bhr-search--verse .bhr-search-submit { color: #F1EEE7; font-weight: 500; }
.bhr-search--verse .bhr-search-engines { justify-content: flex-start; }
.bhr-search--verse .bhr-search-engine input:checked + span { color: #F1EEE7; font-weight: 500; }
.bhr-search--verse .bhr-search-submit:hover { filter: brightness(1.08); }

/* Blok pretrage ispod „Moji komentari” */
.bhr-search-verse-block { margin-top: 28px; }
