/* ============================================================
   THEME 7 — "Channel"
   Telegram-style dark feed for telegram-fed sites.
   Palette: slate #0e1621 page, #17212b bubbles, #5288c1 accent.
   ============================================================ */

:root {
  --bg:      #0e1621;
  --bubble:  #17212b;
  --bubble2: #1c2836;
  --text:    #f1f4f7;
  --muted:   #708499;
  --accent:  #5288c1;
  --accent2: #64b5ef;
  --radius:  12px;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent2); }

img { max-width: 100%; }

/* ------------------------------------------------------------
   Layout column — narrow, like a channel feed
   ------------------------------------------------------------ */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 14px;
}

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(23, 33, 43, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(112, 132, 153, .18);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .65rem;
  padding-bottom: .65rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .01em;
  min-width: 0;
}

.brand span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-plane {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--accent2);
}

.brand-logo { height: 52px; width: auto; display: block; }

@media (max-width: 600px) {
  .brand-logo { height: 40px; }
}

/* ------------------------------------------------------------
   Channel cover — homepage only, mirrors a Telegram channel header
   ------------------------------------------------------------ */
.channel-hero {
  text-align: center;
  padding: 2.2rem 0 .6rem;
}

.channel-hero-logo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .45);
}

.channel-hero-name {
  margin: .9rem 0 .25rem;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.25;
}

.channel-hero-desc {
  margin: 0 auto;
  max-width: 30rem;
  color: var(--muted);
  font-size: .98rem;
}

.channel-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-top: 1rem;
  padding: .55rem 1.4rem;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: background .15s ease;
}

.channel-hero-btn:hover { background: var(--accent2); }

.channel-hero-btn svg { display: block; }

@media (max-width: 600px) {
  .channel-hero { padding-top: 1.6rem; }
  .channel-hero-logo { width: 80px; height: 80px; border-radius: 20px; }
  .channel-hero-name { font-size: 1.4rem; }
}

/* ------------------------------------------------------------
   Feed of post bubbles
   ------------------------------------------------------------ */
.feed {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.25rem 0;
}

.feed-title { margin: 1.25rem 0 0; }

.feed-empty {
  color: var(--muted);
  text-align: center;
  padding: 3rem 0;
  font-style: italic;
}

.post {
  background: var(--bubble);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  border: 1px solid transparent;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.feed .post:hover {
  transform: translateY(-2px);
  border-color: rgba(82, 136, 193, .35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
}

.post-photo-link { display: block; line-height: 0; }

.post-photo {
  display: block;
  width: 100%;
  max-height: 540px;
  object-fit: cover;
  background: var(--bubble2);
}

.post-body { padding: .85rem 1rem 1rem; }

.post-title {
  margin: 0 0 .35rem;
  font-size: 1.3rem;
  line-height: 1.35;
  font-weight: 600;
}

.post-title a {
  color: var(--text);
  text-decoration: none;
}

.post-title a:hover { color: var(--accent2); }

.post-meta {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .82rem;
  color: var(--muted);
}

.post-meta time { margin-left: auto; }

.post-cat {
  color: var(--accent2);
  text-decoration: none;
  font-weight: 500;
}

.post-cat:hover { text-decoration: underline; }

/* ------------------------------------------------------------
   Article page
   ------------------------------------------------------------ */
.article { margin: 1.25rem 0; }

.article .h1,
.h1 {
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 0 0 .4rem;
  font-weight: 700;
}

.article .meta {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.article .body {
  font-size: 1.02rem;
  line-height: 1.7;
}

.article .body p { margin: 0 0 1em; }

.article .body a { color: var(--accent2); }

.article .body img {
  border-radius: 8px;
  display: block;
  margin: 1rem auto;
}

.article .body blockquote {
  margin: 1rem 0;
  padding: .5rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--bubble2);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
}

.article .body code {
  background: var(--bubble2);
  padding: .1em .35em;
  border-radius: 4px;
  font-size: .92em;
}

/* Hashtag-style tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1.25rem;
}

.tag {
  color: var(--accent2);
  background: rgba(82, 136, 193, .12);
  border-radius: 6px;
  padding: .2rem .55rem;
  font-size: .85rem;
}

/* ------------------------------------------------------------
   Pagination
   ------------------------------------------------------------ */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem;
  padding: .5rem 0 2rem;
}

.pageLink {
  display: inline-block;
  padding: .4rem .8rem;
  border-radius: 8px;
  background: var(--bubble);
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
}

.pageLink:hover { background: var(--bubble2); }

.pageLink.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.pageLink.disabled {
  opacity: .35;
  pointer-events: none;
}

/* ------------------------------------------------------------
   Load more — replaces numbered pages on the feed
   ------------------------------------------------------------ */
.load-more-wrap {
  text-align: center;
  padding: .4rem 0 2rem;
}

.load-more {
  display: inline-block;
  padding: .65rem 2.4rem;
  background: var(--bubble2);
  border: 1px solid rgba(82, 136, 193, .4);
  color: var(--text);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: background .15s ease, border-color .15s ease;
}

.load-more:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.load-more.loading {
  opacity: .5;
  pointer-events: none;
}

/* ------------------------------------------------------------
   Back to top
   ------------------------------------------------------------ */
.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bubble2);
  border: 1px solid rgba(82, 136, 193, .4);
  color: var(--text);
  border-radius: 50%;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, background .15s ease;
}

.to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.to-top:hover {
  background: var(--accent);
  color: #fff;
}

/* ------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.footer {
  padding: 1.5rem 14px 2.5rem;
  color: var(--muted);
  text-align: center;
}

/* ------------------------------------------------------------
   Small screens — bubbles bleed to the edges like the app
   ------------------------------------------------------------ */
@media (max-width: 520px) {
  .wrap { padding: 0 8px; }
  .post { border-radius: 10px; }
  .post-photo { max-height: 420px; }
  .article .h1, .h1 { font-size: 1.3rem; }
}
