/* Cosmo-Pravda — neumorphism base */
:root {
  --cp-bg: #e8ecf1;
  --cp-surface: #f5f7fa;
  --cp-text: #1f2937;
  --cp-muted: #6b7280;
  --cp-accent: #f59e0b;
  --cp-good: #10b981;
  --cp-bad: #ef4444;
  --cp-shadow: 8px 8px 16px rgba(163, 177, 198, 0.45), -8px -8px 16px rgba(255, 255, 255, 0.9);
  --cp-shadow-in: inset 4px 4px 8px rgba(163, 177, 198, 0.35), inset -4px -4px 8px rgba(255, 255, 255, 0.9);
  --cp-radius: 20px;
  --cp-pill: 999px;
  --cp-grid-max: 1100px;
  --cp-grid-pad: 1.25rem;
}

:root {
  --cp-font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cp-text-base: 1rem;
  --cp-text-sm: 0.875rem;
  --cp-text-xs: 0.8125rem;
  --cp-leading: 1.6;
  --cp-h1: clamp(1.75rem, 4vw, 2.375rem);
  --cp-h2: 1.5rem;
}

html {
  scroll-padding-top: calc(var(--cp-header-offset, 84px) + 0.75rem);
}

body {
  background: var(--cp-bg) !important;
  font-family: var(--cp-font);
  font-size: var(--cp-text-base);
  line-height: var(--cp-leading);
  color: var(--cp-text);
  -webkit-font-smoothing: antialiased;
  padding-top: var(--cp-header-offset, 84px);
}

/* Контент главной без лишних отступов темы — сетка в блоках плагина */
body.home main.wp-block-group,
body.home .entry-content,
body.home .wp-block-post-content {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body .cp-section,
body .cp-hero,
body .cp-site-header,
body .cp-site-footer {
  font-family: var(--cp-font);
}

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

.cp-site-footer a:hover {
  color: var(--cp-text);
}

.cp-footer-links {
  font-size: var(--cp-text-sm, 0.875rem);
  margin: 0.5rem 0;
}

.cp-footer-links a {
  color: var(--cp-muted);
  text-decoration: none;
}

.cp-footer-links a:hover {
  color: var(--cp-accent, #f59e0b);
}

/* Страница политики конфиденциальности */
body.page-privacy-policy .wp-block-post-content,
body.privacy-policy .entry-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  font-size: var(--cp-text-base, 1rem);
  line-height: var(--cp-leading, 1.6);
}

body.page-privacy-policy .wp-block-post-content h1,
body.privacy-policy .entry-content h1 {
  font-size: var(--cp-h1, 1.75rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

body.page-privacy-policy .wp-block-post-content h2,
body.privacy-policy .entry-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

body.page-privacy-policy .wp-block-post-content p,
body.page-privacy-policy .wp-block-post-content li,
body.privacy-policy .entry-content p,
body.privacy-policy .entry-content li {
  font-size: var(--cp-text-sm, 0.875rem);
  color: var(--cp-text);
}

body.page-privacy-policy .wp-block-post-content a {
  color: var(--cp-accent, #f59e0b);
}

header.wp-block-template-part {
  position: relative;
  z-index: 200;
  margin: 0;
}

.cp-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 200;
  background: rgba(232, 236, 241, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.7rem 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.cp-header-inner {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--cp-grid-max);
  margin: 0 auto;
  padding: 0 var(--cp-grid-pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.5rem;
  position: relative;
  min-height: 56px;
}

.cp-logo {
  display: flex;
  align-items: center;
  align-self: center;
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.cp-logo:hover {
  transform: scale(1.02);
  filter: brightness(1.03);
}

.cp-logo-img {
  display: block;
  height: 56px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.cp-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  grid-column: 2;
  justify-self: end;
}

.cp-nav a {
  position: relative;
  padding: 0.55rem 1.15rem;
  border-radius: var(--cp-pill);
  text-decoration: none;
  color: var(--cp-muted);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--cp-surface);
  box-shadow: var(--cp-shadow);
  transition:
    color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
  overflow: hidden;
}

.cp-nav a::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.04));
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 0;
}

.cp-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--cp-accent);
  transform: translateX(-50%);
  transition: width 0.25s ease;
  pointer-events: none;
  z-index: 0;
}

.cp-nav a:hover,
.cp-nav a:focus-visible {
  color: var(--cp-text);
  transform: translateY(-1px);
  box-shadow: 10px 10px 18px rgba(163, 177, 198, 0.42), -6px -6px 14px rgba(255, 255, 255, 0.95);
}

.cp-nav a:hover::before,
.cp-nav a.is-active::before {
  opacity: 1;
}

.cp-nav a:hover::after,
.cp-nav a.is-active::after {
  width: 55%;
}

.cp-nav a.is-active {
  color: var(--cp-text);
  background: #fff;
  box-shadow:
    inset 2px 2px 4px rgba(163, 177, 198, 0.25),
    6px 6px 14px rgba(163, 177, 198, 0.35);
}

.cp-burger {
  display: none;
  grid-column: 2;
  justify-self: end;
  align-self: center;
  background: var(--cp-surface);
  border: none;
  border-radius: 14px;
  padding: 0.65rem 0.9rem;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--cp-text);
  box-shadow: var(--cp-shadow);
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cp-burger:hover,
.cp-burger.is-open {
  transform: scale(1.03);
  box-shadow: 10px 10px 18px rgba(163, 177, 198, 0.4), -6px -6px 14px rgba(255, 255, 255, 0.9);
}

.cp-site-footer {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--cp-grid-max);
  margin: 4rem auto 0;
  padding: 2rem var(--cp-grid-pad) 2.5rem;
  text-align: center;
  color: var(--cp-muted);
  font-size: 0.85rem;
}

/* Планшеты и узкие экраны — бургер вместо ряда кнопок */
@media (max-width: 960px) {
  .cp-burger {
    display: block;
    grid-column: 2;
    grid-row: 1;
    flex-shrink: 0;
  }

  .cp-nav {
    display: none;
    position: fixed;
    top: var(--cp-header-offset, 72px);
    left: var(--cp-grid-pad);
    right: var(--cp-grid-pad);
    z-index: 199;
    grid-column: auto;
    justify-self: auto;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.5rem;
    box-sizing: border-box;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0.75rem 0.85rem;
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - var(--cp-header-offset, 72px) - 0.75rem);
    max-height: calc(100vh - var(--cp-header-offset, 72px) - 0.75rem);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(232, 236, 241, 0.98);
    border-radius: var(--cp-radius);
    box-shadow: 0 14px 28px rgba(163, 177, 198, 0.35);
    animation: cp-nav-slide 0.28s ease;
  }

  .cp-nav.is-open {
    display: flex;
  }

  .cp-nav a {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    padding: 0.72rem 0.85rem;
    border-radius: 14px;
    white-space: normal;
    word-break: break-word;
  }

  .cp-nav a::after {
    bottom: 8px;
    height: 3px;
  }

  .cp-nav a.is-active {
    color: var(--cp-text);
    background: var(--cp-surface);
  }
}

body.cp-nav-open {
  overflow: hidden;
}

@media (max-width: 768px) {
  .cp-site-header {
    padding: 0.65rem 0;
  }

  .cp-header-inner {
    min-height: 48px;
    padding: 0 var(--cp-grid-pad);
    column-gap: 0.5rem;
  }

  .cp-logo {
    grid-column: 1;
    grid-row: 1;
  }

  .cp-logo-img {
    height: 48px;
  }
}

@media (max-width: 400px) {
  :root {
    --cp-grid-pad: 0.85rem;
  }

  .cp-logo-img {
    height: 42px;
  }

  .cp-burger {
    padding: 0.55rem 0.7rem;
    font-size: 1.2rem;
  }

  .cp-nav {
    left: var(--cp-grid-pad);
    right: var(--cp-grid-pad);
    padding: 0.65rem 0.7rem;
    gap: 0.4rem;
  }

  .cp-nav a {
    font-size: 0.9rem;
    padding: 0.62rem 0.7rem;
  }
}

@keyframes cp-nav-slide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
