/* Общие блоки многостраничного сайта: навигация, подвал, статьи, таблицы.
   Подключается после horoscope.css и использует его токены. */

/* ------------------------------------------------------------- верхняя панель */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(180deg, rgba(5, 6, 13, .92), rgba(5, 6, 13, .72) 70%, rgba(5, 6, 13, 0));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 max(18px, env(safe-area-inset-left)) 0 max(18px, env(safe-area-inset-right));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--gold);
  text-decoration: none;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 21px;
  letter-spacing: .02em;
  white-space: nowrap;
}

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 13px;
  color: var(--gold);
  background: rgba(240, 215, 154, .06);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  display: block;
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  line-height: 1;
  transition: color .15s ease, background .15s ease;
}

.nav a:hover,
.nav a:focus-visible { color: var(--text); background: rgba(240, 215, 154, .07); }

.nav a[aria-current="page"] { color: var(--gold); background: rgba(240, 215, 154, .09); }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(19, 20, 36, .6);
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 780px) {
  .nav-toggle { display: inline-flex; }

  .nav {
    position: absolute;
    top: 62px;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px max(18px, env(safe-area-inset-right)) 14px max(18px, env(safe-area-inset-left));
    background: rgba(6, 7, 16, .97);
    border-bottom: 1px solid var(--line);
    display: none;
  }

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

  .nav a { padding: 12px 10px; font-size: 15px; }
}

/* ------------------------------------------------------------- страница */

.page {
  position: relative;
  z-index: 1;
  padding: clamp(34px, 6vh, 64px) 0 72px;
}

.page__head { max-width: 760px; margin-bottom: 34px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold-2);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.page__title {
  margin: 0 0 12px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.1;
  color: var(--text);
}

.page__lead {
  margin: 0;
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 17px);
  line-height: 1.65;
}

/* ------------------------------------------------------------- статьи */

.prose { max-width: 780px; color: var(--text); }

.prose h2 {
  margin: 40px 0 14px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(22px, 3vw, 28px);
}

.prose h3 { margin: 26px 0 10px; font-size: 17px; font-weight: 600; }

.prose p, .prose li { color: #cfcbdf; font-size: 16px; line-height: 1.75; }

.prose p { margin: 0 0 14px; }

.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; }

.prose li { margin-bottom: 7px; }

.prose a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(240, 215, 154, .35); }

.prose a:hover { border-bottom-color: var(--gold); }

.prose blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border-left: 2px solid var(--gold-2);
  background: rgba(240, 215, 154, .05);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
}

.prose code {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .06);
  font-size: .92em;
}

/* ------------------------------------------------------------- карточки */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.card {
  padding: 20px 20px 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
}

.card h3 { margin: 0 0 8px; font-family: "Cormorant Garamond", Georgia, serif; font-size: 21px; font-weight: 600; color: var(--gold); }

.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.card__meta { margin-top: 12px; font-size: 12px; color: var(--gold-2); letter-spacing: .04em; }

/* ------------------------------------------------------------- таблица */

.table-wrap {
  overflow-x: auto;
  margin-top: 24px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(12, 13, 26, .55);
  -webkit-overflow-scrolling: touch;
}

table.matrix { border-collapse: collapse; width: 100%; min-width: 660px; }

table.matrix th, table.matrix td {
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  border-bottom: 1px solid rgba(240, 215, 154, .07);
}

table.matrix thead th { color: var(--gold-2); font-weight: 500; letter-spacing: .02em; position: sticky; top: 0; background: rgba(9, 10, 20, .95); }

table.matrix tbody th { text-align: left; color: var(--text); font-weight: 500; white-space: nowrap; }

table.matrix td { color: var(--muted); }

.cell--hi { color: #9ee6b4; }
.cell--mid { color: #f0d79a; }
.cell--lo { color: #e08e8e; }

/* ------------------------------------------------------------- кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(240, 215, 154, .07);
  color: var(--gold);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { background: rgba(240, 215, 154, .13); }

.btn--ghost { background: transparent; color: var(--muted); }

/* ------------------------------------------------------------- подвал */

.footer {
  position: relative;
  z-index: 1;
  margin-top: 40px;
  padding: 30px 0 46px;
  border-top: 1px solid var(--line-soft);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 34px;
  justify-content: space-between;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 max(18px, env(safe-area-inset-left)) 0 max(18px, env(safe-area-inset-right));
}

.footer__col { min-width: 200px; }

.footer__title { margin: 0 0 10px; color: var(--text); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }

.footer__col a, .footer__col p {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.footer__col a:hover { color: var(--gold); }

.footer__bottom {
  width: 100%;
  max-width: 1180px;
  margin: 24px auto 0;
  padding: 16px max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
  border-top: 1px solid rgba(240, 215, 154, .06);
  color: #6f6b85;
  font-size: 12px;
}

/* ------------------------------------------------------------- формы */

.select {
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(9, 10, 20, .8);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.select:focus-visible { outline: 2px solid rgba(240, 215, 154, .5); outline-offset: 1px; }

/* ------------------------------------------------------------- лунный календарь */

.moon-hint { text-align: left !important; color: #b9b4cc !important; font-size: 12.5px !important; line-height: 1.5; }

.phase--new { color: #9fb4e6 !important; }
.phase--wax { color: #cfe6a8 !important; }
.phase--full { color: #f0d79a !important; }
.phase--wan { color: #d8b6e6 !important; }

@media (max-width: 620px) {
  .moon-hint { display: none; }
}

/* ------------------------------------------------------------- карточки со ссылками */

.card a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(240, 215, 154, .3); }
.card a:hover { border-bottom-color: var(--gold); }
