/* FILE: /assets/article/css/base.css
   FIX:
   - прибрали transform з body (щоб fixed працював правильно)
   - плавність залишили на .page-fade
*/

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  font-family: 'Raleway', sans-serif;
  background: #f8fafc;
  color: #2d3748;
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  /* важливо: НЕ використовуй transform на body */
  opacity: 0;
  transition: opacity 420ms ease;
}

body.is-ready {
  opacity: 1;
}

.container {
  max-width: 100vw;
  flex: 1;
  display: flex;
  flex-direction: column;
}

#main_part {
  max-width: 1650px;
  margin: 0 auto;
  flex: 1;
}

/* плавна поява тільки контенту (а не всього body) */
.page-fade {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 520ms ease, transform 620ms ease;
  will-change: opacity, transform;
}

body.is-ready .page-fade {
  opacity: 1;
  transform: translateY(0);
}

/* dark mode (base) */
body.dark-mode {
  background: #0b1220;
  color: #e5e7eb;
}

body.dark-mode .container {
  background: transparent;
}

/* responsive (base) */
@media (max-width: 900px) {
  #main_part {
    max-width: 100%;
  }
}

/* =========================
   floating buttons MUST stay fixed
   ========================= */
.dark-mode-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(2, 6, 23, 0.12);
  border-radius: 999px;
  cursor: pointer;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.14);
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.dark-mode-toggle:hover {
  transform: translateY(-1px) scale(1.06);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.18);
}

#mode-icon {
  font-size: 24px;
  transition: transform 0.3s;
}

/* dark mode */
body.dark-mode .dark-mode-toggle {
  background: rgba(17, 24, 39, 0.80);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.40);
}

/* responsive */
@media (max-width: 650px) {
  .dark-mode-toggle {
    width: 46px;
    height: 46px;
    bottom: 16px;
    left: 16px;
  }

  #mode-icon {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .page-fade,
  .dark-mode-toggle,
  #mode-icon {
    transition: none !important;
  }
  body {
    opacity: 1 !important;
  }
  .page-fade {
    opacity: 1 !important;
    transform: none !important;
  }
}
#to_top_btn{
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  left: auto !important;
  top: auto !important;

  background: #22c55e !important;
  padding: 10px !important;
  border-radius: 999px !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;

  box-shadow: 0 8px 22px rgba(2, 6, 23, 0.18) !important;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease !important;

  z-index: 2000 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#to_top_btn.is-show{
  opacity: 1 !important;
  pointer-events: auto !important;
}

#to_top_btn:hover{
  background: #16a34a !important;
  transform: translateY(-1px) !important;
}

#img_top{
  width: 24px !important;
  height: 24px !important;
  filter: invert(1) !important;
}