:root {
  /* Branding colors */
  --primary-text: #000000;
  --secondary-text: #707579;
  --accent-color: #2aabee; /* Telegram Blue */
  --bg-color: #f1f1f1; /* App background feel */
  --card-bg: #ffffff;
  --font-main:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  --max-width: 580px; /* Standard TG message width on desktop is often narrow */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--primary-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Nav */
nav {
  background: var(--card-bg);
  padding: 12px 0;
  text-align: center;
  border-bottom: 1px solid #e1e1e1;
  margin-bottom: 20px;
}

.nav-logo {
  font-weight: 500;
  font-size: 1rem;
  color: var(--primary-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-logo svg {
  fill: var(--secondary-text);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 0 10px;
}

/* Post Card mimicking Telegram Message */
.post-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid transparent;
  margin-bottom: 40px;
  position: relative;
}

/* Header within the post card */
.post-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
}

.post-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.channel-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--primary-text);
}

.post-date {
  font-size: 0.85rem;
  color: var(--secondary-text);
}

/* Content Area */
.post-body {
  padding: 0 16px 16px;
  font-size: 1rem;
  color: #000;
}

/* Image - always fully visible */
.post-image {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
  object-fit: cover;
}

/* Text container with 2/3 preview (calculated by JS) */
.post-text-container {
  position: relative;
}

.post-text {
  /* Typography matches TG */
  margin-bottom: 10px;
}

.post-text strong,
.post-text b {
  font-weight: 600;
}

.post-text em,
.post-text i {
  font-style: italic;
}

.post-text u,
.post-text ins {
  text-decoration: underline;
}

.post-text s,
.post-text strike,
.post-text del {
  text-decoration: line-through;
}

.post-text code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
}
/* Lists */
.post-text ul,
.post-text ol {
  margin: 12px 0;
  padding-left: 24px;
}

.post-text ul {
  list-style-type: disc;
}

.post-text ol {
  list-style-type: decimal;
}

.post-text li {
  margin: 6px 0;
  line-height: 1.6;
}
.post-text pre {
  background: #f0f0f0;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 0.9em;
  margin: 8px 0;
}

/* Telegram-style blockquote */
.post-text blockquote,
.post-text .tg-quote {
  border-left: 3px solid var(--accent-color);
  padding: 8px 12px;
  margin: 8px 0;
  background: #f8f9fa;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--secondary-text);
}

.post-text blockquote em,
.post-text .tg-quote em {
  font-style: normal;
}

.post-text a {
  color: #2481cc;
  text-decoration: none;
  word-break: break-all;
}

/* Summary and FAQ blocks */
.summary-block {
  background: #f8f9fa;
  border-left: 4px solid var(--accent-color);
  padding: 16px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
}

.summary-block h2 {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 12px;
  color: #1a1a1a;
}

.summary-block ul {
  margin: 0;
}

.faq-block {
  background: #ffffff;
  border: 1px solid #e8eaed;
  padding: 20px;
  margin: 24px 0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.faq-block h2 {
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 16px;
  color: #1a1a1a;
  border-bottom: 2px solid #f1f1f1;
  padding-bottom: 8px;
}

.faq-block p {
  margin-bottom: 12px;
}

.faq-block p:last-child {
  margin-bottom: 0;
}

/* CTA Button */
.tg-button {
  background-color: var(--accent-color);
  color: white;
  text-decoration: none;
  padding: 12px 32px;
  border-radius: 8px; /* Slightly squarer like TG buttons */
  font-weight: 500;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.tg-button:hover {
  opacity: 0.9;
}

/* Breadcrumb navigation */
.breadcrumb-nav {
  background: #f7f8fa;
  border-bottom: 1px solid #e8eaed;
  padding: 8px 0;
  font-size: 0.82rem;
}

.breadcrumb {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: #777;
}

.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin-left: 4px;
  color: #aaa;
}

.breadcrumb a {
  color: #3390ec;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Reading time */
.reading-time {
  font-size: 0.78rem;
  color: #999;
  margin: 2px 0 10px;
  letter-spacing: 0.02em;
}

/* Telegram CTA block (replaces readwall) */
.tg-cta {
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, #e8f4fd 0%, #ddeeff 100%);
  border-radius: 12px;
  border: 1px solid #b3d7f5;
  text-align: center;
}

.tg-cta-text {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: #333;
  line-height: 1.45;
}

/* Footer */
footer {
  background: #171717;
  color: #9d9a9a;
  padding: 32px 20px 24px 20px;
  font-size: 10px;
  margin-top: 32px;
}

.footer-content {
  margin: 0 auto;
  max-width: var(--max-width);
}

.footer-disclaimer {
  display: block;
  margin-bottom: 16px;
  color: rgb(244, 244, 191);
}

.footer-link {
  color: #2c5282 !important;
  text-decoration: underline !important;
}

.footer-info {
  line-height: 1.6;
}

@media (min-width: 600px) {
  /* On desktop, make it look a bit more like a centred card */
  .post-card {
    margin-top: 20px;
  }
}
