/* layout.css: сітка, шапка, підвал
   Канонічне джерело: docs/design-system.md §9
   Порядок: core → layout → components → themes → print → nichlyst
   TECH_STANDARDS.md §4.1 */

/* Skip-link (TECH_STANDARDS §63, крок 135): прихований поки не отримає фокус.
   position: absolute не впливає на потік; при фокусі фіксується зверху
   з видимим акцентним обідком (глобальний :focus-visible, core.css). */
.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--accent);
}

/* Базова сітка */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Головна: герой (мета → теза → лід → лист → паспорт).
   design-system.md §6.3: відступи між секціями — робота лейаутів. */
.home-hero {
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.home-lead {
  font-size: var(--text-lg);
  color: var(--ink);
  margin: 0 0 1.5rem;
}

/* Секції головної: верхня лінія + оксидний відрізок (design-system §1). */
article.home section {
  position: relative;
  border-top: 1px solid var(--rule);
  padding-top: 1.75rem;
  margin-bottom: 2.5rem;
}

article.home section::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 2.5rem;
  height: 1px;
  background: var(--accent);
}

/* Блок «Розділи» (крок 141): моно-нумерація — системний вивід
   decimal-leading-zero (01, 02…), design-system.md §5.8.3. */
.home-sections-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-sections-list li {
  margin-bottom: 0.5rem;
}

.home-sections-list li:last-child {
  margin-bottom: 0;
}

.home-sections-list a {
  color: var(--ink);
  text-decoration: none;
}

.home-sections-list a:hover,
.home-sections-list a:focus-visible {
  color: var(--accent);
}

.entry-meta {
  font-size: var(--text-sm);
  color: var(--ink-dim);
  margin: 0 0 1.5rem;
}

/* Час читання у списку головної: після « · », без власного відступу
   (спек 2026-11-05, §6: «Назва · Приблизно N хвилин читання.»). */
.archive-list .entry-meta {
  margin: 0;
}

.entry-body {
  max-width: var(--measure);
}

/* Секції «Стан» (/now/, крок 127): простір між блоками (§6.3). */
.now-season {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 2rem;
}

.now-section {
  margin-bottom: 2rem;
}

.now-section h2 {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
  margin: 0 0 0.75rem;
}

.now-section ul {
  margin: 0;
  padding-left: 1.25rem;
}

.now-energy {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--ink);
  margin: 0;
}

/* Шапка */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem 1rem;
}

.site-header__inner {
  /* ch рахується у шрифті та кеглі елемента: контекст = шрифт контенту
     (main, Georgia 16px), щоб колонка шапки збігалася з текстовою.
     Діти мають власні --font-* і не змінюються. */
  max-width: var(--measure);
  font-family: var(--font-text);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-logo {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.site-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-nav a {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--ink-dim);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
}

.site-nav a[aria-current="page"] {
  font-family: var(--font-mono);
  color: var(--ink);
}

.site-nav a[aria-current="page"]::before {
  content: "[ ";
}

.site-nav a[aria-current="page"]::after {
  content: " ]";
}

/* Підвал */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 1rem;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--ink-dim);
}

.site-footer__inner {
  /* ch рахується у шрифті елемента: контекст — шрифт контенту,
     щоб колонка підвалу збігалася з main. Діти повертають --font-ui. */
  max-width: var(--measure);
  font-family: var(--font-text);
  font-size: 1rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-footer__inner > * {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
}

.site-footer a {
  color: var(--ink-dim);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent);
}

.footer-label {
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.footer-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-place {
  font-style: italic;
  color: var(--ink-dim);
}

/* Службовий лінк (приватність): дрібніший, не претендує на увагу (§17.2). */
.footer-legal {
  font-size: var(--text-sm);
  margin-top: 0.5rem;
}

.footer-legal a {
  color: var(--ink-dim);
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
  color: var(--accent);
}
