/* In-app article reader — Android ArticleReaderScreen / ArticleReaderPane */

.tb-article-reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tb-article-reader-overlay.is-open {
  display: flex;
}

body.tb-article-reader-open {
  overflow: hidden;
}

body.tb-article-reader-open .app-bottom-nav {
  display: none;
}

.tb-article-reader__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  min-height: 3rem;
}

.tb-article-reader__bar--embed {
  padding: 0.75rem 1rem 0.5rem;
}

.tb-article-reader__back {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.tb-article-reader__title {
  flex: 1;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-article-reader__actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.tb-article-reader__action {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.tb-article-reader__action--primary {
  background: var(--accent);
  color: var(--btn-solid-fg);
  border-color: transparent;
}

.tb-article-reader__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.tb-article-reader__body--embed {
  border-radius: 0 0 1rem 1rem;
  overflow: hidden;
}

.tb-article-reader__iframe {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: none;
  background: #fff;
}

.tb-article-reader__embed {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.tb-article-reader__fallback {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
}

@media (min-width: 840px) {
  body.tb-news-list-detail #tb-news-detail-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  body.tb-news-list-detail .tb-article-reader__embed {
    flex: 1;
  }

  body.tb-news-list-detail .tb-article-reader__iframe,
  body.tb-news-list-detail .tb-article-reader__body--embed {
    max-width: min(100%, 720px);
    margin-inline: auto;
    width: 100%;
  }
}
