/* parler.SI custom styles: mobile optimization + monochrome refinement */

/* Retain legible monochrome links across the light and dark themes. */
:root {
  --site-link-color: #55595e;
  --site-link-hover-color: #222528;
}

[data-theme='dark'] {
  --site-link-color: #bfc2c6;
  --site-link-hover-color: #ffffff;
}

#content-inner a,
#aside-content a {
  color: var(--site-link-color);
}

#content-inner a:hover,
#aside-content a:hover {
  color: var(--site-link-hover-color);
}

#footer {
  background-color: #16181a;
}

body.token-genius-page #content-inner {
  display: block;
  max-width: 1080px;
  padding: 48px 24px 80px;
}

body.token-genius-page {
  --global-bg: #0d0d0d;
  --font-color: rgba(255, 255, 255, 0.82);
  --hr-border: rgba(255, 255, 255, 0.24);
  --hr-before-color: rgba(255, 255, 255, 0.7);
  --card-bg: #121212;
  --sidebar-bg: #121212;
  --sidebar-menu-bg: #1f1f1f;
  --btn-bg: #1f1f1f;
  --btn-color: #cccccc;
  --btn-hover-color: #787878;
  --light-grey: rgba(255, 255, 255, 0.7);
  --dark-grey: rgba(255, 255, 255, 0.2);
  --white: rgba(255, 255, 255, 0.9);
  --text-highlight-color: rgba(255, 255, 255, 0.92);
  --blockquote-color: rgba(255, 255, 255, 0.7);
  --blockquote-bg: #2c2c2c;
  --reward-pop: #2c2c2c;
  --toc-link-color: rgba(255, 255, 255, 0.7);
  --zoom-bg: #121212;
  --site-link-color: #c4c7cb;
  --site-link-hover-color: #ffffff;
  color: var(--font-color);
  background: var(--global-bg);
  color-scheme: dark;
}

body.token-genius-page #content-inner > #page {
  width: 100%;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.token-genius-page #aside-content {
  display: none;
}

body.token-genius-page #article-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0;
}

body.token-genius-page #article-container table {
  border-color: var(--hr-border);
  color: var(--font-color);
}

body.token-genius-page #article-container table thead {
  background: #1c1c1c;
}

body.token-genius-page #article-container table th,
body.token-genius-page #article-container table td {
  border-color: var(--hr-border);
  color: var(--font-color);
}

@media screen and (max-width: 768px) {
  body.token-genius-page #content-inner {
    padding: 36px 16px 56px;
  }
}

#post .tag_share .post-meta__tags {
  border-color: var(--site-link-color);
  color: var(--site-link-color);
  background-color: rgba(255, 255, 255, 0.04);
}

#post .tag_share .post-meta__tags:hover {
  border-color: var(--site-link-color);
  color: var(--global-bg);
  background-color: var(--site-link-color);
}

/* ---------- tier badges ---------- */
.tier-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
  margin-right: 8px;
  vertical-align: middle;
}
.tier-paid {
  background: #2f2f2f;
  color: #fff;
}

/* ---------- pricing comparison ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.pricing-plan {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--hr-border);
  border-radius: 6px;
  background: var(--card-bg);
}
.pricing-plan-premium {
  border-color: var(--site-link-color);
}
.pricing-label {
  margin: 0 0 0.35rem;
  color: var(--card-meta);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}
.pricing-plan h2 {
  margin: 0 0 0.5rem;
}
.pricing-price {
  margin: 0.4rem 0 1rem;
}
.pricing-price strong {
  color: var(--text-highlight-color);
  font-size: 2rem;
  font-weight: 700;
}
.pricing-price span {
  color: var(--card-meta);
}
.pricing-plan ul {
  padding-left: 1.25rem;
}
.pricing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-top: 0.75rem;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 8px 12px;
  color: #fff !important;
  background: #2d3238;
  font-weight: 650;
  white-space: nowrap;
}
.pricing-cta:hover {
  border-color: #5e6670;
  color: #fff !important;
  background: #3d444c;
}
.pricing-accepted-methods {
  margin: 0.7rem 0 0;
  color: var(--card-meta);
  font-size: 0.82rem;
  line-height: 1.55;
}
.pricing-accepted-methods strong {
  color: var(--font-color);
}
.pricing-availability {
  margin: 1.2rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--hr-border);
  color: var(--font-color);
  font-size: 0.9rem;
  font-weight: 600;
}
@media screen and (max-width: 680px) {
  .pricing-grid {
    grid-template-columns: 1fr;
  }
}

.nav-account-item {
  white-space: nowrap;
}

.nav-account-placeholder {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 4px;
  padding: 3px 7px;
  color: var(--light-grey);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-size: 0.86em;
  line-height: 1.2;
  cursor: pointer;
}

.nav-account-placeholder:hover {
  border-color: rgba(255, 255, 255, 0.85);
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

#page-header.nav-fixed #nav .nav-account-placeholder {
  border-color: var(--hr-border);
  color: var(--font-color);
  background: var(--card-bg);
}

#page-header.nav-fixed #nav .nav-account-placeholder:hover {
  border-color: var(--site-link-color);
  color: var(--site-link-hover-color);
  background: #3c4044;
}

/* ---------- hero ---------- */
#page-header.full_page #site-title {
  letter-spacing: 0.02em;
}
#page-header.full_page #site-title .site-logo {
  height: 64px;
  width: auto;
  display: block;
  margin: 0 auto;
}
@media screen and (max-width: 768px) {
  #page-header.full_page #site-title .site-logo {
    width: min(72vw, 280px);
    max-width: calc(100vw - 40px);
    height: auto;
    aspect-ratio: 2293 / 571;
    object-fit: contain;
  }
}
#page-header.full_page #site-subtitle {
  font-size: 1.05rem;
  opacity: 0.85;
}

/* ---------- post images: never overflow, comfortable on mobile ---------- */
.post-content img,
#article-container img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* cover images in cards */
#recent-posts .post_cover img,
#recent-posts > .recent-post-item .post_cover img {
  object-fit: cover;
  transition: transform 280ms ease;
}
@media (hover: hover) and (pointer: fine) {
  #recent-posts .recent-post-item:hover .post_cover img {
    transform: scale(1.04);
  }
}
@media (prefers-reduced-motion: reduce) {
  #recent-posts .post_cover img,
  #recent-posts > .recent-post-item .post_cover img {
    transition: none;
  }
}

/* ---------- mobile ---------- */
@media screen and (max-width: 768px) {
  .nav-account-placeholder {
    padding: 4px 8px;
    font-size: 0.9em;
  }

  /* hero title scales down, stays above the globe */
  #page-header.full_page #site-title {
    font-size: 2rem;
  }
  #page-header.full_page #site-subtitle {
    font-size: 0.9rem;
    padding: 0 1.2rem;
  }

  /* nav: keep logo + hamburger on one line, no squeeze */
  #nav .site-name {
    font-size: 1.05rem;
  }
  #nav img.site-icon {
    height: 28px;
  }

  /* post cards go full width with breathing room */
  #recent-posts > .recent-post-item {
    margin: 0 0.6rem 1rem;
  }

  /* article typography for small screens */
  #article-container {
    padding: 1.2rem 1rem;
  }
  #article-container h1 { font-size: 1.5rem; }
  #article-container h2 { font-size: 1.3rem; }
  #article-container p,
  #article-container li {
    font-size: 0.98rem;
    line-height: 1.75;
  }

  /* tables scroll horizontally instead of breaking layout */
  #article-container table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* footer legal links: comfortable tap targets */
  #footer-wrap a {
    padding: 0.2rem 0.1rem;
  }
}

/* very small screens */
@media screen and (max-width: 380px) {
  #page-header.full_page #site-title {
    font-size: 1.7rem;
  }
}

/* ---------- monochrome refinement ---------- */
/* soften Butterfly's default blue accents that theme_color doesn't cover */
#nav .menus_items .menus_item a:hover,
#page-header.nav-fixed #nav a:hover {
  color: var(--site-link-color) !important;
}

/* ---------- smooth expand-in-place for recent post cards ---------- */
#recent-posts .recent-post-item.expandable {
  flex-wrap: wrap;
  cursor: pointer;
}
#recent-posts .recent-post-item.expandable:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
}
.post-expand {
  flex: 0 0 100%;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.recent-post-item.expanded .post-expand {
  grid-template-rows: 1fr;
}
.post-expand-body {
  overflow: hidden;
  min-height: 0;
  opacity: 0;
  transition: opacity 0.35s ease 0.1s;
}
.recent-post-item.expanded .post-expand-body {
  opacity: 1;
}
/* hide the excerpt once the full article is shown */
.recent-post-item.expanded .recent-post-info .content {
  display: none;
}

/* loading dots */
.expand-loading {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 2.2rem 0;
}
.expand-loading span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #b5b5b5;
  animation: expand-blink 1.1s infinite;
}
.expand-loading span:nth-child(2) { animation-delay: 0.18s; }
.expand-loading span:nth-child(3) { animation-delay: 0.36s; }
@keyframes expand-blink {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* expanded article typography */
.expand-article {
  padding: 0.4rem 0.2rem 0;
  cursor: default;
}
.expand-article h1 { font-size: 1.45rem; margin: 1.2em 0 0.7em; }
.expand-article h2 { font-size: 1.25rem; margin: 1.4em 0 0.7em; padding-bottom: 0.3em; border-bottom: 1px solid var(--hr-border); }
.expand-article h3 { font-size: 1.1rem; margin: 1.2em 0 0.6em; }
.expand-article p, .expand-article li { font-size: 0.98rem; line-height: 1.8; color: var(--font-color); }
.expand-article p { margin: 0 0 1em; }
.expand-article ul, .expand-article ol { margin: 0 0 1em 1.4em; }
.expand-article li { margin-bottom: 0.35em; }
.expand-article img { max-width: 100%; height: auto; border-radius: 8px; margin: 0.6em 0; }
.expand-article a { color: var(--site-link-color); text-decoration: underline; text-underline-offset: 3px; }
.expand-article blockquote {
  margin: 1em 0; padding: 0.8em 1.1em;
  border-left: 3px solid var(--site-link-color); background: var(--blockquote-bg); border-radius: 0 8px 8px 0;
}
.expand-article blockquote p { margin: 0; color: var(--blockquote-color); }
.expand-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em; background: var(--sidebar-menu-bg); color: var(--text-highlight-color); padding: 0.15em 0.4em; border-radius: 4px;
}
.expand-article pre {
  background: #1e1e1e; border-radius: 8px; padding: 1em 1.2em;
  overflow-x: auto; margin: 1em 0;
}
.expand-article pre code { background: none; padding: 0; color: #e8e8e8; }
.expand-article hr { border: none; border-top: 1px solid var(--hr-border); margin: 1.6em 0; }
.expand-error { padding: 1.5rem 0; color: #888; }

/* actions row */
.expand-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.4rem 0.2rem 0.6rem;
  border-top: 1px solid var(--hr-border);
  margin-top: 1.2rem;
}
.collapse-btn {
  border: 1px solid var(--hr-border);
  background: var(--card-bg);
  border-radius: 20px;
  padding: 0.45rem 1.1rem;
  font-size: 0.88rem;
  color: var(--font-color);
  cursor: pointer;
  transition: all 0.2s;
}
.collapse-btn:hover { background: #3c4044; color: var(--site-link-hover-color); border-color: var(--site-link-color); }
.open-full { font-size: 0.88rem; color: var(--card-meta); text-decoration: none; }
.open-full:hover { color: var(--site-link-hover-color); }

@media screen and (max-width: 768px) {
  .expand-article { padding: 0.2rem 0 0; }
  .expand-actions { flex-wrap: wrap; }
}
