/* ==========================================================================
   Citiwell Montenegro · FAQ as a conversation (faq.html, faq-ru.html, faq-en.html)
   Inside the blue-headed FAQ card: a side panel (search + four stages) and
   the questions as a chat, every answer visible, its first sentence in bold.
   Pages: tools/build-faq-pages.py, script: assets/js/faq-chat.js.
   ========================================================================== */
.fq {
    --fq-navy: #0b2135;
    --fq-navy-2: #1b4668;
    --fq-blue: #1688b9;
    --fq-blue-dark: #126f98;
    --fq-soft: #eef6fa;
    --fq-line: #dce8ef;
    --fq-ink: #0e2033;
    --fq-text: #3a4b59;
    --fq-muted: #5f7082;
    display: grid;
    gap: 28px;
    align-items: start;
    margin-bottom: 36px;
    font-family: var(--font-main, 'Manrope', sans-serif);
}

/* the card keeps its rounded corners without becoming a scroll box, so the side panel can stay in view */
#faq-safety-style.faq-section { overflow: clip; }

.fq :where(h3, h4, p) { margin: 0; text-align: left; text-transform: none; letter-spacing: 0; }
.fq img { display: block; }

/* ---------- side panel ---------- */
.fq-side { display: grid; gap: 14px; min-width: 0; }

.fq-search {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--fq-soft);
    box-shadow: inset 0 0 0 1.5px var(--fq-line);
    color: var(--fq-blue);
    transition: box-shadow 0.18s ease, background-color 0.18s ease;
}

.fq-search:focus-within { background: #fff; box-shadow: inset 0 0 0 2px var(--fq-blue); }

.fq-search input {
    flex: 1;
    min-width: 0;
    height: 50px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--fq-ink);
    font: inherit;
    font-size: 16px;
}

.fq-search input::placeholder { color: #7a8a98; }
.fq-search input::-webkit-search-cancel-button { cursor: pointer; }

.fq-topics { display: flex; gap: 8px; margin: 0 -20px; padding: 2px 20px 4px; overflow-x: auto; scrollbar-width: none; }
.fq-topics::-webkit-scrollbar { display: none; }

.fq-topic {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 14px 0 8px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    box-shadow: inset 0 0 0 1.5px var(--fq-line);
    color: var(--fq-ink);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.fq-topic img { width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: var(--fq-soft); }
.fq-topic__dot { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--fq-soft); }
.fq-topic__dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--fq-blue); }
.fq-topic small { margin-left: 2px; color: var(--fq-muted); font-size: 13px; font-weight: 700; }
.fq-topic:hover { box-shadow: inset 0 0 0 1.5px var(--fq-blue); }
.fq-topic.is-active { background: var(--fq-navy); box-shadow: none; color: #fff; }
.fq-topic.is-active small { color: rgba(255, 255, 255, 0.7); }
.fq-topic.is-active img, .fq-topic.is-active .fq-topic__dot { background: #fff; }

/* ---------- conversation ---------- */
.fq-stream { display: grid; gap: 34px; min-width: 0; }
.fq-group { display: grid; gap: 18px; scroll-margin-top: 110px; }
.fq-group[hidden], .fq-pair[hidden] { display: none; }

.fq-group__title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--fq-line);
    color: var(--fq-ink);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

.fq-group__title img { width: 42px; height: 42px; padding: 9px; border-radius: 50%; background: var(--fq-soft); box-shadow: inset 0 0 0 1px rgba(23, 143, 189, 0.16); }
.fq-group__title small { margin-left: auto; color: var(--fq-muted); font-size: 14px; font-weight: 700; white-space: nowrap; }

.fq-pair { display: grid; gap: 10px; scroll-margin-top: 110px; }

.fq-q { display: flex; justify-content: flex-end; }

.fq-q h4 {
    max-width: min(560px, 86%);
    padding: 14px 18px;
    border-radius: 22px 22px 6px 22px;
    background: linear-gradient(135deg, var(--fq-navy) 0%, var(--fq-navy-2) 100%);
    box-shadow: 0 10px 24px rgba(11, 33, 53, 0.16);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
}

.fq-a { display: flex; align-items: flex-end; gap: 10px; }
.fq-avatar { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 6px 14px rgba(22, 136, 185, 0.22); }

.fq-bubble {
    max-width: min(720px, 92%);
    padding: 14px 18px 16px;
    border-radius: 22px 22px 22px 6px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(24, 67, 97, 0.08), inset 0 0 0 1px var(--fq-line);
}

.fq p.fq-who { margin-bottom: 4px; color: var(--fq-blue); font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.fq p.fq-text { color: var(--fq-text); font-size: 15.5px; line-height: 1.65; }
.fq-text strong { color: var(--fq-ink); font-weight: 800; }
.fq-pair:target .fq-bubble { box-shadow: 0 10px 28px rgba(24, 67, 97, 0.08), inset 0 0 0 2px var(--fq-blue); }

/* answers slide in when they reach the screen (only with the script, and not for reduced motion) */
.fq.is-animated .fq-pair { opacity: 0; transform: translateY(14px); transition: opacity 0.45s ease, transform 0.45s ease; }
.fq.is-animated .fq-pair .fq-a { opacity: 0; transition: opacity 0.45s ease 0.25s; }
.fq.is-animated .fq-pair.is-in, .fq.is-animated .fq-pair.is-in .fq-a { opacity: 1; transform: none; }

.fq-empty { display: grid; justify-items: start; gap: 14px; padding: 22px; border-radius: 20px; background: var(--fq-soft); }
.fq-empty[hidden] { display: none; }
.fq-empty p { color: var(--fq-text); font-size: 16px; line-height: 1.55; }

.fq-empty__button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff6b6b 0%, #f04f5a 100%);
    color: #fff;
    font-weight: 800;
}

.fq a.fq-empty__button { color: #fff; }

/* the hero's topic tiles are links to their stage now */
a.faq-topic-card { color: inherit; text-decoration: none; border-radius: 14px; transition: transform 0.18s ease; }
a.faq-topic-card:hover { transform: translateY(-2px); }

/* ---------- large screens: the panel on the left, in view while reading ---------- */
@media (min-width: 980px) {
    .fq { grid-template-columns: 290px minmax(0, 1fr); gap: 44px; }
    .fq-side { position: sticky; top: 104px; }
    .fq-topics { flex-direction: column; margin: 0; padding: 0; overflow: visible; }
    .fq-topic { width: 100%; min-height: 54px; border-radius: 16px; }
    .fq-topic small { margin-left: auto; }
}

@media (max-width: 560px) {
    .fq { gap: 20px; }
    .fq-group__title { font-size: 19px; }
    .fq-group__title img { width: 36px; height: 36px; padding: 8px; }
    .fq-q h4 { max-width: 92%; font-size: 15px; padding: 12px 15px; }
    .fq-avatar { width: 32px; height: 32px; border-radius: 10px; }
    .fq-bubble { max-width: calc(100% - 42px); padding: 12px 14px 14px; }
    .fq p.fq-text { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    .fq.is-animated .fq-pair, .fq.is-animated .fq-pair .fq-a { opacity: 1; transform: none; transition: none; }
}
