/* Shared layout: header, footer, forms, containers (kuda + afisha) */

:root {
  --n5-container: min(1200px, calc(100% - 32px));
  --n5-header-bg: #14141f;
  --n5-header-border: rgba(255, 255, 255, 0.08);
  --n5-footer-bg: #14141f;
  --n5-font: "Inter", "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --n5-input-bg: #fff;
  --n5-input-border: #e2e4ea;
  --n5-input-radius: 10px;
  --n5-input-height: 42px;
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body,
.uni-body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.container.max-w-xl,
.page-container {
  width: var(--n5-container);
  max-width: 100%;
  margin-inline: auto;
  padding-inline: 16px;
}

.uni-body,
.uni-body h1,
.uni-body h2,
.uni-body h3,
.uni-body h4,
.uni-body h5,
.uni-body h6 {
  font-family: var(--n5-font) !important;
}

/* ─── Header ─────────────────────────────────────────── */
.n5-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--n5-header-bg);
  border-top: 3px solid var(--color-primary);
  border-bottom: 1px solid var(--n5-header-border);
}

.n5-header__inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.n5-header__start {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

@media (min-width: 1024px) {
  .n5-header__inner {
    min-height: 72px;
    gap: 16px;
  }

  .n5-header__start {
    flex: 0 0 auto;
  }
}

.n5-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.n5-logo img,
.n5-logo__img {
  flex-shrink: 0;
  height: auto;
  max-height: 40px;
  width: auto;
  max-width: min(170px, 42vw);
}

.n5-logo__accent {
  color: var(--color-primary);
}

.n5-nav {
  display: none;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

@media (min-width: 1024px) {
  .n5-nav {
    display: flex;
  }
}

.n5-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.n5-nav a:hover,
.n5-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.n5-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  position: relative;
  z-index: 210;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .n5-header__actions {
    margin-left: 0;
  }
}

.n5-header__burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  color: #fff;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.n5-header__burger--icon {
  flex-direction: row;
  gap: 0;
}

.n5-header__burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

@media (min-width: 1024px) {
  .n5-header__burger,
  .n5-header__burger--icon {
    display: none;
  }
}

.n5-mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0 16px;
  border-top: 1px solid var(--n5-header-border);
}

.n5-mobile-nav.open {
  display: flex;
}

@media (min-width: 1024px) {
  .n5-mobile-nav {
    display: none !important;
  }
}

.n5-mobile-nav a,
.n5-mobile-nav button.n5-mobile-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  touch-action: manipulation;
}

.n5-mobile-nav a.is-active,
.n5-mobile-nav button.n5-mobile-link.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.n5-mobile-nav__search {
  padding: 0 14px 8px;
}

.n5-mobile-nav__sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.n5-mobile-nav__label {
  padding: 10px 14px 4px;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.n5-mobile-nav a:hover,
.n5-mobile-nav button.n5-mobile-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.n5-mobile-nav__muted {
  color: rgba(255, 255, 255, 0.72) !important;
}

.n5-btn-header {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .n5-btn-header {
    display: inline-flex;
  }
}

.n5-btn-header--primary {
  background: var(--color-primary);
  color: #fff;
  border: none;
}

.n5-btn-header--primary:hover {
  filter: brightness(1.08);
  color: #fff;
}

.n5-city-select-wrap {
  display: none;
}

@media (min-width: 768px) {
  .n5-city-select-wrap {
    display: block;
  }
}

/* ─── Footer ─────────────────────────────────────────── */
.n5-footer {
  background: var(--n5-footer-bg);
  color: #fff;
  margin-top: 3rem;
  border-top: 1px solid var(--n5-header-border);
}

.n5-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: 40px 0 28px;
}

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

@media (min-width: 992px) {
  .n5-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.n5-footer__brand {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0 0 12px;
}

.n5-footer__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.62);
}

.n5-footer__title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.n5-footer__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.n5-footer__links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.n5-footer__links a:hover {
  color: #fff;
}

.n5-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 0 24px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}

.n5-footer__bottom a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
}

.n5-footer__bottom a:hover {
  color: #fff;
}

/* ─── Form controls ──────────────────────────────────── */
.n5-select,
.n5-input {
  display: block;
  width: 100%;
  min-height: var(--n5-input-height);
  padding: 0 14px;
  font-family: var(--n5-font);
  font-size: 14px;
  font-weight: 500;
  color: #1a1a2e;
  background-color: var(--n5-input-bg);
  border: 1px solid var(--n5-input-border);
  border-radius: var(--n5-input-radius);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

.n5-select {
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.n5-select:focus,
.n5-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.n5-select--dark {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
}

.n5-select--dark option {
  color: #1a1a2e;
  background: #fff;
}

.n5-select--sm {
  min-height: 36px;
  font-size: 13px;
  padding-inline: 12px;
  padding-right: 32px;
  min-width: 130px;
}

.n5-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.02em;
}

/* Override broken News5 responsive utilities in our components */
.hero-search .form-select,
.hero-search .form-control {
  min-height: var(--n5-input-height);
  border-radius: var(--n5-input-radius);
  border-color: var(--n5-input-border);
  font-family: var(--n5-font);
}

.hero-search .form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.n5-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Mobile layout fixes */
@media (max-width: 767px) {
  .n5-header__inner {
    gap: 10px;
  }

  .n5-logo,
  .n5-logo__img {
    max-width: min(170px, calc(100vw - 130px));
  }

  .n5-btn-header {
    display: none !important;
  }

  .n5-city-panel {
    max-height: min(70vh, 360px);
    overflow-y: auto;
  }

  .breadcrumb-wrap {
    flex-wrap: wrap;
    gap: 4px;
    font-size: 13px;
  }

  .page-header {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

/* Sticky «Список / Карта» на категориях */
.kuda-sticky-view-toggle {
  position: sticky;
  top: 72px;
  z-index: 20;
  display: inline-flex;
  gap: 4px;
  background: #f0f0f5;
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.kuda-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: #888;
  text-decoration: none;
  transition: all 0.15s;
}

.kuda-view-btn.is-active {
  background: #fff;
  color: #7c3aed;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Telegram / Push подписки */
.kuda-subscribe-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  font-size: 14px;
  border-bottom: 1px solid #ebebef;
}

.kuda-subscribe-bar--tg {
  background: #eef6ff;
}

.kuda-subscribe-bar--push {
  background: #fffbeb;
}

/* Соцсети — контакты, футер */
.n5-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.n5-social-links__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.12s, color 0.15s;
}

.n5-social-links__item svg {
  display: block;
  flex-shrink: 0;
}

.n5-social-links__item:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  transform: translateY(-1px);
}

.container .n5-social-links__item,
.n5-social-links--inline .n5-social-links__item {
  background: #f3f4f8;
  border-color: #e5e7ef;
  color: #1a1a2e;
}

.container .n5-social-links__item:hover,
.n5-social-links--inline .n5-social-links__item:hover {
  background: #eceef5;
  border-color: #7c3aed;
  color: #7c3aed;
}

.n5-footer__social {
  margin-top: 4px;
}

/* Кнопка «Поделиться / копировать» */
.kuda-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid #ddd;
  background: #fff;
  color: #555;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.kuda-share-btn:hover {
  border-color: #7c3aed;
  color: #7c3aed;
}

.kuda-share-btn.is-copied {
  border-color: #16a34a;
  color: #16a34a;
  background: #f0fdf4;
}

.kuda-share-btn svg {
  display: block;
  flex-shrink: 0;
}
