/* Разделы читателя: «Подписки», «Ваши блоги», «Сохранённое», «Уведомления».
   Та же белая панель и шапка, что у Главной и тем (mix_ui.css); сетка отступов 4/8/12/16/24 px,
   текст 15 px, вторичный — серый --mx-muted, аватарки круглые. */

.mx-reader-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mx-reader-section > .mx-page-head {
  margin: 0;
}

.mx-reader-section .mix-native-status:empty,
.mx-reader-section .mix-native-error[hidden] {
  display: none;
}

/* ---- пустой раздел: картинка, заголовок, пояснение, кнопка ---- */
.mx-reader-empty {
  align-items: center;
  background: #f7f0e7;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 1rem 1.5rem;
  text-align: center;
}

.mx-reader-empty[hidden] {
  display: none;
}

/* Края картинки тают в фон блока: у рисунков фон почти, но не точно, того же тона. */
.mx-reader-empty img {
  aspect-ratio: 3 / 2;
  height: auto;
  margin-bottom: 0.25rem;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 82%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 82%, transparent 100%);
  width: min(100%, 360px);
}

.mx-reader-empty h2 {
  color: var(--mx-ink);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.mx-reader-empty p {
  color: var(--mx-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
  margin: 0;
  max-width: 30rem;
}

.mx-reader-empty .mx-btn {
  margin-top: 0.5rem;
  min-height: 44px;
}

/* ---- короткое сообщение без картинки («новых записей пока нет») ---- */
.mx-reader-notice {
  background: var(--mx-surface-soft, #f8fafc);
  border: 1px solid var(--mx-line);
  border-radius: 16px;
  padding: 0.875rem 1rem;
}

.mx-reader-notice h2 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.mx-reader-notice p {
  color: var(--mx-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
  margin: 0.25rem 0 0;
}

/* Разделитель «Вы всё посмотрели» / «Это всё сохранённое» ставит global_feed.js. */
.mx-reader-feed .home-block-head.has-note {
  border-top: 1px solid var(--mx-line);
  letter-spacing: normal;
  margin: 0.5rem 0;
  padding: 1.25rem 0 0.25rem;
  text-transform: none;
}

.mx-reader-feed .home-block-head.has-note h2 {
  color: var(--mx-ink);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.mx-reader-feed .home-block-head.has-note p {
  color: var(--mx-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
  margin: 0.25rem 0 0;
}

/* ---- аватарка блога ---- */
.mx-blog-avatar {
  background: var(--mx-bg);
  border-radius: 50%;
  display: block;
  flex: none;
  height: 48px;
  object-fit: cover;
  width: 48px;
}

.mx-blog-avatar--letter {
  align-items: center;
  color: var(--mx-muted);
  display: flex;
  font-size: 1.125rem;
  font-weight: 600;
  justify-content: center;
}

/* ---- «Ваши блоги» над лентой подписок: ряд аватарок, как у Дзена ---- */
.mx-blog-strip {
  border-bottom: 1px solid var(--mx-line);
  padding-bottom: 0.75rem;
}

.mx-blog-strip-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.mx-blog-strip-head h2 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.mx-blog-strip-all {
  align-items: center;
  color: var(--mx-accent);
  display: inline-flex;
  font-size: 0.9375rem;
  font-weight: 600;
  gap: 4px;
  margin: -12px -12px -12px 0;
  min-height: 44px;
  padding: 0 12px;
  text-decoration: none;
}

.mx-blog-strip-all:hover {
  text-decoration: underline;
}

.mx-blog-strip-list {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0 -0.25rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.mx-blog-strip-list::-webkit-scrollbar {
  display: none;
}

.mx-blog-chip {
  align-items: center;
  border-radius: 14px;
  color: var(--mx-ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0.375rem 0.25rem;
  text-decoration: none;
  width: 80px;
}

.mx-blog-chip:hover {
  background: var(--mx-bg);
}

.mx-blog-chip .mx-blog-avatar {
  height: 56px;
  width: 56px;
}

.mx-blog-chip-name {
  -webkit-box-orient: vertical;
  display: -webkit-box;
  font-size: 0.8125rem;
  -webkit-line-clamp: 2;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  /* Перенос по слогам («Бесконеч-ное»), а не посреди слова; рвём слово, только если не влезает и так. */
  hyphens: auto;
  overflow-wrap: break-word;
  text-align: center;
}

/* ---- страница «Ваши блоги» ---- */
.mx-back-link {
  align-items: center;
  align-self: flex-start;
  color: var(--mx-muted);
  display: inline-flex;
  font-size: 0.9375rem;
  gap: 0.25rem;
  margin: -0.5rem 0 -0.75rem -0.5rem;
  min-height: 44px;
  padding: 0 0.5rem;
  text-decoration: none;
}

.mx-back-link:hover {
  color: var(--mx-ink);
}

.mx-blog-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mx-blog-row {
  align-items: center;
  border-top: 1px solid var(--mx-line);
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

.mx-blog-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.mx-blog-row-link {
  align-items: center;
  color: var(--mx-ink);
  display: flex;
  flex: 1 1 auto;
  gap: 0.75rem;
  min-width: 0;
  text-decoration: none;
}

.mx-blog-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mx-blog-row-name {
  -webkit-box-orient: vertical;
  display: -webkit-box;
  font-size: 0.9375rem;
  font-weight: 700;
  -webkit-line-clamp: 2;
  line-height: 1.3;
  overflow: hidden;
  hyphens: auto;
  overflow-wrap: break-word;
}

/* Кнопка всегда в одну строку и одной ширины — сжимается текст слева. */
.mx-blog-row .reader-follow-btn {
  flex: none;
  white-space: nowrap;
}

.mx-blog-row-link:hover .mx-blog-row-name {
  text-decoration: underline;
}

.mx-blog-row-about {
  color: var(--mx-muted);
  font-size: 0.875rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- уведомления и комментарии ---- */
.mx-account-comments,
.mx-notifications {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mx-notifications-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -0.25rem;
}

.mx-notifications-actions .mix-studio-icon,
.mx-reader-more .mix-studio-icon {
  height: 18px;
  width: 18px;
}

/* Список прячет кнопку «прочитать всё», пока уведомлений нет. */
.mx-notifications:has(.mx-notifications-list:empty) .mx-notifications-actions {
  display: none;
}

.mx-notifications-list:empty {
  display: none;
}

.mx-notifications-list {
  border: 1px solid var(--mx-line);
  border-radius: 16px;
  overflow: hidden;
}

.mx-notifications-list .mix-native-notification {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 2px 0.75rem;
  grid-template-columns: 40px minmax(0, 1fr);
  margin: 0;
  padding: 0.875rem 1rem;
  position: relative;
}

.mx-notifications-list .mix-native-notification + .mix-native-notification {
  border-top: 1px solid var(--mx-line);
}

/* Непрочитанное — светлый фон и точка у значка. */
.mx-notifications-list .mix-native-notification[data-notification-read="false"] {
  background: #f3f8fc;
}

.mx-notification-icon {
  align-items: center;
  background: var(--mx-bg);
  border-radius: 50%;
  color: var(--mx-muted);
  display: flex;
  grid-row: 1 / span 4;
  height: 40px;
  justify-content: center;
  position: relative;
  width: 40px;
}

.mx-notification-icon svg {
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 20px;
}

[data-notification-read="false"] > .mx-notification-icon::after {
  background: var(--mx-accent);
  border: 2px solid #fff;
  border-radius: 50%;
  content: "";
  height: 10px;
  position: absolute;
  right: -1px;
  top: -1px;
  width: 10px;
}

.mx-notifications-list .mix-native-reader-title {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.mx-notifications-list .mix-native-reader-summary,
.mx-notification-time {
  color: var(--mx-muted);
  font-size: 0.9375rem;
  line-height: 1.45;
  margin: 0;
}

/* Тихая кнопка-ссылка: «Отметить всё прочитанным», «Отметить прочитанным». */
.mx-text-btn {
  align-items: center;
  background: none;
  border: 0;
  border-radius: var(--mx-radius-md);
  color: var(--mx-muted);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  gap: 0.375rem;
  min-height: 44px;
  padding: 0 0.5rem;
}

.mx-text-btn:hover {
  color: var(--mx-ink);
}

.mx-text-btn[hidden] {
  display: none;
}

.mx-notifications-actions .mx-text-btn {
  margin-right: -0.5rem;
}

.mx-notification-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin: 0 0 -0.5rem;
}

.mx-notification-actions .mx-text-btn {
  margin-left: -0.5rem;
}

.mx-notifications-list .mix-native-inline-link {
  align-items: center;
  color: var(--mx-accent);
  display: inline-flex;
  font-size: 0.9375rem;
  font-weight: 600;
  min-height: 44px;
  text-decoration: none;
}

.mx-notifications-list .mix-native-inline-link:hover {
  text-decoration: underline;
}

.mx-reader-more {
  align-self: center;
  min-height: 44px;
}

.mx-reader-more[hidden] {
  display: none;
}

/* Реклама под списком — только там, где нет правой колонки (её показывают от 1200 px). */
@media (min-width: 1200px) {
  .mx-reader-inline-ad {
    display: none;
  }
}

/* Узкое окно: кнопка уходит под название, в одну линию с текстом (после аватарки 48 px и отступа 12 px). */
@media (max-width: 360px) {
  .mx-blog-row {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }

  .mx-blog-row-link {
    flex-basis: 100%;
  }

  .mx-blog-row .reader-follow-btn {
    margin-left: 60px;
  }
}

@media (max-width: 600px) {
  .mx-reader-empty {
    padding: 1rem 0.75rem 1.25rem;
  }

  .mx-reader-empty img {
    width: min(100%, 240px);
  }

  .mx-notifications-list .mix-native-notification {
    padding: 0.75rem;
  }
}
