/* my-hub — публічна частина. Оновлений дизайн (2026): шрифт Manrope, світла й темна теми
   (за системою або кнопкою в шапці), картки з об'ємом, акуратна типографіка. Класи ті самі, що в шаблонах. */
:root {
  --bg: #f4f6fb;
  --bg-glow: rgba(99, 102, 241, 0.10);
  --surface: #ffffff;
  --surface-alt: #eef1fb;
  --text: #161b2e;
  --muted: #667089;
  --primary: #5b5cf0;
  --primary-2: #a855f7;
  --border: #e3e7f2;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.07);
  --shadow-lift: 0 2px 4px rgba(15, 23, 42, 0.05), 0 18px 40px rgba(15, 23, 42, 0.12);
  --header: rgba(255, 255, 255, 0.78);
  --header-text: #161b2e;
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e18; --bg-glow: rgba(124, 92, 255, 0.16); --surface: #151827; --surface-alt: #1d2135;
    --text: #e8ebf7; --muted: #9aa1bd; --primary: #8b8cff; --primary-2: #c084fc; --border: #262b42;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.5);
    --header: rgba(12, 14, 24, 0.78); --header-text: #e8ebf7; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0e18; --bg-glow: rgba(124, 92, 255, 0.16); --surface: #151827; --surface-alt: #1d2135;
  --text: #e8ebf7; --muted: #9aa1bd; --primary: #8b8cff; --primary-2: #c084fc; --border: #262b42;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.5);
  --header: rgba(12, 14, 24, 0.78); --header-text: #e8ebf7; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font: 16px/1.65 Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  background-image: radial-gradient(900px 500px at 10% -10%, var(--bg-glow), transparent 60%),
                    radial-gradient(700px 400px at 100% 0%, var(--bg-glow), transparent 60%);
  background-attachment: fixed;
}
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }

/* ---------- шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; padding: 14px 24px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--header); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-title {
  font-weight: 800; font-size: 1.15rem; text-decoration: none; margin-right: auto;
  background: linear-gradient(90deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* бургер: меню — слайд-панель */
.menu-toggle {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px; border-radius: 10px;
}
.menu-toggle:hover { background: var(--surface-alt); }
.menu-toggle span { display: block; width: 20px; height: 2.5px; background: var(--header-text); border-radius: 2px; }

.site-nav {
  position: fixed; top: 0; left: 0; bottom: 0; width: 280px;
  background: var(--surface); box-shadow: var(--shadow-lift); border-right: 1px solid var(--border);
  padding: 24px; padding-top: 84px; display: flex; flex-direction: column; gap: 4px;
  transform: translateX(-100%); transition: transform 0.28s cubic-bezier(.2, .8, .2, 1); z-index: 100; overflow-y: auto;
}
.site-nav.is-open { transform: translateX(0); }
.site-nav a {
  color: var(--text); text-decoration: none; font-size: 0.97rem; padding: 11px 14px; border-radius: 12px; font-weight: 700;
  transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--surface-alt); color: var(--primary); }
.nav-overlay { display: none; position: fixed; inset: 0; background: rgba(8, 10, 20, 0.45); backdrop-filter: blur(2px); z-index: 99; }
.nav-overlay.is-open { display: block; }
.lang-switch { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.lang-switch a { display: inline-block; color: var(--muted); font-size: 0.85rem; font-weight: 800; border: 1px solid var(--border); border-radius: 999px; padding: 5px 14px; }
.lang-switch a:hover { color: var(--primary); border-color: var(--primary); background: none; }

.header-search input {
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; color: var(--text);
  font: inherit; font-size: 0.88rem; width: 200px; transition: border-color .15s, box-shadow .15s, width .2s;
}
.header-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); width: 240px; }
.header-search input::placeholder { color: var(--muted); }

.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; cursor: pointer;
  background: var(--surface-alt); border: 1px solid var(--border); color: var(--header-text);
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.theme-toggle .i-moon { fill: currentColor; stroke: none; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

.site-account { color: var(--muted); font-size: 0.88rem; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.site-account a { color: var(--header-text); text-decoration: none; }
.site-account a:hover { color: var(--primary); }

/* ---------- основне ---------- */
.site-main { width: min(820px, calc(100% - 32px)); margin: 48px auto 64px; }
.site-footer { text-align: center; color: var(--muted); font-size: 0.88rem; padding: 32px 24px; border-top: 1px solid var(--border); }

.hero { text-align: center; margin: 12px 0 40px; }
.hero h1 {
  font-size: clamp(2.4rem, 7vw, 4rem); font-weight: 800; margin: 0; letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--text) 20%, var(--primary) 60%, var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero::after { content: ""; display: block; width: 64px; height: 4px; margin: 18px auto 0; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }

.content-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.content-card {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 22px; text-decoration: none; color: var(--text);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s, border-color .18s;
}
.content-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.content-title { font-weight: 700; font-size: 1.05rem; }
.content-type {
  flex: none; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 999px; color: var(--muted); background: var(--surface-alt);
}
.content-type[data-type="post"] { color: #2563eb; background: rgba(37, 99, 235, 0.12); }
.content-type[data-type="page"] { color: #7c3aed; background: rgba(124, 58, 237, 0.12); }
.content-type[data-type="note"] { color: #0d9488; background: rgba(13, 148, 136, 0.13); }
:root[data-theme="dark"] .content-type[data-type="post"] { color: #7aa7ff; }
:root[data-theme="dark"] .content-type[data-type="page"] { color: #c4a3ff; }
:root[data-theme="dark"] .content-type[data-type="note"] { color: #5eead4; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .content-type[data-type="post"] { color: #7aa7ff; }
  :root:not([data-theme="light"]) .content-type[data-type="page"] { color: #c4a3ff; }
  :root:not([data-theme="light"]) .content-type[data-type="note"] { color: #5eead4; }
}
.empty-state { color: var(--muted); font-style: italic; text-align: center; }

/* сторінка запису */
.page-content { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: clamp(22px, 5vw, 44px); }
.page-content > h1:first-child, .page-content h1 { font-size: clamp(1.8rem, 4.5vw, 2.5rem); font-weight: 800; margin-top: 0; letter-spacing: -0.02em; }
.page-body { font-size: 1.04rem; }
.page-body p { margin: 0 0 1.05em; }
.page-body img { max-width: 100%; border-radius: 12px; }
.page-body ul, .page-body ol { padding-left: 1.4em; }
.page-body li { margin: 0.25em 0; }
.page-body h1, .page-body h2, .page-body h3 { margin-top: 1.5em; }
.page-body h2 { font-size: 1.45rem; font-weight: 800; }
.page-body blockquote { margin: 1.2em 0; padding: 4px 18px; border-left: 4px solid var(--primary); color: var(--muted); background: var(--surface-alt); border-radius: 0 12px 12px 0; }
.page-body code { background: var(--surface-alt); padding: 2px 6px; border-radius: 6px; font-size: 0.92em; }
.page-body pre { background: var(--surface-alt); padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
.post-date { color: var(--muted); font-size: 0.88rem; margin: 0 0 8px; font-weight: 600; }

.content-categories { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); }
.category-badge {
  display: inline-block; background: var(--surface-alt); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 13px; margin: 0 6px 6px 0; font-size: 0.82rem; font-weight: 700; text-decoration: none; transition: all .15s;
}
.category-badge:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

.search-form { display: flex; gap: 8px; margin-bottom: 24px; }
.search-form input { flex: 1; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; font: inherit; background: var(--surface); color: var(--text); }
.search-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.search-form button, .auth-form button, .comment-form button {
  padding: 11px 22px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border: none; border-radius: 12px;
  cursor: pointer; font: inherit; font-weight: 800; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 35%, transparent); transition: transform .12s, filter .12s;
}
.search-form button:hover, .auth-form button:hover, .comment-form button:hover { transform: translateY(-1px); filter: brightness(1.06); }

.not-found { text-align: center; padding: 70px 0; }
.not-found h1 { font-size: 5rem; margin-bottom: 0; font-weight: 800; background: linear-gradient(120deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.back-link { display: inline-block; margin-top: 20px; text-decoration: none; color: var(--muted); font-weight: 700; }
.back-link:hover { color: var(--primary); }

/* вхід / реєстрація */
.auth-form-page { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 34px; max-width: 440px; margin: 0 auto; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.auth-form input { padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; font: inherit; color: var(--text); background: var(--bg); }
.auth-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.error { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px; padding: 10px 14px; }

/* коментарі */
.comments { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); }
.comment { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; margin-bottom: 12px; }
.comment-date { color: var(--muted); font-size: 0.8rem; margin-left: 8px; }
.comment p { margin: 6px 0 0; }
.comment-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.comment-form textarea { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; font: inherit; min-height: 90px; resize: vertical; background: var(--surface); color: var(--text); }
.comment-form button { align-self: flex-start; }
.comment-as { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }
.comment-login-hint { color: var(--muted); }

/* поява вмісту */
@media (prefers-reduced-motion: no-preference) {
  .site-main > * { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
  .content-list li { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
  .content-list li:nth-child(2) { animation-delay: .04s; } .content-list li:nth-child(3) { animation-delay: .08s; }
  .content-list li:nth-child(4) { animation-delay: .12s; } .content-list li:nth-child(5) { animation-delay: .16s; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 640px) {
  .site-header { padding: 12px 14px; gap: 10px; }
  .header-search { order: 5; width: 100%; }
  .header-search input, .header-search input:focus { width: 100%; }
  .site-account { font-size: 0.8rem; }
  .site-main { margin: 28px auto 48px; }
  .content-card { padding: 15px 16px; }
}
