/* assets/css/main.css */

/* Теми через data-theme на <html> */

:root {
  --bg: #050608;
  --bg-elevated: #0b0d12;
  --border-subtle: #151821;
  --text-main: #f5f5f7;
  --text-muted: #9ea0a8;
  --accent: #4fd1c5;

  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Inter",
    "Segoe UI", sans-serif;

  --radius-md: 10px;
  --radius-lg: 14px;

  --container-width: 1120px;
}

html[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --border-subtle: #d4d4dd;
  --text-main: #111827;
  --text-muted: #6b7280;
  --accent: #4b91ff;
}

/* Базова розмітка + sticky footer */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: #ffffff;
}

html[data-theme="light"] a:hover {
  color: #000000;
}

.site-main {
  flex: 1;
}

/* Layout */

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 16px;
}

.container-narrow {
  max-width: 980px;
}

@media (max-width: 900px) {
  .container-narrow {
    max-width: 100%;
  }
}
/* Header */

.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(5, 6, 8, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

html[data-theme="light"] .site-header {
  background: rgba(245, 245, 247, 0.9);
}

.header-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 0px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
}


.logo {
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

/* NAV по центру */

.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 13px;
}

.main-nav a {
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
}

.main-nav a.active {
  border-color: var(--accent);
  color: var(--text-main);
}

.main-nav a:hover {
  color: var(--text-main);
}

/* Правий блок: тема + бургер */

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Theme toggle (у хедері) */

.theme-toggle {
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle:hover {
  color: var(--text-main);
}

.theme-icon {
  font-size: 13px;
}

.theme-label {
  display: inline-block;
}




/* Основні секції */

.site-main {
  padding: 24px 0 64px;
}

.section {
  padding: 24px 0;
}

.section-header {
  margin-bottom: 16px;
}

.section-header h1,
.section-header h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.section-header h2 {
  font-size: 20px;
}

.section-description {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* Hero на головній */

.hero-section {
  padding-top: 28px;
  padding-bottom: 12px;
}

.hero-inner {
  max-width: 780px;
}

.hero-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.hero-title {
  margin: 0 0 6px;
  font-size: 28px;
}

.hero-text {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: bold;
}

.hero-link,
.hero-link-ghost {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.hero-link {
  background: var(--accent);
  color: #020617;
  border-color: var(--accent);
}

html[data-theme="light"] .hero-link {
  color: #020617;
}

.hero-link-ghost {
  background: transparent;
  color: var(--text-muted);
}

.hero-link:hover,
.hero-link-ghost:hover {
  filter: brightness(1.05);
}

/* Featured */

.featured-section {
  padding-top: 24px;
  padding-bottom: 8px;
}

.featured-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.featured-post {
  padding: 16px 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.featured-title {
  margin: 4px 0 8px;
  font-size: 24px;
  line-height: 1.25;
}

.featured-title a:hover {
  text-decoration: underline;
}

.featured-summary {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Post cards */

.post-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

@media (min-width: 768px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.post-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-meta-line {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.post-type {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.post-date {
  opacity: 0.8;
}

.post-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.post-title a:hover {
  text-decoration: underline;
}

.post-summary {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* Tags */

.post-tags {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag,
.tag-small {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.tag:hover,
.tag-small:hover {
  border-color: var(--accent);
  color: var(--text-main);
}

.tag-list-page {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.tag-list-page a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.tag-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* Post page */

.post-header {
  margin-bottom: 16px;
}

.post-page-title {
  margin: 6px 0 4px;
  font-size: 26px;
}

.post-page-summary {
  margin: 4px 0 8px;
  color: var(--text-muted);
}

.post-content {
  font-size: 15px;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 20px;
  margin-bottom: 8px;
}

.post-content p {
  margin: 0 0 12px;
}

.post-content ul,
.post-content ol {
  margin: 0 0 12px 20px;
  padding: 0;
}

.post-content code {
  font-family: "JetBrains Mono", Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 4px;
  border-radius: 4px;
}

html[data-theme="light"] .post-content code {
  background: rgba(0, 0, 0, 0.06);
}

.post-content pre {
  background: #050608;
  border-radius: 8px;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
}

html[data-theme="light"] .post-content pre {
  background: #111827;
  color: #f9fafb;
}

/* Archive */

.archive-table-wrapper {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  overflow: auto;
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.archive-table th,
.archive-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.archive-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
}

.archive-table tr:last-child td {
  border-bottom: none;
}

/* About */

.about-badge {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.about-title {
  margin: 0 0 6px;
  font-size: 24px;
}

.about-lead {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--text-muted);
}

.about-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 3fr 2fr;
  }
}

.about-block h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.about-block p {
  margin: 0 0 10px;
  font-size: 14px;
}

.about-block-contacts ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
}

/* Footer (прибитий до низу) */

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 14px 0 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

.footer-right {
  display: flex;
  gap: 12px;
}

.footer-link {
  font-size: 12px;
  color: var(--text-muted);
}

.footer-link:hover {
  color: var(--text-main);
}

/* Глобальний loader-стікер */

.global-loader {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);

  font-size: 11px;
  color: var(--text-muted);

  opacity: 1;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.global-loader.hidden {
  opacity: 0;
  transform: translate(-50%, -8px);
}

.loader-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(79, 209, 197, 0.4);
  animation: loader-pulse 1s infinite ease-in-out alternate;
}

.loader-label {
  white-space: nowrap;
}

@keyframes loader-pulse {
  0% {
    transform: scale(0.8);
    box-shadow: 0 0 0 0 rgba(79, 209, 197, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(79, 209, 197, 0);
  }
}

/* Responsive */
@media (max-width: 999px) {
  .header-inner {
    height: auto;
    padding: 8px 0;
  }
}

@media (max-width: 768px) {
  .header-inner {
    height: auto;
    padding: 8px 0;
  }

  .main-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 56px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 10px;
    display: none;
  }

  body.nav-open .main-nav {
    display: flex;
  }

  .main-nav a {
    padding: 6px 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .theme-label {
    display: none; /* на мобілці тільки іконка */
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .post-page-title {
    font-size: 22px;
  }

  .featured-title {
    font-size: 20px;
  }
}





.nav-toggle {
  display: none; /* покажемо тільки на мобілці */
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-elevated);
  width: 34px;
  height: 28px;
  padding: 0;
  cursor: pointer;
  position: relative;

  display: none; /* по дефолту прихований, нижче в media включимо */
}

.nav-toggle span {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-main);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    top 0.2s ease;
}

/* 3 лінії бургерa */
.nav-toggle span:nth-child(1) {
  top: 8px;
}

.nav-toggle span:nth-child(2) {
  top: 13px;
}

.nav-toggle span:nth-child(3) {
  top: 18px;
}

/* Стан відкритого меню — перша й третя стають X, середня зникає */
body.nav-open .nav-toggle span:nth-child(1) {
  top: 13px;
  transform: rotate(45deg);
}

body.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle span:nth-child(3) {
  top: 13px;
  transform: rotate(-45deg);
}

@media (max-width: 768px) {
  .header-inner {
    height: auto;
    padding: 8px 16px;
  }

    .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }


  .main-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 56px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    gap: 0;
    padding: 8px 16px 10px;
    display: none;
    text-align: center;
  }

  body.nav-open .main-nav {
    display: flex;
  }

  .main-nav a {
    padding: 6px 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .theme-label {
    display: none; /* на мобі тільки іконка */
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
  }

  .footer-brand {
    text-align: center;
  }
}

.tags{
    font-size: 20px;
    color: #4b91ff;
    font-weight: normal;
}