/* ============================================================
   Дни рождения — страница календаря и карточек биографий
   ============================================================ */

.bd-page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 12px 40px;
  box-sizing: border-box;
}

.bd-h1 {
  font-size: 26px;
  line-height: 1.25;
  margin: 0 0 8px;
  color: #1a1a1a;
}

.bd-subtitle {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 16px;
}

.bd-intro {
  font-size: 15px;
  line-height: 1.55;
  color: #3a3f4b;
  max-width: 820px;
  margin: 0 0 22px;
}

/* «Смотрите также» в подвале страницы */
.bd-related {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e6e8ee;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  font-size: 14px;
}

.bd-related-label {
  color: #6b7280;
  margin-right: 4px;
}

.bd-related-link {
  color: #0a2c6b;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}

.bd-related-link:hover { color: #1a4ba8; }

.bd-back-link {
  color: #0a2c6b;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}

.bd-back-link:hover { color: #1a4ba8; }

.bd-year-total {
  color: #6b7280;
}

/* ---- Раскладка ---- */
.bd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .bd-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  /* На мобильном карточки идут первыми, календарь и шкала годов — после */
}

.bd-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
}

@media (max-width: 900px) {
  .bd-side { position: static; }
}

/* ============================================================
   Календарь
   ============================================================ */
.bd-calendar {
  background: #fff;
  border: 1px solid #e6e8ee;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 10px rgba(20, 30, 60, 0.04);
}

.bd-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.bd-cal-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #e0e3eb;
  color: #2b3a55;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  background: #f7f8fc;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.bd-cal-nav:hover {
  background: #0a2c6b;
  color: #fff;
  border-color: #0a2c6b;
}

/* Селектор месяца теперь не обёрнут в <form> — это просто <select> с onchange.
   Историческое имя класса .bd-cal-month-form оставлено как резервный селектор
   на случай, если где-то ещё используется. */
.bd-cal-month-form,
.bd-cal-month-select {
  flex: 1;
  text-align: center;
  margin: 0;
}

.bd-cal-month-form select,
select.bd-cal-month-select {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed #c7cdda;
  padding: 2px 18px 2px 2px;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23667' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 2px center;
  text-align: center;
}

.bd-cal-month-form select:focus,
select.bd-cal-month-select:focus {
  outline: 2px solid #0a2c6b;
  outline-offset: 2px;
  border-radius: 3px;
}

.bd-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Сетка календаря */
.bd-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.bd-cal-wd {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8b93a7;
  padding: 4px 0 6px;
}

.bd-cal-cell {
  position: relative;
  min-height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 14px;
  color: #4a4f5c;
  border-radius: 8px;
  background: transparent;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.bd-cal-empty {
  visibility: hidden;
  min-height: 0;
}

/* День с биографиями — мягкая подсветка + точка-индикатор */
.bd-cal-has {
  color: #0a2c6b;
  font-weight: 700;
  cursor: pointer;
}

.bd-cal-has::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d33;
}

.bd-cal-has:hover {
  background: #eef3ff;
}

/* Сегодня — лёгкая обводка */
.bd-cal-today {
  box-shadow: inset 0 0 0 1px #0a2c6b;
}

/* Выбранный день — заливка */
.bd-cal-selected {
  background: #0a2c6b !important;
  color: #fff !important;
}

.bd-cal-selected::after {
  background: #fff !important;
}

.bd-cal-clear {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: #0a2c6b;
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  white-space: nowrap;
}

.bd-cal-clear:hover { color: #1a4ba8; }

/* ============================================================
   Шкала годов
   ============================================================ */
.bd-years {
  background: #fff;
  border: 1px solid #e6e8ee;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 10px rgba(20, 30, 60, 0.04);
}

.bd-years-h {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: 0.01em;
}

.bd-years-scroll {
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

/* стилизованный скроллбар */
.bd-years-scroll::-webkit-scrollbar { width: 6px; }
.bd-years-scroll::-webkit-scrollbar-track { background: #f4f6fa; border-radius: 3px; }
.bd-years-scroll::-webkit-scrollbar-thumb { background: #c7cdda; border-radius: 3px; }
.bd-years-scroll::-webkit-scrollbar-thumb:hover { background: #a3acc0; }

.bd-years-decade {
  margin-bottom: 10px;
}

.bd-years-decade:last-child { margin-bottom: 0; }

.bd-years-decade-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #8b93a7;
  margin-bottom: 4px;
}

.bd-years-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.bd-year {
  display: inline-block;
  padding: 3px 8px;
  font-size: 13px;
  font-weight: 500;
  color: #2b3a55;
  background: #f4f6fa;
  border: 1px solid transparent;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.bd-year:hover {
  background: #dbe5ff;
  color: #0a2c6b;
}

.bd-year-active {
  background: #0a2c6b;
  color: #fff;
}

.bd-year-active:hover {
  background: #0a2c6b;
  color: #fff;
}

/* ============================================================
   Карточки биографий
   ============================================================ */
.bd-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.bd-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e6e8ee;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 4px rgba(20, 30, 60, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.bd-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(20, 30, 60, 0.10);
  border-color: #d0d6e4;
}

.bd-card-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #eef0f5;
  overflow: hidden;
}

.bd-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bd-card-photo-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #eef0f5 0%, #dde1ec 100%);
}

/* Бейдж с датой в углу фото — лёгкий синий, контрастная дата */
.bd-card-date {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
  padding: 5px 8px;
  background: rgba(10, 44, 107, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  border-radius: 8px;
  line-height: 1;
}

.bd-card-date-day {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.bd-card-date-mon {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  margin-top: 3px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.bd-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px 14px;
  flex: 1;
}

.bd-card-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: #1a1a1a;
  margin: 0;
}

.bd-card:hover .bd-card-name { color: #0a2c6b; }

.bd-card-year {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

.bd-card-excerpt {
  font-size: 13px;
  line-height: 1.45;
  color: #4a4f5c;
  margin: 4px 0 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.bd-empty {
  font-size: 15px;
  color: #6b7280;
  padding: 24px 0;
}

/* ============================================================
   Режим года — секции по месяцам
   ============================================================ */
.bd-year-month {
  margin-bottom: 28px;
}

.bd-year-month:last-child { margin-bottom: 0; }

.bd-year-month-h {
  font-size: 18px;
  font-weight: 600;
  color: #0a2c6b;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e6e8ee;
}

/* ============================================================
   Мобильная адаптация
   ============================================================ */
@media (max-width: 600px) {
  .bd-h1 { font-size: 22px; }
  .bd-cards {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .bd-cal-cell { font-size: 13px; min-height: 36px; }
  .bd-years-scroll { max-height: 240px; }
}
