/* ============================================================
   calendar.css — /kalendar-razvitiya-rebyonka «Календарь развития»
   (Stage 5, Task 4, макет 5a: строки 170–266 «Главная - варианты.dc.html»).

   Токены/карточки — design-system.css (.card/.chip/.btn/.pill-input).
   «Читать в N месяцев» переиспользует .journal-card (articles/_article_card.php,
   journal.css) — здесь только компактный построчный вариант (как мобильный
   .journal-card в journal.css), а не полноразмерная плитка с фото сверху:
   макет 5a рисует эти карточки статей узкой колонкой с превью 76×56 слева.
   ============================================================ */

.cal-page { padding-top: 20px; padding-bottom: 48px; }

.cal-head { margin-bottom: 20px; }
.cal-head__title { font-size: 28px; font-weight: 900; }
.cal-head__text { font-size: 14px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; max-width: 640px; }

/* ---- hero ---- */
.cal-hero {
  display: flex; align-items: center; gap: 24px;
  padding: 26px 32px; margin-bottom: 16px;
}
.cal-hero[hidden] { display: none; }
.cal-hero__icon {
  width: 64px; height: 64px; border-radius: var(--r-pill); flex: none;
  background: repeating-linear-gradient(45deg, #f0e6d7 0 10px, #f6efe3 10px 20px);
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.cal-hero__body { flex: 1; min-width: 0; }
.cal-hero__title { font-size: 21px; font-weight: 900; line-height: 1.3; }
.cal-hero__text { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.5; }

.cal-hero__form { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; align-items: flex-end; }
.cal-hero__field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.cal-hero__field .pill-input { width: 190px; background: var(--bg); }
.cal-hero__submit { flex: none; }
.cal-hero__error { color: var(--terra); font-weight: 700; font-size: 12.5px; margin-top: 10px; }
.cal-hero__error[hidden] { display: none; }

.cal-hero__metrics { display: flex; gap: 26px; text-align: center; flex: none; }
.cal-metric { display: flex; flex-direction: column; gap: 2px; padding-left: 26px; border-left: 1px solid var(--line-soft); }
.cal-metric:first-child { padding-left: 0; border-left: 0; }
.cal-metric__value { font-weight: 900; font-size: 20px; }
.cal-metric__label { font-size: 11px; color: var(--muted); font-weight: 700; }

.cal-hero-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 4px 20px; font-size: 12.5px; color: var(--muted); }
.cal-hero-footer[hidden] { display: none; }
.cal-hero-footer__edit { font-weight: 800; color: var(--terra); flex: none; }

/* ---- таймлайн ---- */
.cal-timeline-wrap { margin: 4px 0 12px; }
.cal-chip { cursor: pointer; }
.cal-chip--viewing { background: #fff; border: 2px solid var(--terra); color: var(--terra); padding: 7px 15px; }

/* ---- подпись просматриваемой группы ---- */
.cal-group-caption { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 0 4px 20px; }
.cal-group-caption[hidden] { display: none; }
.cal-group-caption strong { color: var(--ink); }
.cal-group-caption__reset { font-weight: 800; color: var(--terra); font-size: 12.5px; }
.cal-group-caption__reset[hidden] { display: none; }

/* ---- три карточки ---- */
.cal-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.cal-card { border-radius: var(--r-card); padding: 22px 26px; }
.cal-card--green { background: var(--green-bg); }
.cal-card--cream { background: var(--pastel-cream); }
.cal-card--blue { background: var(--pastel-blue); }
.cal-card__title { font-weight: 900; font-size: 16px; margin-bottom: 12px; }
.cal-card__list { display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.45; font-weight: 600; }
.cal-card__list li { padding-left: 14px; position: relative; }
.cal-card__list li::before { content: '·'; position: absolute; left: 0; font-weight: 900; }
.cal-card--green .cal-card__list { color: #4a5a44; }
.cal-card--cream .cal-card__list { color: #7a6248; }
.cal-card--blue .cal-card__list { color: #4f6b7a; }
.cal-card__note { font-size: 12px; font-weight: 700; margin-top: 12px; color: #7d9370; }

.cal-card__list--custom { margin-top: 10px; }
.cal-card__list--custom li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cal-reminder-remove { flex: none; font-size: 16px; line-height: 1; font-weight: 900; color: #5b7f91; cursor: pointer; }
.cal-reminder-form { display: flex; gap: 8px; margin-top: 14px; }
.cal-reminder-form .pill-input { flex: 1; background: #fff; }

/* ---- статьи + размер ---- */
.cal-related { display: grid; grid-template-columns: 1.2fr .8fr; gap: 20px; }
.cal-articles { padding: 24px 28px; }
.cal-articles__title { font-weight: 900; font-size: 18px; margin-bottom: 16px; }
.cal-articles-list { display: flex; flex-direction: column; gap: 12px; }
.cal-articles-list .journal-card { display: flex; gap: 14px; align-items: center; border-radius: 16px; padding: 8px; }
.cal-articles-list .journal-card__cover { width: 76px; height: 56px; flex: none; padding: 0; border-radius: 12px; }
.cal-articles-list .journal-card__body { padding: 0; }
.cal-articles-list .journal-card__title { margin: 3px 0 0; font-size: 14.5px; }
.cal-articles-list .journal-card__meta { font-size: 12px; }
.cal-articles-list .journal-card__fav { top: 6px; right: 8px; }
.cal-articles__empty { color: var(--muted); font-size: 13.5px; }

.cal-size-block {
  background: var(--green); border-radius: var(--r-card); padding: 24px 28px; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
}
.cal-size-block[hidden] { display: none; }
.cal-size-block__title { font-weight: 900; font-size: 18px; line-height: 1.3; }
.cal-size-block__text { font-size: 13.5px; opacity: .92; line-height: 1.55; margin-top: 8px; }
.cal-size-block__actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ---- мобильная версия ---- */
@media (max-width: 768px) {
  .cal-page { padding-top: 12px; }
  .cal-head__title { font-size: 22px; }

  .cal-hero { flex-direction: column; align-items: flex-start; padding: 18px; gap: 14px; }
  .cal-hero__metrics { width: 100%; justify-content: space-between; }
  .cal-hero__form { flex-direction: column; align-items: stretch; width: 100%; }
  .cal-hero__field .pill-input { width: 100%; }
  .cal-hero__submit { width: 100%; }
  .cal-hero-footer { flex-direction: column; align-items: flex-start; gap: 6px; }

  .cal-cards { grid-template-columns: 1fr; }
  .cal-related { grid-template-columns: 1fr; }

  .cal-group-caption { font-size: 12.5px; }
}
