/*
 * Лунный календарь — стили. Все правила ограничены контейнером .lunar-app,
 * чтобы не конфликтовать со стилями шаблона Joomla и других сервисов.
 */

.lunar-app {
  --lc-bg: #0a090d;
  --lc-gold: #c9a961;
  --lc-gold-hi: #e6cf94;
  --lc-gold-lo: #8e7136;
  --lc-line: rgba(201, 169, 97, .28);
  --lc-line-soft: rgba(201, 169, 97, .14);
  --lc-text: #ece6d9;
  --lc-text-2: #cfc8d8;
  --lc-muted: #a39cae;
  --lc-focus: #f0d999;
  --lc-serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --lc-sans: 'Manrope', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --lc-ease: cubic-bezier(.22, .7, .2, 1);

  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--lc-text);
  font-family: var(--lc-sans);
  font-size: 16px;
  line-height: 1.65;
  background:
    radial-gradient(800px 480px at 50% -4%, rgba(230, 207, 148, .13), transparent 60%),
    radial-gradient(1200px 700px at 50% 0%, rgba(84, 56, 120, .30), transparent 65%),
    radial-gradient(900px 700px at 0% 70%, rgba(40, 28, 70, .32), transparent 60%),
    linear-gradient(180deg, var(--lc-bg) 0%, #100c18 45%, var(--lc-bg) 100%);
  padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 40px) clamp(40px, 6vw, 80px);
  -webkit-font-smoothing: antialiased;
}
.lunar-app *, .lunar-app *::before, .lunar-app *::after { box-sizing: border-box; }
.lunar-app [hidden] { display: none !important; }
.lunar-app img { max-width: 100%; display: block; }
.lunar-app button { font: inherit; color: inherit; }
.lunar-app :focus-visible { outline: 2px solid var(--lc-focus); outline-offset: 3px; }
:where(.lunar-app) p { margin: 0 0 12px; }
.lunar-page { margin: 0; background: #0a090d; }

/* Фон: звёзды и орнамент */
.lc-sky {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 14% 20%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 10%, #fff6 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 38% 46%, #e6cf9480 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 52%, #fff5 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 24% 76%, #e6cf9466 50%, transparent 51%),
    radial-gradient(1px 1px at 60% 86%, #fff5 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 6% 94%, #fff4 50%, transparent 51%);
  background-size: 380px 380px;
}
.lc-orn {
  position: absolute; z-index: -1; pointer-events: none; opacity: .08;
  width: min(560px, 80vw); aspect-ratio: 1;
  background: url("../images/ornament.svg") center / contain no-repeat;
}
.lc-orn--tr { top: -150px; right: -170px; }
.lc-orn--bl { bottom: -170px; left: -190px; width: min(500px, 75vw); }

/* ---------- Типографика ---------- */
.lc-hero { text-align: center; max-width: 800px; margin: 0 auto clamp(26px, 5vw, 44px); }
.lc-hero__emblem { width: 240px; height: 120px; max-width: 80%; margin: 0 auto 10px; filter: drop-shadow(0 0 14px rgba(230, 200, 130, .35)); }
@media (max-width: 760px) { .lc-hero__emblem { width: 200px; height: 100px; } }
.lc-hero__date {
  display: inline-block; margin: 0 0 10px !important; padding: 4px 16px; border-radius: 999px;
  border: 1px solid var(--lc-line); color: var(--lc-gold-hi); font-size: 14px; letter-spacing: .06em;
}
.lc-hero__title {
  font-family: var(--lc-serif); font-weight: 600; letter-spacing: .02em;
  font-size: clamp(40px, 7vw, 68px); line-height: 1.05; margin: 0 0 14px;
  background: linear-gradient(180deg, #f3e3b6 0%, var(--lc-gold) 70%, #a88848 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lc-hero__lead { color: var(--lc-muted); font-size: clamp(16px, 2.2vw, 19px); margin: 0 auto !important; max-width: 620px; text-wrap: balance; }

.lc-h2 { font-family: var(--lc-serif); font-weight: 600; color: var(--lc-gold-hi); font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; margin: 0 0 16px; }
.lc-h3 { font-family: var(--lc-serif); font-weight: 600; color: var(--lc-gold-hi); font-size: clamp(21px, 2.6vw, 25px); line-height: 1.2; margin: 0 0 8px; }
.lc-muted { color: var(--lc-muted); font-size: 14.5px; }
.lc-hint { text-align: center; color: var(--lc-muted); font-size: 13.5px; margin: 18px 0 0 !important; }

/* ---------- Панели ---------- */
.lc-panel {
  position: relative; max-width: 1040px; margin: 0 auto clamp(24px, 4vw, 40px);
  padding: clamp(22px, 4vw, 44px);
  background: linear-gradient(180deg, rgba(30, 28, 34, .78), rgba(18, 16, 22, .82));
  border: 1px solid rgba(201, 169, 97, .2); border-radius: 22px;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .03);
}
.lc-panel::before { content: ''; position: absolute; inset: 7px; border: 1px solid var(--lc-line-soft); border-radius: 16px; pointer-events: none; }
.lc-panel > * { position: relative; }

/* ---------- Кнопки ---------- */
.lc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 22px; border-radius: 999px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--lc-line); background: rgba(10, 9, 14, .5); color: var(--lc-text) !important;
  font-weight: 600; font-size: 15px; letter-spacing: .02em; line-height: 1.2;
  transition: border-color .2s, background .2s, box-shadow .25s, transform .2s var(--lc-ease);
}
.lc-btn:hover { border-color: var(--lc-gold); background: rgba(201, 169, 97, .08); }
.lc-btn:active { transform: translateY(1px); }
.lc-btn--primary {
  color: #1a1408 !important; border-color: transparent;
  background: linear-gradient(180deg, #ecd79f 0%, #c9a961 55%, #a98a48 100%);
  box-shadow: 0 10px 30px -12px rgba(201, 169, 97, .6), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.lc-btn--primary:hover { background: linear-gradient(180deg, #f3e2b2 0%, #d4b56d 55%, #b39350 100%); }
.lc-btn--ghost { border-color: transparent; background: transparent; color: var(--lc-muted) !important; font-weight: 500; }
.lc-btn--ghost:hover { color: var(--lc-text) !important; background: transparent; border-color: var(--lc-line-soft); }
.lunar-app .lc-btn:focus-visible { outline-offset: 4px; }


.lc-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 14px 0 0; }
.lc-share { max-width: 620px; margin: 14px auto 0; }
.lc-share__label { color: var(--lc-muted); font-size: 13.5px; }
.lc-share__row { display: flex; gap: 8px; margin-top: 6px; }
.lc-input {
  flex: 1; min-width: 0; min-height: 46px; padding: 10px 16px; border-radius: 10px; font: inherit; font-size: 14.5px;
  border: 1px solid var(--lc-line-soft); background: rgba(8, 7, 12, .65); color: var(--lc-text);
}
.lc-input:focus { outline: none; border-color: var(--lc-gold); box-shadow: 0 0 0 3px rgba(201, 169, 97, .2); }

.lc-consult {
  text-align: center; margin: 34px auto 0; max-width: 760px; padding: clamp(24px, 4vw, 40px);
  border-radius: 18px; border: 1px solid var(--lc-line); position: relative; overflow: hidden;
  background: radial-gradient(600px 220px at 50% 0, rgba(201, 169, 97, .12), transparent 70%), rgba(10, 9, 14, .5);
}
.lc-consult__ornament { color: var(--lc-gold); font-size: 20px; }
.lc-consult .lc-h3 { margin-top: 6px; font-size: clamp(24px, 3.2vw, 30px); }
.lc-consult p { color: var(--lc-muted); max-width: 560px; margin: 0 auto 22px; }

/* ---------- Информация ---------- */
.lc-info__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); margin-bottom: 14px; }
.lc-info p { color: var(--lc-text-2); }
.lc-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.lc-steps li { counter-increment: s; position: relative; padding: 0 0 14px 44px; color: var(--lc-text-2); }
.lc-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--lc-line); border-radius: 50%; font-family: var(--lc-serif); color: var(--lc-gold); font-size: 17px; }
.lc-steps b { color: var(--lc-text); }

.lc-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1100; padding: 12px 20px; border-radius: 999px; background: #1d1729; border: 1px solid var(--lc-gold); color: var(--lc-gold-hi); font-size: 14.5px; box-shadow: 0 20px 50px -20px #000; }

/* ---------- Рисунок Луны ---------- */
.lc-moon__dark { fill: #17131f; }
.lc-moon__ashen { opacity: .1; }
.lc-moon__rim { fill: none; stroke: rgba(201, 169, 97, .35); stroke-width: 1; }

/* ---------- 1. Луна на выбранный день ---------- */
.lc-today__grid { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); align-items: center; }
.lc-today__moon { position: relative; }
.lc-today__moon::after { content: ''; position: absolute; inset: -22%; z-index: -1; background: radial-gradient(closest-side, rgba(230, 207, 148, .2), transparent); }
.lc-moon { display: block; width: 100%; height: auto; filter: drop-shadow(0 0 30px rgba(230, 207, 148, .18)); }
.lc-label { margin: 0 0 4px !important; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--lc-gold); }
.lc-today__phase { font-family: var(--lc-serif); font-size: clamp(36px, 5.4vw, 54px); font-weight: 600; color: var(--lc-gold-hi); margin: 0 0 2px; line-height: 1.05; outline: none; }
.lc-today__trend { color: var(--lc-muted); }
.lc-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.lc-fact { padding: 12px 16px; border-radius: 12px; border: 1px solid var(--lc-line-soft); background: rgba(10, 9, 14, .45); }
.lc-fact dt { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--lc-muted); }
.lc-fact dd { margin: 2px 0 0; font-family: var(--lc-serif); font-size: 22px; font-weight: 600; color: var(--lc-text); line-height: 1.2; }
.lc-fact dd.lc-fact__note { margin-top: 4px; font-family: var(--lc-sans); font-size: 13px; font-weight: 400; color: var(--lc-muted); line-height: 1.35; }
.lc-city { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; font-size: 14px; color: var(--lc-muted); }
.lc-city__select {
  min-height: 40px; padding: 6px 34px 6px 14px; border-radius: 999px; font: inherit; font-size: 14.5px; cursor: pointer;
  border: 1px solid var(--lc-line); color: var(--lc-text); appearance: none; -webkit-appearance: none;
  background: rgba(10, 9, 14, .6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23c9a961' stroke-width='1.6'/%3E%3C/svg%3E") right 14px center no-repeat;
}
.lc-city__select:hover { border-color: var(--lc-gold); }
.lc-city__select option { background: #17131f; color: var(--lc-text); }

.lc-upcoming__title { margin-top: 30px; text-align: center; }
.lc-upcoming { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.lc-upcoming__item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 10px; border-radius: 14px; border: 1px solid var(--lc-line-soft); background: rgba(10, 9, 14, .45); }
.lc-upcoming__moon { width: 44px; height: 44px; margin-bottom: 4px; }
.lc-upcoming__name { font-family: var(--lc-serif); font-size: 19px; font-weight: 600; color: var(--lc-gold-hi); line-height: 1.2; }
.lc-upcoming__date { font-size: 14px; color: var(--lc-text); }
.lc-upcoming__sign { font-size: 12.5px; color: var(--lc-muted); }

/* ---------- 2. Рекомендации ---------- */
.lc-reco > .lc-h2 { text-align: center; }
.lc-reco__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lc-card { padding: 20px; border-radius: 16px; border: 1px solid var(--lc-line-soft); background: rgba(10, 9, 14, .5); }
.lc-card__kicker { margin: 0 0 4px !important; font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--lc-gold); }
.lc-card__title { font-family: var(--lc-serif); font-size: clamp(24px, 2.8vw, 28px); font-weight: 600; color: var(--lc-gold-hi); margin: 0 0 8px; line-height: 1.15; }
.lc-card p { color: var(--lc-text-2); font-size: 15px; }
.lc-card__good { margin: 0 !important; }
.lc-card__good b { color: var(--lc-gold-hi); font-weight: 600; }
.lc-card__lists { display: grid; gap: 10px; }
.lc-card__lists h4 { margin: 0 0 4px; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--lc-gold-hi); }
.lc-card__lists ul { margin: 0; padding: 0 0 0 18px; color: var(--lc-text-2); font-size: 14.5px; }
.lc-card__lists li::marker { color: var(--lc-gold); }
.lc-disclaimer { font-size: 13px; color: var(--lc-muted); margin: 20px auto 0 !important; max-width: 760px; text-align: center; }

/* ---------- 3. Календарь ---------- */
.lc-calendar__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.lc-calendar__month { margin: 0; text-align: center; flex: 1; }
.lc-nav { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--lc-line); background: rgba(10, 9, 14, .5); color: var(--lc-gold-hi); font-size: 26px; line-height: 1; cursor: pointer; transition: border-color .2s, background .2s; }
.lc-nav:hover { border-color: var(--lc-gold); background: rgba(201, 169, 97, .08); }
.lc-weekdays, .lc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.lc-weekdays span { text-align: center; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--lc-muted); padding: 4px 0; }
.lc-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px 10px; border-radius: 12px; border: 1px solid var(--lc-line-soft); background: rgba(10, 9, 14, .45);
  cursor: pointer; transition: border-color .2s, background .2s;
}
.lc-cell--empty { border: 0; background: none; cursor: default; }
.lc-cell:not(.lc-cell--empty):hover { border-color: var(--lc-line); background: rgba(201, 169, 97, .06); }
.lc-cell.is-today { border-color: var(--lc-gold); }
.lc-cell.is-selected { background: rgba(201, 169, 97, .14); border-color: var(--lc-gold); box-shadow: 0 0 0 1px var(--lc-gold) inset; }
.lc-cell__num { align-self: flex-start; padding-left: 4px; font-size: 14px; font-weight: 600; color: var(--lc-text); line-height: 1; }
.lc-cell__moon { width: clamp(22px, 4vw, 38px); height: clamp(22px, 4vw, 38px); }
.lc-cell__ld { font-size: 11.5px; color: var(--lc-muted); line-height: 1; }
.lc-cell .lc-ev { position: absolute; top: 7px; right: 7px; }
.lc-ev { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--lc-gold); vertical-align: middle; }
.lc-ev--new { background: #17131f; }
.lc-ev--full { background: var(--lc-gold-hi); border-color: var(--lc-gold-hi); }
.lc-ev--first-quarter { background: linear-gradient(90deg, transparent 50%, var(--lc-gold-hi) 50%); }
.lc-ev--last-quarter { background: linear-gradient(90deg, var(--lc-gold-hi) 50%, transparent 50%); }
.lc-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin: 16px 0 0 !important; font-size: 13px; color: var(--lc-muted); }
.lc-legend span { display: inline-flex; align-items: center; gap: 7px; }


/* ---------- Адаптив ---------- */
@media (max-width: 860px) {
  .lc-reco__grid { grid-template-columns: 1fr; }
  .lc-upcoming { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .lc-hero__emblem { width: 200px; height: 100px; }
  .lc-today__grid { grid-template-columns: 1fr; }
  .lc-today__moon { width: min(220px, 64%); margin: 0 auto; }
  .lc-today__info { text-align: center; }
  .lc-facts { text-align: left; }
  .lc-city { justify-content: center; }
  .lc-info__grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .lc-grid, .lc-weekdays { gap: 3px; }
  .lc-cell { padding: 6px 2px 7px; border-radius: 8px; }
  .lc-cell__num { font-size: 12px; padding-left: 2px; }
  .lc-cell .lc-ev { top: 4px; right: 4px; width: 7px; height: 7px; border-width: 1px; }
  .lc-fact dd { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .lunar-app *, .lunar-app *::before, .lunar-app *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.lunar-app .lc-today__phase:focus, .lunar-app .lc-today__phase:focus-visible { outline: none; }
