/* masua.org hub styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }  /* clip, не hidden — не ломает sticky-шапку */
body {
  background: var(--warm-cream);
  color: var(--text-primary);
  font-family: var(--font-he);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body[dir="ltr"] { font-family: var(--font-en); }
body[lang="ru"] { font-family: var(--font-ru); }

a { color: var(--warm-terra); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* ===== Header ===== */
.site-header {
  background: var(--white);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  flex-wrap: wrap;
}
.logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}
.logo span { color: var(--warm-terra); }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.main-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}
.main-nav a:hover, .main-nav a.active {
  background: var(--soft-peach);
  color: var(--text-primary);
  text-decoration: none;
}
.main-nav a.ext::after { content: ' ↗'; font-size: 0.8em; opacity: 0.6; }

.header-side { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: flex; gap: 2px; }
.lang-switch a {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-light);
}
.lang-switch a.active { background: var(--soft-peach); color: var(--warm-terra); }
.user-chip {
  background: var(--trust-green-light);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}
.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--gentle-coral), var(--warm-terra));
  color: var(--white);
  border: none;
  cursor: pointer;
  padding: 10px 22px;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
}
.btn:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); text-decoration: none; color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-ghost { background: var(--white); color: var(--warm-terra); border: 1.5px solid var(--gentle-coral); }

/* ===== Hero ===== */
.hero { padding: 48px 0 28px; }
.hero h1 { font-size: 2.2rem; font-weight: 800; }
.hero h1 span { color: var(--warm-terra); }
.hero p { color: var(--text-secondary); font-size: 1.1rem; max-width: 640px; margin-top: 8px; }

/* ===== Cards / grid ===== */
.grid { display: grid; gap: 18px; }
.grid-widgets { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 20px 0; }
.grid-family { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px;
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-card); }
.card h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card .big { font-size: 1.7rem; font-weight: 800; }
.card .sub { color: var(--text-secondary); font-size: 0.9rem; }
.kv { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.95rem; }
.kv b { font-weight: 700; }

/* Погода: текущая + прогноз на 5 дней (компактно) */
.now-row { display: flex; align-items: baseline; gap: 10px; }
.forecast-row { display: flex; gap: 4px; margin-top: 10px; }
.forecast-day {
  flex: 1;
  text-align: center;
  background: var(--warm-cream);
  border-radius: var(--radius-sm);
  padding: 5px 2px 6px;
}
.fd-name { font-size: 0.68rem; font-weight: 700; color: var(--text-secondary); }
.fd-icon { font-size: 0.95rem; line-height: 1.4; }
.fd-temp { font-size: 0.74rem; display: flex; justify-content: center; gap: 4px; white-space: nowrap; }
.fd-temp b { font-weight: 800; }
.fd-temp span { color: var(--text-light); }

section { margin: 34px 0; }
section > h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 14px; }
section > h2 a.more { font-size: 0.85rem; font-weight: 600; margin-inline-start: 12px; }

/* ===== Alerts ===== */
.alert-item {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 10px;
  background: var(--alert-info);
  font-size: 0.95rem;
}
.alert-item.warning { background: var(--alert-warning); }
.alert-item.critical { background: var(--alert-critical); }
.alert-item .meta { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }
.all-clear {
  background: var(--trust-green-light);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.95rem;
}

/* ===== Board ===== */
.board-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.chip {
  padding: 6px 14px;
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--transition);
}
.chip:hover { color: var(--text-primary); text-decoration: none; }
.chip.active { border-color: var(--warm-terra); color: var(--warm-terra); background: var(--soft-peach); }

.post-card { margin-bottom: 14px; }
.post-card .post-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.post-card h4 { font-size: 1.05rem; font-weight: 700; flex: 1; }
.post-card .cat-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-lg);
  background: var(--soft-peach);
  color: var(--warm-terra);
  white-space: nowrap;
}
.post-card .cat-badge.care { background: var(--trust-green-light); color: var(--trust-green); }
.post-card p { color: var(--text-secondary); font-size: 0.95rem; margin: 8px 0; white-space: pre-line; }

/* Раскрывающийся текст карточек */
.post-body.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-body.open { -webkit-line-clamp: unset; display: block; overflow: visible; }
.post-body { overflow-wrap: anywhere; word-break: break-word; }
.more-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  margin: 0 0 6px;
  color: var(--warm-terra);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
}
.more-btn:hover { text-decoration: underline; }
.post-card .meta { font-size: 0.8rem; color: var(--text-light); display: flex; gap: 14px; flex-wrap: wrap; }
.care-hint {
  background: var(--trust-green-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 0.95rem;
}

/* ===== Forms ===== */
.form-card { max-width: 560px; }
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 5px; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--soft-peach);
  border-radius: var(--radius-sm);
  background: var(--warm-cream);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none;
  border-color: var(--warm-terra);
  background: var(--white);
}
.form-msg { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 12px; display: none; }
.form-msg.ok { background: var(--trust-green-light); display: block; }
.form-msg.err { background: var(--alert-critical); display: block; }

/* Дайджест-форма */
.digest-form { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.digest-form input[type="email"] {
  flex: 1;
  min-width: 220px;
  padding: 11px 14px;
  border: 1.5px solid var(--soft-peach);
  border-radius: var(--radius-sm);
  background: var(--warm-cream);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}
.digest-form input[type="email"]:focus { outline: none; border-color: var(--warm-terra); background: var(--white); }
.digest-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ===== Footer ===== */
.site-footer {
  margin-top: auto;
  background: var(--white);
  box-shadow: 0 -2px 20px rgba(92, 61, 46, 0.06);
  padding: 22px 0;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text-light);
  font-size: 0.85rem;
}
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--text-secondary); }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
  .hero { padding: 28px 0 16px; }
  .main-nav { order: 3; flex-basis: 100%; padding-bottom: 8px; }
  .main-nav a { padding: 6px 10px; font-size: 0.88rem; }
}
