/* Fonts and variables are in fonts.css */

/* ─── Сброс ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Шапка ─── */
header {
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 50%, #7c3aed 100%);
  color: white;
  padding: 20px 24px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(168,85,247,0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: 620px;
  margin: 0 auto;
}

.logo-icon {
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

header h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
header p {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 1px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.cabinet-link {
  margin-left: auto;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  color: white;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.15);
}
.cabinet-link:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.theme-toggle {
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  margin-left: 6px;
}
.theme-toggle:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

/* ─── Контент ─── */
main {
  flex: 1;
  max-width: 620px;
  margin: 0 auto;
  padding: 32px 16px 56px;
  width: 100%;
}


button {
  padding: 12px 24px;
  min-height: 46px;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: -0.1px;
}

button:hover {
  opacity: 0.92;
  box-shadow: 0 6px 20px rgba(168,85,247,0.3);
  transform: translateY(-2px);
}
button:active {
  transform: scale(0.97) translateY(0);
  box-shadow: none;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

/* ─── Подвал ─── */
footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid rgba(200,100,150,0.08);
  background: var(--card-bg);
}

/* ─── Promo cards (below main content) ─── */
/* ─── Site nav ─── */
.site-nav {
  display: flex; gap: 10px; padding: 12px 16px 8px;
  overflow-x: auto; scrollbar-width: none; justify-content: center;
  max-width: 620px; margin: 0 auto;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav-link {
  display: inline-flex; align-items: center; gap: 4px; padding: 9px 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fce7f3, #f3e8ff);
  color: #a855f7;
  text-decoration: none; font-size: 13px; font-weight: 700;
  white-space: nowrap; transition: all .25s;
  border: 1.5px solid rgba(168,85,247,0.15);
  box-shadow: 0 2px 8px rgba(200,100,150,0.12);
  flex-shrink: 0; letter-spacing: 0.1px;
}
.site-nav-link:hover {
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 16px rgba(168,85,247,0.35);
  transform: translateY(-1px);
}
.site-nav-link.active {
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 16px rgba(168,85,247,0.35);
}

.promo-section { max-width: 480px; margin: 0 auto; padding: 0 16px; }
.promo-section--top { margin-top: 24px; }
.promo-section--mb10 { margin-bottom: 10px; }
.promo-section--mb20 { margin-bottom: 20px; }
.promo-section--mb24 { margin-bottom: 24px; }

.promo-weeks-link {
  display: block; background: linear-gradient(135deg, #fce7f3, #f3e8ff); border-radius: 16px;
  padding: 18px 20px; text-decoration: none; color: var(--text);
  text-align: center; font-weight: 700; font-size: 16px;
  border: 1px solid rgba(200,100,150,0.12); box-shadow: var(--shadow);
  transition: all .25s; margin-bottom: 10px;
}
.promo-calc-link {
  display: block; background: linear-gradient(135deg, #fce7f3, #f3e8ff);
  border-radius: 14px; padding: 16px 18px; text-decoration: none;
  text-align: center; border: 1px solid rgba(200,100,150,0.12);
  box-shadow: var(--shadow); transition: all .25s;
}
.promo-calc-title { font-size: 13px; font-weight: 700; color: var(--text); }
.promo-calc-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.promo-cards-row { display: flex; gap: 10px; }
.promo-card-link {
  flex: 1; display: block; background: var(--card-bg); border-radius: 14px;
  padding: 16px 12px; text-decoration: none; text-align: center;
  border: 1px solid rgba(200,100,150,0.1); box-shadow: var(--shadow);
  transition: all .25s;
}
.promo-card {
  flex: 1; background: var(--card-bg); border-radius: 14px;
  padding: 16px 12px; text-align: center;
  border: 1px solid rgba(200,100,150,0.1); box-shadow: var(--shadow);
}
.promo-card-emoji { font-size: 28px; margin-bottom: 6px; }
.promo-card-title { font-size: 13px; font-weight: 700; color: var(--text); }
.promo-card-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.city-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.city-tag {
  font-size: 11px; color: var(--pink); text-decoration: none;
  font-weight: 600; padding: 3px 8px; border-radius: 8px;
  background: var(--pink-light);
}

/* Articles section */
.articles-card {
  background: var(--card-bg); border-radius: 16px;
  padding: 24px 20px; box-shadow: var(--shadow);
}
.articles-title {
  margin: 0 0 16px; font-size: 18px; font-weight: 800;
  color: var(--text); text-align: center;
}
.articles-list { display: flex; flex-direction: column; gap: 10px; }
.articles-link {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--text);
  font-size: 14px; font-weight: 600;
}
.articles-link-emoji { font-size: 24px; }
.articles-more { text-align: center; margin-top: 16px; }
.articles-more a {
  color: var(--pink); font-size: 14px;
  font-weight: 700; text-decoration: none;
}

/* BirthPlanAI banner */
.birthplan-banner {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border-radius: 16px; padding: 24px 20px; text-align: center;
  box-shadow: 0 8px 32px rgba(99,102,241,0.25);
}
.birthplan-title { margin: 0 0 8px; font-size: 18px; font-weight: 800; color: #fff; }
.birthplan-text { margin: 0 0 14px; font-size: 14px; color: rgba(255,255,255,0.9); }
.birthplan-btn {
  display: inline-block; background: #fff; color: #6366f1;
  border-radius: 14px; padding: 12px 28px; font-weight: 700;
  text-decoration: none; font-size: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); transition: all .25s;
}

/* Footer nav */
footer nav { margin-top: 8px; font-size: 13px; }
footer nav a { color: var(--muted); text-decoration: none; }

/* Site name h1 */
.site-name { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; margin: 0; }

/* Lang toggle button */
.lang-toggle { font-size: 13px; font-weight: 700; }

/* ─── Адаптив ─── */

/* touch: убираем задержку 300ms */
button, a, label { touch-action: manipulation; }

/* Tablet (481–768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .header-inner    { max-width: 720px; }
  main             { max-width: 720px; padding: 28px 24px 48px; }
  .promo-section   { max-width: 560px; }
  .cards-grid      { gap: 20px; }
  .fruit-card      { padding: 28px 24px; }
  .kick-counter    { padding: 28px 24px; }
  .week-nav        { gap: 12px; }
}

@media (max-width: 480px) {
  /* Шапка */
  header           { padding: 14px 12px; }
  .logo-icon       { font-size: 34px; }
  header h1        { font-size: 20px; }
  header p         { font-size: 12px; }
  .cabinet-link    { padding: 7px 12px; font-size: 13px; }
  .theme-toggle    { width: 36px; height: 36px; font-size: 16px; margin-left: 4px; }
  .header-inner    { gap: 8px; }

  /* Контент */
  main             { padding: 20px 12px 40px; }

  /* Hover-эффекты: убираем на мобильных */
  .wk-author:hover,
  .wk-sources:hover,
  .wk-related-links a:hover {
    transform: none;
  }
}
/* Очень маленькие (< 360px) */
@media (max-width: 360px) {
  .logo-icon    { font-size: 28px; }
  header h1     { font-size: 18px; }
  .cabinet-link { padding: 6px 10px; font-size: 12px; }
  .week-nav button { padding: 8px 10px; font-size: 12px; }
}

/* ─── Зменшення руху для користувачів з вестибулярними порушеннями ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Фокус для клавіатурної навігації ─── */
:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
}

/* ─── Skip-to-content ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 1000;
  padding: 12px 24px;
  background: var(--purple);
  color: #fff;
  border-radius: 0 0 12px 12px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* ─── Print styles ─── */
@media print {
  body { background: #fff; font-size: 12pt; }
  nav, footer, .fab, .kick-section, .theme-toggle,
  .skip-link, .onboard-overlay, #themeToggle,
  .tab-bar, button, .share-btn, .install-banner,
  #pwa-install-banner { display: none !important; }
  .card, .week-card, section {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  a { color: inherit; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #666; }
  :root { --bg: #fff; --text: #000; --card-bg: #fff; }
}

/* ─── Accessibility ─── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.medical-disclaimer {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 8px;
  opacity: 0.8;
}

/* ─── Toast banners (PWA install, SW update) ─── */
.toast-banner {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #ec4899, #a855f7); color: #fff;
  padding: 14px 24px; border-radius: 16px; font-size: 14px; font-weight: 600;
  z-index: 9999; box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex; align-items: center; gap: 12px; max-width: 90vw;
}
.toast-btn {
  background: #fff; color: #a855f7; border: none; padding: 8px 16px;
  border-radius: 10px; font-weight: 700; cursor: pointer;
  font-size: 13px; white-space: nowrap;
}
.toast-close {
  background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 18px; cursor: pointer; padding: 0 0 0 4px;
}
