/* ========== Base Theme Vars ========== */
:root{
  --dt-primary:#0a84ff;
  --dt-primary-contrast:#fff;
  --dt-bg:#ffffff;
  --dt-fg:#111111;
  --dt-chip-bg:transparent;
  --dt-border:rgba(0,0,0,.12);
  --dt-hover-bg:rgba(0,0,0,.06);
  --dt-hover-border:rgba(0,0,0,.18);
  --dt-shadow:0 2px 10px rgba(0,0,0,.08);
  --dt-fab-bg:#111111;
  --dt-fab-fg:#ffffff;
}
@media (prefers-color-scheme: dark){
  :root{
    --dt-bg:#0f1115;
    --dt-fg:#e8eaed;
    --dt-chip-bg:transparent;
    --dt-border:rgba(255,255,255,.14);
    --dt-hover-bg:rgba(255,255,255,.09);
    --dt-hover-border:rgba(255,255,255,.22);
    --dt-shadow:0 2px 10px rgba(0,0,0,.5);
    --dt-fab-bg:#1b1e24;
    --dt-fab-fg:#e8eaed;
  }
}

/* ========== Inline Picker / Editor Assist ========== */
.dt-hover{ outline:1px dashed rgba(0,0,0,.35); cursor:crosshair; }
body.dt-edit-mode{ padding-bottom:56px; }
body.dt-edit-mode :is(a,button,[role="button"],p,h1,h2,h3,h4,h5,h6,span,li,strong,em,label,input,textarea,.uagb-heading-text,figcaption,.wp-caption-text,[class*="caption"]){
  outline:1px dashed rgba(0,0,0,.2); cursor:crosshair;
}

/* Bottom helper bar (optional, когда включён) */
#dt-translator-bar{
  position:fixed;left:0;right:0;bottom:0;z-index:99997;
  background:#222;color:#fff;padding:10px 12px;font-size:13px;
}
#dt-translator-bar .sep{opacity:.55;margin:0 8px}
#dt-translator-bar .dt-lang-btn{
  display:inline-block;margin-right:8px;padding:4px 10px;border-radius:8px;
  background:#444;color:#fff;text-decoration:none;transition:filter .15s;
}
#dt-translator-bar .dt-lang-btn:hover{ filter:brightness(1.1) }
#dt-translator-bar .dt-lang-btn.active{ background:var(--dt-primary);color:var(--dt-primary-contrast) }
#dt-translator-bar .dt-edit-toggle{
  margin-left:12px;border:0;border-radius:10px;padding:6px 10px;cursor:pointer;
  background:var(--dt-primary);color:var(--dt-primary-contrast);transition:filter .15s;
}
#dt-translator-bar .dt-edit-toggle:hover{ filter:brightness(1.05) }

/* ========== Floating FAB Switcher (виджет) ========== */
.dt-lang-widget{ position:fixed; right:20px; bottom:20px; z-index:99998; }
#dt-lang-fab{
  width:46px;height:46px;border-radius:9999px;border:0;cursor:pointer;display:inline-grid;place-items:center;
  background:var(--dt-fab-bg);color:var(--dt-fab-fg);box-shadow:0 8px 18px rgba(0,0,0,.25);
  transition:transform .08s,filter .15s;
}
#dt-lang-fab:active{ transform:scale(.98) }
#dt-lang-fab:focus-visible{ outline:2px solid var(--dt-primary); outline-offset:2px }
#dt-lang-panel{
  position:fixed;right:20px;bottom:76px;min-width:140px;display:none;
  background:var(--dt-bg);color:var(--dt-fg);border-radius:12px;box-shadow:0 16px 40px rgba(0,0,0,.25);
  padding:8px;gap:6px;flex-wrap:wrap;
}
#dt-lang-panel.open{ display:flex }
#dt-lang-panel a{
  display:inline-block;padding:6px 10px;border-radius:10px;text-decoration:none;font-weight:600;
  background:var(--dt-chip-bg);border:1px solid var(--dt-border);color:inherit;
  transition:background .15s,border-color .15s,box-shadow .15s,color .15s;
}
#dt-lang-panel a:hover{ background:var(--dt-hover-bg);border-color:var(--dt-hover-border);box-shadow:var(--dt-shadow) }
#dt-lang-panel a.active{ background:var(--dt-primary);border-color:var(--dt-primary);color:var(--dt-primary-contrast) }

/* ========== SHORTCODE SWITCHER (final, single-anchor) ========== */
.dt-lang-shortcode{
  display:flex; flex-wrap:wrap; gap:.5rem; align-items:center;
  /* управляется из PHP через style="--var:..." */
  --dt-sw-accent:#2563eb;
  --dt-sw-text:#111;
  --dt-sw-hover-bg:var(--dt-hover-bg, rgba(0,0,0,.06));
  --dt-sw-hover-text:#111;
  --dt-sw-active-text:#fff;
  --dt-sw-stroke:var(--dt-border, rgba(0,0,0,.12));
  --dt-sw-case:none; /* none|uppercase|lowercase|capitalize */
}

/* Выравнивание */
.dt-lang-shortcode[data-align="center"]{ justify-content:center; }
.dt-lang-shortcode[data-align="right"] { justify-content:flex-end;  }

/* Единственная «кнопка» */
.dt-lang{
  display:inline-flex; align-items:center; gap:.4rem;
  padding:.35rem .6rem;
  border:1px solid var(--dt-sw-stroke);
  border-radius:9999px; /* pill по умолчанию */
  background:transparent;
  color:var(--dt-sw-text);
  text-decoration:none;
  line-height:1;
  transition:background-color .15s ease, color .15s ease,
             transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

/* Радиус */
.dt-lang-shortcode[data-radius="rounded"] .dt-lang{ border-radius:.6rem; }

/* Размер */
.dt-lang-shortcode[data-size="sm"] .dt-lang{ padding:.25rem .5rem; font-size:.825rem; }
.dt-lang-shortcode[data-size="md"] .dt-lang{ padding:.35rem .6rem; font-size:.9rem; }
.dt-lang-shortcode[data-size="lg"] .dt-lang{ padding:.5rem .8rem; font-size:1rem; }

/* Флаг */
.dt-lang .dt-flag{ height:1rem; width:auto; object-fit:cover; }
.dt-lang-shortcode[data-flag-shape="round"]   .dt-flag{ border-radius:9999px; }
.dt-lang-shortcode[data-flag-shape="rounded"] .dt-flag{ border-radius:.25rem; }

/* Hover / Focus */
.dt-lang:hover{
  background:var(--dt-sw-hover-bg);
  color:var(--dt-sw-hover-text);
  border-color:var(--dt-sw-hover-bg);
}
.dt-lang:focus-visible{
  outline:2px solid var(--dt-sw-accent);
  outline-offset:2px;
}

/* Лёгкое поднятие (по настройке) */
.dt-lang-shortcode[data-hover-raise="1"] .dt-lang:hover{
  transform:translateY(-2px);
  box-shadow:0 6px 14px rgba(0,0,0,.12);
}

/* Активный */
.dt-lang.active,
.dt-lang[aria-current="true"]{
  background:var(--dt-sw-accent);
  color:var(--dt-sw-active-text);
  border-color:var(--dt-sw-accent);
}

/* Подчёркивание (управление) */
.dt-lang-shortcode[data-underline="always"] .dt-lang{ text-decoration:underline; }
.dt-lang-shortcode[data-underline="hover"]  .dt-lang:hover{ text-decoration:underline; }

/* Текст подписи + регистр */
.dt-lang__label{ line-height:1; text-transform:var(--dt-sw-case, none); }

/* Accessibility / motion */
@media (prefers-reduced-motion: reduce){
  *{ transition:none!important; animation:none!important; }
}
