/* ==========================================================================
   LUDWIGSLUST STADTPORTAL — UNIFIED SHELL CSS v2.0
   Global design tokens & AppShell layer that sits on TOP of all page-level CSS.
   Strict Civic Theme: NO pure white (#fff), unified chips, unified cards without water.
   ========================================================================== */

/* ── DESIGN TOKENS (canonical single source of truth) ── */
:root {
  /* Colors */
  --shell-bg:            #f2eae0;
  --shell-surface:       #faf5ed;
  --shell-surface-hover: #f5ebe0;
  --shell-border:        #ded3c4;
  --shell-border-light:  #ece3d6;
  --shell-green:         #1e4d38;
  --shell-green-hover:   #153828;
  --shell-green-soft:    #ebf3ee;
  --shell-badge-bg:      #eee5d7;
  --shell-badge-text:    #523a28;
  --shell-text:          #2b221b;
  --shell-muted:         #6e6054;
  --shell-sub:           #786b5e;

  /* Layout */
  --shell-max-width:     1180px;
  --shell-pad-h:         20px;
  --shell-radius:        16px;
  --shell-radius-sm:     10px;
  --shell-shadow:        0 4px 18px -2px rgba(43,34,27,0.06);
  --shell-shadow-hover:  0 8px 24px -4px rgba(30,77,56,0.14);

  /* Typography */
  --shell-font:          system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── BODY OVERRIDES: force correct font & bg on all pages ── */
body {
  font-family: var(--shell-font) !important;
  background-color: var(--shell-bg) !important;
  color: var(--shell-text) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── UNIFIED CONTAINER ── */
.shell-container,
.wrap,
.content-wrap {
  max-width: var(--shell-max-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.hero-row,
.stage,
.hero-inner,
.rail-title,
.sport-hero-inner,
.hub-header {
  max-width: var(--shell-max-width) !important;
}

/* ── FONT OVERRIDES: eliminate all non-system fonts ── */
body, h1, h2, h3, h4, h5, h6,
p, span, a, button, input, select, textarea, label,
.sport-title, .sport-lead, .sport-eyebrow,
.metric-label, .metric-value,
.content-wrap *, .sport-hero-inner *,
.chip, .btn, .hub-chip, .cat-pill,
.hub-card *, .card-title, .card-body, .form-card * {
  font-family: var(--shell-font) !important;
}

/* ── UNIFIED FILTER CHIPS SYSTEM (Horizontal Scroll on Mobile, Flex-Wrap on Desktop) ── */
.hub-chips,
#categoryPills,
.chips-scroll-bar {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 auto 16px !important;
  padding: 4px 20px 8px !important;
  width: 100% !important;
  max-width: var(--shell-max-width) !important;
  box-sizing: border-box !important;
}

@media (max-width: 768px) {
  .hub-chips,
  #categoryPills,
  .chips-scroll-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 4px 16px 8px !important;
  }
  .hub-chips::-webkit-scrollbar,
  #categoryPills::-webkit-scrollbar,
  .chips-scroll-bar::-webkit-scrollbar {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hub-chips,
  #categoryPills,
  .chips-scroll-bar {
    flex-wrap: wrap !important;
  }
}

.hub-chip,
.cat-pill {
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  height: 38px !important;
  padding: 0 14px !important;
  border-radius: 9999px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: var(--shell-surface) !important;
  border: 1px solid var(--shell-border) !important;
  color: var(--shell-muted) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 4px rgba(43,34,27,0.03) !important;
  text-decoration: none !important;
}

.hub-chip:hover,
.cat-pill:hover {
  border-color: var(--shell-green) !important;
  color: var(--shell-green) !important;
  background: var(--shell-surface-hover) !important;
}

.hub-chip em,
.hub-chip span.count,
.cat-pill span {
  background: var(--shell-badge-bg) !important;
  color: var(--shell-green) !important;
  padding: 1px 7px !important;
  border-radius: 9999px !important;
  font-style: normal !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

.hub-chip.is-active,
.cat-pill.active {
  background: var(--shell-green) !important;
  color: var(--shell-surface) !important;
  border-color: var(--shell-green) !important;
}

.hub-chip.is-active em,
.hub-chip.is-active span.count,
.cat-pill.active span {
  background: rgba(250, 245, 237, 0.25) !important;
  color: var(--shell-surface) !important;
}

/* ── UNIFIED CARDS WITHOUT "WATER" ── */
.hub-card,
.card,
.form-card,
.hub-school-card {
  background: var(--shell-surface) !important;
  border: 1px solid var(--shell-border) !important;
  border-radius: 16px !important;
  padding: 16px 18px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-shadow: var(--shell-shadow) !important;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
  position: relative !important;
  min-height: auto !important;
  box-sizing: border-box !important;
}

.hub-card:hover,
.card:hover,
.form-card:hover,
.hub-school-card:hover {
  border-color: var(--shell-green) !important;
  box-shadow: var(--shell-shadow-hover) !important;
  transform: translateY(-2px) !important;
}

/* Верхняя строка карточки: категория слева + статус справа (гармония) */
.card-top-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin-bottom: 6px !important;
  width: 100% !important;
}

.hub-school-type,
.card-category-label {
  font-size: 11px !important;
  font-weight: 800 !important;
  color: var(--shell-green) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  line-height: 1.3 !important;
}

.hub-badge-live,
.card-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  background: var(--shell-green-soft) !important;
  color: var(--shell-green) !important;
  border: 1px solid #c5dccf !important;
  padding: 2px 8px !important;
  border-radius: 9999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.hub-badge-live .live-dot,
.card-status-badge .status-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: var(--shell-green) !important;
  display: inline-block !important;
}

/* Заголовки карточек без гигантских отступов */
.hub-card h2,
.hub-card h3,
.card h2,
.card h3,
.form-card h3,
.hub-card-title,
.hub-school-name {
  margin: 2px 0 8px 0 !important;
  padding: 0 !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  color: var(--shell-text) !important;
  line-height: 1.25 !important;
  letter-spacing: -0.015em !important;
}

/* Инфо-строки в карточках */
.hub-info-list,
.hub-school-meta {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  margin-bottom: 12px !important;
  flex: 1 1 auto !important;
}

.hub-info-row,
.meta-row {
  display: flex !important;
  align-items: flex-start !important;
  gap: 8px !important;
  font-size: 13px !important;
  color: var(--shell-text) !important;
  line-height: 1.4 !important;
}

.hub-info-row .hub-icon,
.hub-info-row svg,
.meta-row svg {
  width: 15px !important;
  height: 15px !important;
  stroke: var(--shell-green) !important;
  stroke-width: 2 !important;
  fill: none !important;
  flex-shrink: 0 !important;
  margin-top: 2px !important;
}

.hub-info-row a,
.meta-row a {
  color: var(--shell-green) !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

/* Действия внизу карточки */
.hub-actions,
.card-actions {
  display: flex !important;
  gap: 8px !important;
  margin-top: auto !important;
  padding-top: 10px !important;
  border-top: 1px solid var(--shell-border-light) !important;
  width: 100% !important;
}

.hub-btn,
.btn-school-primary,
.btn-school-secondary {
  border-radius: 12px !important;
  height: 38px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  padding: 0 14px !important;
  transition: all 0.15s ease !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
}

.hub-btn-primary,
.btn-school-primary {
  background: var(--shell-green) !important;
  color: var(--shell-surface) !important;
  border: none !important;
  flex: 1 1 auto !important;
}

.hub-btn-primary:hover,
.btn-school-primary:hover {
  background: var(--shell-green-hover) !important;
}

.hub-btn-secondary,
.btn-school-secondary {
  background: var(--shell-badge-bg) !important;
  color: var(--shell-text) !important;
  border: 1px solid var(--shell-border) !important;
  flex: 1 1 auto !important;
}

.hub-btn-secondary:hover,
.btn-school-secondary:hover {
  background: #e4d7c5 !important;
  border-color: var(--shell-green) !important;
  color: var(--shell-green) !important;
}

/* ── STRICT WHITE ELIMINATION ── */
[style*="background:#fff"],
[style*="background: #fff"],
[style*="background-color:#fff"],
[style*="background-color: #fff"],
[style*="background: white"],
[style*="background:white"] {
  background: var(--shell-surface) !important;
}

/* ── RESPONSIVE PADDING ── */
@media (max-width: 768px) {
  :root {
    --shell-pad-h: 16px;
  }
  .shell-container,
  .wrap,
  .content-wrap {
    padding-left: var(--shell-pad-h) !important;
    padding-right: var(--shell-pad-h) !important;
  }
}
