/* LifeDB theme: 3 palettes x light/dark + new header.
   Save as public/assets/css/ldb-theme.css (same folder as style.css) */

/* ---------- palettes (default = sand, light) ---------- */
:root,
html[data-palette="sand"][data-mode="light"] {
  --t-bg:#F6F2EA; --t-sf:#FCFAF5; --t-tx:#2B2A33; --t-mu:#6B6877;
  --t-ac:#3F4C9A; --t-on:#FFFFFF; --t-ch:#E6E8F4; --t-bd:#E2DACB;
}
html[data-palette="sand"][data-mode="dark"] {
  --t-bg:#16161C; --t-sf:#1F1F27; --t-tx:#E8E7EE; --t-mu:#A3A1B3;
  --t-ac:#9AA6F0; --t-on:#14152A; --t-ch:#2A2B3A; --t-bd:#363745;
}
html[data-palette="sage"][data-mode="light"] {
  --t-bg:#F3F5F1; --t-sf:#FAFBF8; --t-tx:#26302B; --t-mu:#5E6B63;
  --t-ac:#2F6F5E; --t-on:#FFFFFF; --t-ch:#E1EBE4; --t-bd:#D9E0DA;
}
html[data-palette="sage"][data-mode="dark"] {
  --t-bg:#151A18; --t-sf:#1D2321; --t-tx:#E4E9E5; --t-mu:#9AA8A0;
  --t-ac:#6FBFA3; --t-on:#12201A; --t-ch:#26302C; --t-bd:#34403A;
}
html[data-palette="terra"][data-mode="light"] {
  --t-bg:#F1F4F7; --t-sf:#F9FAFB; --t-tx:#1E2A35; --t-mu:#5B6B7A;
  --t-ac:#B4532A; --t-on:#FFFFFF; --t-ch:#FBE9E0; --t-bd:#D8DFE6;
}
html[data-palette="terra"][data-mode="dark"] {
  --t-bg:#12171C; --t-sf:#1A2128; --t-tx:#E5EAEF; --t-mu:#9AA9B7;
  --t-ac:#F0A27A; --t-on:#2A1608; --t-ch:#2C241F; --t-bd:#2E3944;
}

/* ---------- gentle site-wide colours (old pages pick these up) ---------- */
html body { background: var(--t-bg); color: var(--t-tx); }
html h1, html h2, html h3, html h4, html h5, html h6 { color: var(--t-tx); }
html .card { background: var(--t-sf); border-color: var(--t-bd); color: var(--t-tx); }
html .card-header { background: var(--t-ch); border-color: var(--t-bd); color: var(--t-tx); }
html .card-footer { background: var(--t-sf); border-color: var(--t-bd); }
html .form-control { background: var(--t-sf); color: var(--t-tx); border-color: var(--t-bd); }
html .form-control::placeholder { color: var(--t-mu); }
html .text-muted { color: var(--t-mu) !important; }
html .btn-primary { background: var(--t-ac); border-color: var(--t-ac); color: var(--t-on); }
html .btn-primary:hover { opacity: .9; background: var(--t-ac); border-color: var(--t-ac); color: var(--t-on); }
html .button { background: var(--t-ac); border-color: var(--t-ac); color: var(--t-on); }
html .heading_button { background: var(--t-ch); color: var(--t-tx); border-color: var(--t-bd); }
html .single-recent-blog-post { background: var(--t-sf); box-shadow: 0 2px 12px rgba(0,0,0,.08); }
html .single-recent-blog-post .thumb-info { background: var(--t-sf); }
html .single-recent-blog-post .thumb-info li,
html .single-recent-blog-post .thumb-info li a,
html .single-recent-blog-post .details p { color: var(--t-mu); }
html .widget-wrap .post-category-widget .cat-list li { background: var(--t-sf); }
html .widget-wrap .post-category-widget .cat-list li a,
html .widget-wrap .post-category-widget .cat-list li a h2 { color: var(--t-tx); }
html .widget-wrap .post-category-widget .cat-list li:hover { background: var(--t-ch); }
html .widget-wrap .post-category-widget .cat-list li:hover a h2 { color: var(--t-ac); }
html .page-link { color: var(--t-ac); background: transparent; border-color: var(--t-bd); }
html .blog-pagination .page-link { color: var(--t-tx); border-color: var(--t-bd); }
html .blog-pagination .page-item.active .page-link { color: var(--t-ac); border-color: var(--t-ac); }

/* ---------- new header ---------- */
.lt-hdr { position: sticky; top: 0; z-index: 99; background: var(--t-sf); border-bottom: 1px solid var(--t-bd); }
.lt-hdr-in { display: flex; align-items: center; gap: 12px; max-width: 1240px; margin: 0 auto; padding: 8px 16px; flex-wrap: wrap; }
.lt-hdr a { display: inline-block; text-decoration: none; }

.lt-brand { display: flex !important; align-items: center; gap: 10px; flex: none; }
.lt-brand img { height: 42px; width: auto; border-radius: 6px; }
.lt-brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.lt-brand-txt strong { font-size: 18px; font-weight: 700; color: var(--t-tx); }
.lt-brand-txt small { font-size: 11px; color: var(--t-mu); letter-spacing: .02em; }

.lt-menu { flex: 1 1 auto; }
.lt-nav { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.lt-item { position: relative; margin: 0; }
.lt-link { padding: 8px 12px; color: var(--t-tx); font-size: 15px; font-weight: 500; border-radius: 8px; }
.lt-link:hover { background: var(--t-ch); color: var(--t-ac); }
.lt-item.active > .lt-link { background: var(--t-ch); color: var(--t-ac); }
.lt-link.dropdown-toggle::after { margin-left: 6px; vertical-align: 2px; }

.lt-hdr .dropdown-menu { background: var(--t-sf); border: 1px solid var(--t-bd); border-radius: 10px; padding: 6px; min-width: 210px; box-shadow: 0 8px 24px rgba(0,0,0,.14); margin-top: 6px; }
.lt-hdr .dropdown-menu li { list-style: none; margin: 0; }
.lt-hdr .dropdown-menu .nav-link,
.lt-hdr .dropdown-menu a { display: block; padding: 8px 12px; color: var(--t-tx); font-size: 14px; border-radius: 6px; width: 100%; text-align: left; }
.lt-hdr .dropdown-menu .nav-link:hover,
.lt-hdr .dropdown-menu a:hover { background: var(--t-ch); color: var(--t-ac); }
.lt-hdr .scrollable-dropdown { max-height: 350px; overflow-y: auto; }
.lt-hdr .lt-logout { border: 0; background: transparent; cursor: pointer; }

.lt-tools { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }

.lt-pal { display: flex; align-items: center; gap: 8px; }
.lt-pal button { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--t-sf); box-shadow: 0 0 0 1px var(--t-bd); padding: 0; cursor: pointer; }
.lt-pal [data-pal="sage"] { background: #2F6F5E; }
.lt-pal [data-pal="sand"] { background: #3F4C9A; }
.lt-pal [data-pal="terra"] { background: #B4532A; }
html[data-palette="sage"] .lt-pal [data-pal="sage"],
html[data-palette="sand"] .lt-pal [data-pal="sand"],
html[data-palette="terra"] .lt-pal [data-pal="terra"] { box-shadow: 0 0 0 2px var(--t-tx); }
.lt-pal-big button { width: 30px; height: 30px; }
.lt-pal-login { text-align: center; margin-bottom: 20px; }
.lt-pal-login .lt-pal { justify-content: center; }
.lt-pal-login small { display: block; margin-bottom: 8px; color: #6b6877; }

.lt-mode, .lt-icon-btn { position: relative; width: 36px; height: 36px; display: inline-flex !important; align-items: center; justify-content: center; border: 1px solid var(--t-bd); background: var(--t-sf); color: var(--t-tx); border-radius: 50%; cursor: pointer; padding: 0; font-size: 15px; }
.lt-mode:hover, .lt-icon-btn:hover { border-color: var(--t-ac); color: var(--t-ac); }
.lt-ic-sun { display: none; }
html[data-mode="dark"] .lt-ic-sun { display: inline; }
html[data-mode="dark"] .lt-ic-moon { display: none; }
.lt-icon-btn::after { display: none; }
.lt-badge { position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; border-radius: 8px; background: #d93025; color: #fff; font-size: 10px; line-height: 16px; text-align: center; padding: 0 3px; }

.lt-user-btn { width: auto; border-radius: 20px; padding: 2px 12px 2px 2px; gap: 8px; }
.lt-user-btn img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.lt-user-name { font-size: 14px; font-weight: 500; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lt-btn { padding: 7px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; }
.lt-btn-ghost { color: var(--t-tx); border: 1px solid var(--t-bd); }
.lt-btn-ghost:hover { border-color: var(--t-ac); color: var(--t-ac); }
.lt-btn-solid { background: var(--t-ac); color: var(--t-on) !important; border: 1px solid var(--t-ac); }
.lt-btn-solid:hover { opacity: .9; }

.lt-burger { display: none; width: 38px; height: 38px; border: 1px solid var(--t-bd); background: var(--t-sf); color: var(--t-tx); border-radius: 8px; font-size: 17px; cursor: pointer; }

/* desktop: menu always visible, hover opens dropdowns */
@media (min-width: 992px) {
  .lt-menu.collapse:not(.show) { display: block !important; }
  .lt-tools .lt-burger { display: none; }
}

/* tablet + phone: slim bar, menu opens as a panel under it */
@media (max-width: 991.98px) {
  .lt-hdr-in { padding: 6px 12px; gap: 8px; }
  .lt-brand img { height: 36px; }
  .lt-burger { display: inline-flex; align-items: center; justify-content: center; }
  .lt-menu { order: 5; flex-basis: 100%; }
  .lt-nav { flex-direction: column; align-items: stretch; padding: 6px 0 10px; }
  .lt-link { display: block; }
  .lt-menu .dropdown-menu { position: static !important; transform: none !important; float: none; border: 0; box-shadow: none; background: transparent; padding: 0 0 0 12px; margin: 0; }
  .lt-user-name { display: none; }
  .lt-user-btn { padding: 2px; border-radius: 50%; }
  .lt-btn { display: none; }
  .lt-pal button { width: 22px; height: 22px; }
}
@media (max-width: 380px) {
  .lt-brand-txt small { display: none; }
  .lt-pal { gap: 6px; }
}

/* post page focus mode hides the header (kept from the old header) */
html.ldb-focus .lt-hdr { display: none !important; }


/* ---------- appearance block (inside avatar menu and Me sheet) ---------- */
.lt-appearance { padding: 8px 12px 10px; border-top: 1px solid var(--t-bd); border-bottom: 1px solid var(--t-bd); margin: 4px 0; list-style: none; }
.lt-app-title { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--t-mu); margin-bottom: 8px; }
.lt-appearance .lt-pal { margin-bottom: 10px; }
.lt-mode-text { width: 100%; height: auto; border-radius: 8px; padding: 7px 10px; gap: 8px; justify-content: flex-start; font-size: 14px; }

/* ---------- mobile bottom navigation ---------- */
.lt-bottom, .lt-sheet, .lt-sheet-bg { display: none; }
@media (max-width: 991.98px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .lt-bottom { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; background: var(--t-sf); border-top: 1px solid var(--t-bd); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 12px rgba(0,0,0,.08); }
  .lt-bn { flex: 1; display: flex !important; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; color: var(--t-mu); font-size: 11px; padding: 4px 0; cursor: pointer; text-decoration: none; line-height: 1.2; }
  .lt-bn i { font-size: 18px; }
  .lt-bn.on, .lt-bn.open { color: var(--t-ac); font-weight: 600; }

  .lt-sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 110; }
  .lt-sheet-bg.on { display: block; }
  .lt-sheet { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; max-height: 78vh; background: var(--t-sf); color: var(--t-tx); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.25); transform: translateY(110%); visibility: hidden; transition: transform .25s ease, visibility .25s; padding-bottom: env(safe-area-inset-bottom); }
  .lt-sheet.on { transform: none; visibility: visible; }
  .lt-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--t-bd); font-size: 16px; }
  .lt-sheet-x { border: 0; background: transparent; color: var(--t-tx); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
  .lt-sheet-body { overflow-y: auto; padding: 4px 16px 16px; -webkit-overflow-scrolling: touch; }
  .lt-sheet-body a { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 4px; border-bottom: 1px solid var(--t-bd); color: var(--t-tx); font-size: 15px; text-decoration: none; }
  .lt-sheet-body a:hover { color: var(--t-ac); }
  .lt-sheet-body a i { width: 20px; text-align: center; color: var(--t-mu); }
  .lt-sheet-body a img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
  .lt-count { margin-left: auto; color: var(--t-mu); font-size: 13px; }
  .lt-note { color: var(--t-mu); padding: 12px 4px; margin: 0; font-size: 14px; }
  .lt-more { display: block; width: 100%; margin-top: 12px; padding: 10px; border: 1px solid var(--t-bd); background: var(--t-ch); color: var(--t-tx); border-radius: 8px; font-size: 14px; cursor: pointer; }
  .lt-out { background: transparent; color: #c0392b; border-color: #c0392b; }
  .lt-appearance-sheet { margin: 12px 0; border: 1px solid var(--t-bd); border-radius: 10px; }
}

/* ---------- series pages ---------- */
html .list-group-item { background: var(--t-sf); color: var(--t-tx); border-color: var(--t-bd); }
html .list-group-item a { color: var(--t-ac); }
html .btn-outline-primary { color: var(--t-ac); border-color: var(--t-ac); background: transparent; }
html .btn-outline-primary:hover { background: var(--t-ac); color: var(--t-on); border-color: var(--t-ac); }
html .btn-link { color: var(--t-ac); }
html .lead { color: var(--t-mu); }
html input[type="search"].form-control { background: var(--t-sf); color: var(--t-tx); border-color: var(--t-bd); }