/* =========================================================
   THEME TOKENS (global, safe)
   ========================================================= */

:root {
  --bg: #0b0b0b;
  --panel: rgba(15, 15, 15, .72);
  --panel-border: rgba(255, 255, 255, .10);
  --text: #fff;
  --muted: rgba(255, 255, 255, .75);

  --card: #1b1b1b;
  --card-border: rgba(255, 255, 255, .06);

  --btn-bg: rgba(0, 0, 0, .35);
  --btn-border: rgba(255, 255, 255, .16);
  --btn-hover: rgba(0, 0, 0, .50);

  --input-bg: rgba(255, 255, 255, .06);
  --input-border: rgba(255, 255, 255, .14);

  --shadow: 0 10px 30px rgba(0, 0, 0, .25);

  /* ==== GLOBAL FONT ==== */
  --font-base: Arial, Helvetica, sans-serif;
}

body.theme-light {
  --bg: #f6f6f6;
  --panel: rgba(255, 255, 255, .92);
  --panel-border: rgba(0, 0, 0, .12);
  --text: #111;
  --muted: rgba(0, 0, 0, .65);

  --card: #ffffff;
  --card-border: rgba(0, 0, 0, .12);

  --btn-bg: #ffffff;
  --btn-border: rgba(0, 0, 0, .14);
  --btn-hover: #f2f2f2;

  --input-bg: #ffffff;
  --input-border: rgba(0, 0, 0, .14);

  --shadow: 0 10px 30px rgba(0, 0, 0, .10);
}

/* =========================================================
   GLOBAL BASE (safe)
   ========================================================= */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  margin: 0;
  background: var(--bg, #0b0b0b);

  /* базовий шрифт для ВСЬОГО сайту (з фолбеком) */
  font-family: var(--font-base, Arial, Helvetica, sans-serif);
}

/* щоб інпути/кнопки не брали системний UI-font */
body,
button,
input,
textarea,
select {
  font-family: var(--font-base, Arial, Helvetica, sans-serif) !important;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* плавний перехід по темі */
body,
.panel,
.card,
.btn,
input,
textarea,
select {
  transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease;
}

@media (prefers-reduced-motion: reduce) {

  body,
  .panel,
  .card,
  .btn,
  input,
  textarea,
  select {
    transition: none;
  }
}

/* =========================================================
   DEFAULT LAYOUT (global)
   site-container ЗАВЖДИ fullwidth
   ========================================================= */

main.site-container {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.site-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* опційний “вузький” контейнер */
.container {
  width: min(1200px, 94vw);
  margin: 0 auto;
}

/* =========================================================
   DEMO / HOME PAGE UI (scoped, DOES NOT AFFECT part page)
   ВАЖЛИВО: Все нижче працює ТІЛЬКИ всередині .u-home
   ========================================================= */

.u-home {
  --demo-bg: #f9f9f9;
  --demo-card: #fff;
  --demo-muted: #777;
  --demo-border: #ddd;
  --demo-brand: #24292f;
}

.u-home.u-home--light {
  background: var(--demo-bg);
  color: #111;
}

.u-home .container {
  max-width: 100%;
  padding: 16px;
  margin: 0 auto;
}

.u-home .footer {
  text-align: center;
  padding: 24px 0;
  color: var(--demo-muted);
}

/* navbar тільки для u-home */
.u-home .navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 10px 16px;
  background: var(--demo-card);
  border-bottom: 1px solid var(--demo-border);

  position: sticky;
  top: 0;
  z-index: 100;
}

.u-home .navbar .brand {
  font-weight: 700;
  color: var(--demo-brand);
  text-decoration: none;
  margin-right: 8px;
}

.u-home .navbar a {
  text-decoration: none;
  color: #111;
}

.u-home .navbar .pill {
  padding: 6px 10px;
  border: 1px solid var(--demo-border);
  border-radius: 999px;
  margin-left: 8px;
  background: var(--demo-card);
}

.u-home .navbar .muted {
  color: var(--demo-muted);
  margin: 0 8px;
}

/* НЕ .grid/.card глобально */
.u-home .u-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.u-home .u-card {
  background: var(--demo-card);
  border: 1px solid var(--demo-border);
  border-radius: 10px;
  padding: 12px;
}

.u-home .u-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

/* filters тільки для u-home */
.u-home .u-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 20px;
}

.u-home .u-filters button,
.u-home .u-filters .chip {
  padding: 8px 12px;
  border: 1px solid var(--demo-border);
  background: var(--demo-card);
  border-radius: 8px;
  cursor: pointer;
}

.u-home .u-filters .active {
  background: #111;
  color: #fff;
}

.u-home .muted {
  color: var(--demo-muted);
}

/* =========================================================
   PART PAGE FOOTER (scoped)
   ========================================================= */

body.part-page-active footer {
  text-align: right;
  padding: 20px 30px;
  font-size: 14px;
  color: var(--muted);
}