/* Reader-facing pieces of the post and blog pages (large touch targets, readable text). */

/* Post text: 18px on phones, not smaller than 1.1rem on desktop. */
.post-main-card .post-content-rich {
  font-size: 1.1rem;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .post-main-card .post-content-rich {
    font-size: 1.125rem;
    line-height: 1.6;
  }
}

.post-share-btn,
.reader-follow-btn,
.post-adjacent-link,
.post-share-fallback input {
  min-height: 44px;
}

.post-share-btn:focus-visible,
.reader-follow-btn:focus-visible,
.post-adjacent-link:focus-visible,
.post-more-link:focus-visible,
.reader-quiet-link:focus-visible,
.post-share-fallback input:focus-visible {
  outline: 3px solid var(--mx-ink, #111827);
  outline-offset: 2px;
}

.post-actions-row {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.post-adjacent-links {
  display: flex;
  flex: 1 1 14rem;
  flex-direction: column;
  gap: 0.5rem;
}

.post-adjacent-link {
  background: var(--mx-ink, #111827);
  border-radius: 12px;
  box-sizing: border-box;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  justify-content: center;
  padding: 0.65rem 1rem;
  text-decoration: none;
}

.post-adjacent-link-quiet {
  background: transparent;
  border: 1px solid var(--mx-line, #d1d5db);
  color: var(--mx-ink, #111827);
}

.post-adjacent-label {
  font-size: 0.85rem;
  opacity: 0.85;
}

.post-adjacent-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.post-share-fallback {
  margin-top: 0.75rem;
}

.post-share-fallback label {
  display: block;
  margin-bottom: 0.35rem;
}

.post-share-fallback input {
  border: 1px solid var(--mx-line, #d1d5db);
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 1rem;
  padding: 0 0.75rem;
  width: 100%;
}

.post-share-note {
  margin: 0.5rem 0 0;
}

.post-more-list {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-more-link {
  align-items: center;
  color: inherit;
  display: flex;
  gap: 0.85rem;
  min-height: 44px;
  text-decoration: none;
}

.post-more-img {
  border-radius: 8px;
  flex: 0 0 auto;
  height: 72px;
  object-fit: cover;
  width: 72px;
}

.post-more-img-empty {
  background: var(--mx-surface-soft, #f3f4f6);
  display: block;
}

.post-more-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.post-more-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.post-more-date {
  color: var(--mx-muted, #6b7280);
  font-size: 0.9rem;
}

.reader-quiet-link-row {
  margin: 0.75rem 0 0;
}

.reader-quiet-link {
  color: var(--mx-muted, #6b7280);
  display: inline-block;
  padding: 0.6rem 0;
  text-decoration: underline;
}

.reader-follow-btn[aria-pressed="true"] {
  background: transparent;
}

.reader-follow-btn[hidden],
.post-share-fallback[hidden],
.post-share-note[hidden] {
  display: none;
}

/* "Ваши авторы" on the home page (filled by reader_follow.js, outside the feed grid). */
.reader-followed {
  margin: 0 0 1.5rem;
}

.reader-followed--reserved {
  min-height: 15rem;
}

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

.reader-followed-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.reader-followed-heading {
  font-size: 1.25rem;
  margin: 0;
}

.reader-followed-count {
  font-weight: 600;
}

.reader-followed-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
}

.reader-followed-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 44px;
  overflow: hidden;
  padding-bottom: 0.65rem;
  position: relative;
  text-decoration: none;
}

.reader-followed-card:focus-visible {
  outline: 3px solid var(--mx-ink, #111827);
  outline-offset: 2px;
}

.reader-followed-image {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

.reader-followed-blog,
.reader-followed-title {
  padding: 0 0.65rem;
}

.reader-followed-blog {
  color: var(--mx-muted, #6b7280);
  font-size: 0.85rem;
}

.reader-followed-title {
  font-weight: 600;
  line-height: 1.3;
}

.reader-followed-badge {
  background: var(--mx-ink, #111827);
  border-radius: 8px;
  color: #fff;
  font-size: 0.8rem;
  left: 0.5rem;
  padding: 0.15rem 0.5rem;
  position: absolute;
  top: 0.5rem;
}

.reader-follow-hint {
  color: var(--mx-muted, #6b7280);
  margin: 0.5rem 0 0;
}

.reader-follow-hint:empty {
  display: none;
}

/* Sign-in, account settings and subscriptions (reader mode). */
.reader-auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}

.reader-oauth-button {
  align-items: center;
  border-radius: 10px;
  box-sizing: border-box;
  display: flex;
  font-size: 1.05rem;
  font-weight: 600;
  gap: 0.75rem;
  justify-content: center;
  min-height: 52px;
  padding: 0.5rem 1rem;
  text-decoration: none;
}

.reader-oauth-vk,
a.reader-oauth-button.reader-oauth-vk {
  background: #0077ff;
  color: #fff;
}

.reader-oauth-yandex,
a.reader-oauth-button.reader-oauth-yandex {
  background: #000;
  color: #fff;
}

.reader-oauth-button:focus-visible,
.reader-identity-row button:focus-visible,
.reader-max-fallback:focus-visible {
  outline: 3px solid var(--mx-ink, #111827);
  outline-offset: 2px;
}

.reader-auth-or {
  color: #4b5563;
  margin: 1rem 0 0.5rem;
  text-align: center;
}

.reader-auth-notice,
.reader-field-error {
  color: #9b1c1c;
  font-weight: 600;
}

.reader-auth-notice {
  background: #fdecec;
  border-radius: 10px;
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
}

.reader-auth-notice p {
  margin: 0;
}

.reader-identity-row {
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reader-identity-row button,
.reader-max-link a,
.reader-max-link button {
  min-height: 44px;
}

.reader-max-fallback {
  box-sizing: border-box;
  margin-top: 0.5rem;
  min-height: 44px;
  width: 100%;
}

.reader-follow-notice {
  background: #fff7e0;
  border: 1px solid #e6c36a;
  border-radius: 10px;
  bottom: 1rem;
  box-sizing: border-box;
  left: 1rem;
  padding: 0.75rem 1rem;
  position: fixed;
  right: 1rem;
  z-index: 60;
}

/* Discussion under a post (reader_comments.js). */
.rc-title-link-row { margin: 0.5rem 0 0; }
.rc-title-link { display: inline-block; padding: 0.6rem 0; color: var(--mx-muted, #6b7280); text-decoration: underline; }
.rc-title-link[hidden] { display: none; }
.rc-list { list-style: none; margin: 0; padding: 0; }
.rc-item { padding: 0.9rem 0; border-bottom: 1px solid rgba(0, 0, 0, 0.08); overflow-wrap: anywhere; }
.rc-item--reply { margin-left: 1.25rem; }
.rc-head { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: center; }
.rc-avatar { flex: none; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.1); font-weight: 600; }
.rc-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-author { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.rc-badge { font-size: 0.8125rem; padding: 0.1rem 0.5rem; border-radius: 999px; background: rgba(0, 0, 0, 0.07); }
.rc-date, .rc-edited, .rc-reply-to, .rc-hint { font-size: 0.875rem; color: var(--mx-muted, #6b7280); }
.rc-text { margin: 0.4rem 0; white-space: pre-wrap; }
.rc-pending { margin: 0.25rem 0; font-size: 0.9rem; color: #8a5a00; }
.rc-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.rc-btn { min-height: 44px; }
.rc-sent { font-size: 0.9rem; color: var(--mx-muted, #6b7280); }
.rc-empty { color: var(--mx-muted, #6b7280); }
.rc-notice { min-height: 1.25rem; margin: 0.5rem 0; }
.rc-notice--error { color: #b00020; }
.rc-rules { margin: 1rem 0; font-size: 0.9rem; }
.rc-rules-title { margin: 0 0 0.25rem; font-weight: 600; }
.rc-rules-list { margin: 0 0 0.25rem; padding-left: 1.2rem; }
.rc-rules-link { display: inline-block; padding: 0.6rem 0; }
.rc-textarea, .rc-input { display: block; width: 100%; box-sizing: border-box; padding: 0.7rem; font: inherit; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 8px; margin: 0.5rem 0; }
.rc-input { min-height: 44px; }
.rc-form .rc-btn, .rc-edit .rc-btn { margin-right: 0.5rem; }
.rc-modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(0, 0, 0, 0.5); }
.rc-modal-box { width: 100%; max-width: 420px; max-height: 100%; overflow: auto; padding: 1.25rem; border-radius: 12px; background: #fff; color: #111; }
/* Inline confirmation blocks (settings: unlink, close account; comments use .rc-inline-ask). */
.reader-confirm, .rc-inline-ask { display: flex; flex-direction: column; gap: 0.75rem; margin: 0.75rem 0; padding: 1rem; border: 1px solid rgba(0, 0, 0, 0.25); border-radius: 8px; background: #fff; }
.reader-confirm[hidden] { display: none; }
.reader-confirm p, .rc-inline-ask p { margin: 0; }
.reader-confirm button, .reader-confirm .mx-btn, .rc-inline-ask .rc-btn { min-height: 44px; }
/* The hidden attribute must win over the display rules of discussion controls. */
[data-rc-root] [hidden] { display: none !important; }
