/* ============================================================
   AURALIS · site additions — стъпва върху auralis.css (дословен).
   Тук държим само нашите неща: бранд (shimmer вариант), no-JS
   защита за reveal, активно състояние на звуковите бутони, дребни.
   ============================================================ */

/* ---------- Бранд (нашия вариант: shimmer wordmark) ---------- */
.brand { display:flex; flex-direction:column; gap:1px; line-height:1.05; text-decoration:none; }
.brand__mark { display:inline-flex; align-items:baseline; font-size:21px; letter-spacing:-0.01em; }
.header-brand { display:inline-flex; align-items:baseline; font-weight:900; }
.header-brand .brand-1 {
  font-weight:900;
  background:linear-gradient(90deg,#4F46E5,#7C3AED,#22B8CF,#7C3AED,#4F46E5);
  background-size:200% auto;
  -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent; color:transparent;
  animation:auralisShimmer 4.5s linear infinite;
  will-change:background-position;
}
.header-brand .brand-2 { font-weight:600; color:var(--violet); }
.brand__tld { font-family:var(--font-mono); font-size:13px; font-weight:500; color:var(--faint); margin-left:1px; }
.footer__brand .brand__mark { font-size:19px; }
@keyframes auralisShimmer { to { background-position:200% center; } }
@media (prefers-reduced-motion: reduce) { .header-brand .brand-1 { animation:none; } }

/* ---------- No-JS защита: reveal съдържанието е видимо без JS ----------
   auralis.css крие .reveal (opacity:0). Показваме всичко, ако няма JS,
   за да не скрием съдържание от crawler/без-JS (SEO/прогресивно подобрение). */
html:not(.js) .reveal { opacity:1 !important; transform:none !important; }

/* ---------- Активно (свири) състояние на звуковите бутони ---------- */
.btn[data-sound][data-playing="true"] {
  box-shadow:var(--concave-sm);
  filter:none;
}
.btn--primary[data-sound][data-playing="true"] {
  background:var(--bg);
  color:var(--indigo);
  box-shadow:var(--concave-sm);
}

/* ---------- Слушалки подсказка ---------- */
.headphones {
  display:flex; align-items:center; gap:10px; justify-content:center;
  margin:0 auto 18px; padding:10px 16px; max-width:max-content;
  border-radius:var(--r-pill); background:var(--bg); box-shadow:var(--concave-sm);
  font-size:12.5px; color:var(--muted);
}
.headphones svg { color:var(--indigo); flex:0 0 auto; }

/* ---------- Достъпност: видим фокус пръстен ---------- */
:focus-visible { outline:2px solid var(--indigo); outline-offset:3px; border-radius:6px; }
.btn:focus-visible, .pill:focus-visible { outline-offset:4px; }

/* ---------- Skip link ---------- */
.skip { position:absolute; left:-9999px; top:0; background:var(--bg); color:var(--indigo);
  padding:12px 18px; border-radius:0 0 var(--r-sm) 0; box-shadow:var(--convex-sm); z-index:100; font-weight:700; }
.skip:focus { left:0; }

/* ============================================================
   Поправки за тесни телефони — без хоризонтално преливане.
   (При влаченето на плъзгача екранът „играеше", защото тест-бутоните
   разширяваха решетката извън ширината на екрана.)
   ============================================================ */
html, body { overflow-x: clip; }   /* clip НЕ чупи sticky менюто (за разлика от hidden) */

/* Тест-бутоните: пълна ширина; на тесен екран един под друг (по-големи цели) */
.test__btns { grid-template-columns: 1fr; }
.test__btns .btn { width: 100%; min-width: 0; padding-inline: 16px; }
@media (min-width: 480px) {
  .test__btns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.btn { overflow-wrap: anywhere; }   /* дълги думи се пренасят, не изтласкват ширина */

/* Masthead: бранд + CTA да се събират и на най-тесните екрани */
.masthead__bar { gap: 10px; }
.brand, .brand__mark { min-width: 0; }
@media (max-width: 430px) {
  .brand__mark   { font-size: 18px; }
  .brand__tld    { font-size: 12px; }
  .masthead__cta { padding: 0 13px; font-size: 12.5px; }
}

/* ============================================================
   Поправки v3 — компактен хедър + колони без изрязване отдясно
   ============================================================ */

/* Бранд: винаги на един ред; побира се до CTA */
.brand__mark   { white-space: nowrap; }
.masthead__bar { flex-wrap: nowrap; gap: 10px; }
.masthead__cta { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 480px) {
  .brand__mark   { font-size: 16px; }
  .masthead__cta { padding: 0 14px; font-size: 12.5px; min-height: 42px; }
}
@media (max-width: 400px) { .brand__tld { display: none; } } /* маха отрязаното „.help" */

/* По-малки, по-събрани пилюли → по-нисък хедър */
.navrow { gap: 7px; padding-bottom: 10px; }
.pill   { min-height: 38px; padding: 0 13px; font-size: 13px; }

/* Менюто се свива ПЛАВНО при скрол; бутон ☰ го връща ръчно */
.navrow {
  overflow: hidden;
  max-height: 220px;
  transition: max-height .34s ease, opacity .26s ease, padding-bottom .26s ease;
}
.masthead.is-scrolled:not(.nav-open) .navrow {
  max-height: 0;
  opacity: 0;
  padding-bottom: 0;
}
.masthead.is-scrolled .masthead__bar { padding-block: 9px; }

/* Бутон „меню" — показва се само при скрол (когато навигацията е скрита) */
.masthead__menu {
  display: none;
  margin-left: auto;
  flex: 0 0 auto;
  width: 42px; height: 42px;
  place-items: center;
  border: 0; border-radius: var(--r-pill);
  background: var(--bg); color: var(--indigo);
  box-shadow: var(--convex-xs); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.masthead.is-scrolled .masthead__menu { display: grid; }
.masthead__menu:active { box-shadow: var(--concave-sm); }
.masthead__menu svg { transition: transform .26s ease; }
.masthead.nav-open .masthead__menu svg { transform: rotate(90deg); }

/* Многоколонни решетки: да се свиват, не да преливат и да се режат */
.stats     { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat      { padding: 18px 8px; }
.stat__num { font-size: clamp(20px, 6.4vw, 44px); }
.topics    { grid-template-columns: 1fr; }
@media (min-width: 560px) { .topics { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } }
.pricegrid { grid-template-columns: 1fr; }
@media (min-width: 640px) { .pricegrid { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } }
.topic, .article, .card, .metastep, .bio, .trust, .stat, .footer__col { min-width: 0; }

/* Дълги низове (DOI/URL) се пренасят, не изтласкват ширина */
.prose, .bluf, .sourcelist, .article__meta { overflow-wrap: anywhere; }

/* Езиков превключвател (BG/IT) в менюто */
.pill.lang-switch { font-weight: 800; letter-spacing: 1.5px; color: var(--indigo); }


/* ── Езиков превключвател (дискретен, всички езици) ──────────────────── */
.lang-menu { position: relative; flex: 0 0 auto; }
.lang-menu__btn {
  list-style: none; display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: var(--r-pill);
  background: var(--bg); color: var(--indigo); box-shadow: var(--convex-xs);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.lang-menu__btn::-webkit-details-marker { display: none; }
.lang-menu__btn::marker { content: ""; }
.lang-menu[open] .lang-menu__btn { box-shadow: var(--concave-sm); }
.lang-menu__list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  margin: 0; padding: 6px; list-style: none; min-width: 168px;
  background: var(--bg); border-radius: 16px; box-shadow: var(--convex-sm);
}
.lang-menu__list a {
  display: block; padding: 11px 14px; border-radius: 11px;
  color: var(--text); text-decoration: none; font-size: 14.5px; font-weight: 600;
}
.lang-menu__list a[aria-current] { color: var(--indigo); background: rgba(99,102,241,.10); }
.lang-menu__list a:active { box-shadow: var(--concave-sm); }

/* ============================================================
   Masthead bar — лого + CTA + globe, БЕЗ застъпване на всички езици
   ============================================================ */
.masthead__bar { justify-content: flex-start; gap: 10px; flex-wrap: nowrap; }
.brand { margin-right: auto; min-width: 0; }
.masthead__cta { flex: 0 0 auto; white-space: nowrap; }
.lang-menu { flex: 0 0 auto; }
@media (max-width: 600px) {
  .brand__mark   { font-size: 16px; }
  .masthead__cta { padding: 0 13px; font-size: 12px; min-height: 40px; }
  .lang-menu__btn { width: 38px; height: 38px; }
}
@media (max-width: 400px) {
  .brand__mark   { font-size: 14.5px; }
  .masthead__cta { padding: 0 11px; font-size: 11.5px; }
  .lang-menu__btn { width: 36px; height: 36px; }
}

/* ============================================================
   Навигация — симетрична решетка „като войници" (мобилно)
   minmax(0,1fr) → колоните НЕ преливат при дълги думи; текстът се
   пренася при нужда (никога отрязан). Нечетен последен = цял ред.
   ============================================================ */
@media (max-width: 640px) {
  .navrow {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: 520px;
    align-content: start;
  }
  .navrow .pill {
    width: 100%;
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.15;
    min-height: 50px;
    padding: 8px 12px;
    font-size: 13.5px;
  }
  .navrow .pill:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
