/* ===================================================================
 * INSIGHT POST — Página individual de artigo
 * Hero escuro, prose typography, share/tags, CTA.
 * Usa tokens de tokens.css; suporta [data-theme="dark"].
 * =================================================================== */

/* ===== HERO ===== */
.ipost-hero {
  position: relative;
  background: var(--black-rock);
  color: var(--white);
  padding: 140px var(--gutter) 0;
  overflow: hidden;
}
.ipost-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 20% 0%, color-mix(in srgb, var(--primary-hi) 22%, transparent), transparent 60%),
    radial-gradient(ellipse 60% 60% at 85% 100%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
.ipost-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  padding-bottom: var(--s-8);
}

/* Back link */
.ipost-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  padding: 8px 16px;
  margin-left: -16px;
  border-radius: var(--r-pill);
  transition: all var(--t-fast);
  margin-bottom: var(--s-7);
}
.ipost-back:hover {
  background: rgba(255,255,255,0.08);
  color: var(--white);
}
.ipost-back svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Meta line */
.ipost-meta-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
  margin-bottom: var(--s-5);
}
.ipost-cat { color: var(--accent); }
.ipost-sep { opacity: 0.4; }

/* Title */
.ipost-hero h1 {
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-5);
  text-wrap: balance;
}
.ipost-hero h1 em {
  font-style: normal;
  color: var(--accent);
  font-weight: 500;
}

/* Excerpt / lead */
.ipost-excerpt {
  font-size: clamp(17px, 1.3vw, 20px);
  color: rgba(255,255,255,0.72);
  line-height: 1.55;
  margin: 0 0 var(--s-6);
  max-width: 60ch;
  text-wrap: pretty;
  font-weight: 300;
}

/* Author row */
.ipost-author-row {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-top: var(--s-4);
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 14px;
  color: rgba(255,255,255,0.65);
}
.ipost-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-hi), var(--accent));
  flex-shrink: 0;
  position: relative;
}
.ipost-avatar::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--black-rock);
}
.ipost-author-row strong {
  color: var(--white);
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
}

/* ===== COVER IMAGE =====
 * SOLUÇÃO DEFINITIVA: imagem simples, sem corte, sem transformação.
 * A imagem sempre mostra completa no seu aspect ratio original.
 * Nenhum overflow:hidden no container interno, apenas border-radius clip.
 * ===== */
.ipost-cover-wrap {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  margin-top: var(--s-6);
}
.ipost-cover {
  border-radius: 16px;
  overflow: hidden; /* apenas para clip do border-radius */
  box-shadow:
    0 24px 80px rgba(0,0,0,0.35),
    0 8px 24px rgba(0,0,0,0.2),
    0 0 0 1px rgba(255,255,255,0.06);
}
.ipost-cover img {
  display: block;
  width: 100%;
  height: auto; /* respeita aspect ratio original da imagem */
  /* SEM object-fit, SEM max-height — imagem aparece 100% completa */
}

/* ===== BODY WRAPPER ===== */
.ipost-body-wrap {
  max-width: 740px;
  margin: 0 auto;
  padding: 80px var(--gutter) var(--s-8);
}
/* When there's a cover image, the body needs more top spacing */
.ipost-hero + .ipost-body-wrap {
  padding-top: var(--s-8);
}

/* Loading skeleton */
.ipost-body-loading {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: var(--s-7) 0;
}
.ipost-skeleton {
  height: 18px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--bg-soft) 0%, var(--bg-alt) 50%, var(--bg-soft) 100%);
  background-size: 200% 100%;
  animation: ipost-shimmer 1.6s ease-in-out infinite;
}
.ipost-skeleton.short { width: 60%; }
.ipost-skeleton.med { width: 80%; }
@keyframes ipost-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Error state */
.ipost-body-error {
  text-align: center;
  padding: var(--s-9) 0;
  color: var(--fg-muted);
  font-size: 16px;
}

/* ===== PROSE TYPOGRAPHY ===== */
.ipost-prose {
  font-size: 17px;
  line-height: 1.78;
  color: var(--fg);
  font-weight: 350;
}

/* Remove double spacing from > * + * since WP already adds margin */
.ipost-prose > * + * { margin-top: 0; }

/* ── Paragraphs ── */
.ipost-prose p,
.ipost-prose .wp-block-paragraph {
  margin: 0 0 1.5em;
}
/* Collapse WP's empty paragraphs */
.ipost-prose p:empty,
.ipost-prose .wp-block-paragraph:empty {
  display: none;
}
/* WP empty spacer paragraphs with inline margins */
.ipost-prose p[style*="margin-top:40px"],
.ipost-prose .wp-block-paragraph[style*="margin-top:40px"] {
  display: none;
}

/* First paragraph as lede/intro */
.ipost-prose > p:first-child,
.ipost-prose > .wp-block-paragraph:first-child {
  font-size: 19px;
  line-height: 1.65;
  color: var(--fg-muted);
  font-weight: 350;
}
.ipost-prose > p:first-child em {
  font-style: normal;
  color: var(--fg);
}

/* ── Headings ── */
.ipost-prose h2,
.ipost-prose .wp-block-heading {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 2.5em 0 0.8em;
  text-wrap: balance;
  padding-left: 18px;
  border-left: 3px solid var(--accent);
  color: var(--fg);
}
/* First heading doesn't need as much top margin */
.ipost-prose > h2:first-of-type,
.ipost-prose > .wp-block-heading:first-of-type {
  margin-top: 1.5em;
}
.ipost-prose h3 {
  font-size: 21px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: 2em 0 0.6em;
  border-left: none;
  padding-left: 0;
}
.ipost-prose h4 {
  font-size: 18px;
  font-weight: 500;
  margin: 1.5em 0 0.5em;
  border-left: none;
  padding-left: 0;
}

/* WP's vivid-purple-color mark (heading accents) — display naturally */
.ipost-prose .has-vivid-purple-color {
  color: inherit;
  background: none;
}
.ipost-prose mark {
  background: none;
}

/* ── Blockquotes ── */
.ipost-prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 24px;
  margin: 2em 0;
  font-size: clamp(19px, 1.8vw, 24px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--fg);
  font-style: italic;
}
.ipost-prose blockquote p { margin: 0; }
/* WP uses bold+italic paragraphs as "quotes" sometimes */
.ipost-prose > p > strong > em,
.ipost-prose > .wp-block-paragraph > strong > em {
  font-style: italic;
  color: var(--fg-muted);
  font-weight: 400;
}

/* ── Images ── */
.ipost-prose img {
  width: 100%;
  border-radius: 12px;
  margin: 1.5em 0;
  display: block;
}
.ipost-prose .wp-block-image {
  margin: 2em 0;
}
.ipost-prose .wp-block-image img {
  border-radius: 12px;
  margin: 0;
}

/* ── Figures + captions ── */
.ipost-prose figure,
.ipost-prose .wp-block-table {
  margin: 2em 0;
}
.ipost-prose figure img { margin: 0; }
.ipost-prose figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--fg-faint);
  margin-top: 10px;
  font-style: italic;
}

/* ── Lists ── */
.ipost-prose ul,
.ipost-prose ol,
.ipost-prose .wp-block-list {
  padding-left: 24px;
  margin: 0 0 1.5em;
}
.ipost-prose li {
  margin-bottom: 12px;
  padding-left: 4px;
}
.ipost-prose ul li::marker {
  color: var(--accent);
}
.ipost-prose ol li::marker {
  color: var(--accent);
  font-weight: 600;
}

/* ── Links ── */
.ipost-prose a {
  color: var(--primary-hi);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--primary-hi) 40%, transparent);
  transition: all var(--t-fast);
}
.ipost-prose a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ── Code (inline) ── */
.ipost-prose code {
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: var(--font-mono);
}

/* ── Code blocks ── */
.ipost-prose pre {
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: var(--s-5);
  overflow-x: auto;
  margin: 2em 0;
  font-size: 14px;
  line-height: 1.6;
}
.ipost-prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

/* ── Tables ── */
.ipost-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 15px;
  border-radius: 8px;
  overflow: hidden;
}
.ipost-prose table.has-fixed-layout {
  table-layout: fixed;
}
.ipost-prose th,
.ipost-prose td {
  padding: 14px 18px;
  border: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.ipost-prose th,
.ipost-prose tr:first-child td {
  background: var(--bg-soft);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--fg);
}
.ipost-prose tbody tr:nth-child(even) {
  background: var(--bg-alt);
}
.ipost-prose tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 5%, var(--bg));
}

/* ── Strong ── */
.ipost-prose strong { font-weight: 550; }

/* ── Horizontal rule ── */
.ipost-prose hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5em 0;
}

/* ── Takeaway callout ── */
.ipost-prose .takeaway {
  background: var(--bg-alt);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-2);
  padding: var(--s-5);
  margin: 2em 0;
}
.ipost-prose .takeaway strong {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}
.ipost-prose .takeaway p { margin: 0; font-size: 17px; }

/* ===== READING PROGRESS BAR ===== */
.ipost-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 9999;
  transition: width 80ms linear;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 50%, transparent);
}

/* ===== SHARE + TAGS ===== */
.ipost-share-tags {
  max-width: 740px;
  margin: 0 auto;
  padding: 0 var(--gutter) var(--s-8);
  position: relative;
}
.ipost-share-tags-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: var(--s-6);
  border-top: 1px solid var(--rule);
}
.ipost-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ipost-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--rule-strong);
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  transition: all var(--t-fast);
}
.ipost-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.ipost-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  border: 1px solid var(--rule-strong);
  background: transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
}
.ipost-share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.ipost-share-btn svg { width: 14px; height: 14px; }

/* Toast notification */
.ipost-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  background: var(--black-rock);
  color: #fff;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.1);
  animation: ipost-toast-in 0.4s cubic-bezier(0.16, 1, 0.3, 1), ipost-toast-out 0.4s ease 2.6s forwards;
  white-space: nowrap;
}
.ipost-toast svg { color: var(--accent); flex-shrink: 0; }
@keyframes ipost-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes ipost-toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* ===== CTA SECTION ===== */
.ipost-cta {
  padding: var(--s-4) var(--gutter) var(--s-10);
}
.ipost-cta-card {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 20px;
  padding: clamp(40px, 5vw, 64px);
  text-align: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid transparent;
  background-clip: padding-box;
}
.ipost-cta-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 21px;
  background: linear-gradient(135deg,
    var(--primary-hi) 0%,
    var(--accent) 50%,
    var(--primary-hi) 100%);
  z-index: -2;
  opacity: 0.5;
}
.ipost-cta-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 19px;
  background: var(--bg);
  z-index: -1;
}
.ipost-cta-content { position: relative; z-index: 1; }
.ipost-cta h2 {
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}
.ipost-cta h2 .dot { width: 0.22em; height: 0.22em; }
.ipost-cta p {
  font-size: clamp(15px, 1.2vw, 18px);
  color: var(--fg-muted);
  max-width: 480px;
  margin: 0 auto var(--s-6);
  line-height: 1.55;
  font-weight: 300;
}
.ipost-cta .btn { display: inline-flex; }

/* ===== RESPONSIVE — 768px ===== */
@media (max-width: 768px) {
  .ipost-hero { padding-top: 120px; }
  .ipost-hero h1 {
    font-size: clamp(28px, 6.5vw, 40px);
  }
  .ipost-cover-wrap {
    padding: 0 var(--s-4);
  }
  .ipost-cover {
    border-radius: 12px;
  }
  .ipost-body-wrap {
    padding-top: 64px;
  }
  .ipost-prose h2,
  .ipost-prose .wp-block-heading {
    font-size: 22px;
    margin-top: 2em;
  }
  .ipost-prose h3 { font-size: 19px; }
  .ipost-prose blockquote {
    font-size: 17px;
    padding-left: 16px;
  }
  .ipost-prose table {
    font-size: 13px;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ipost-prose table.has-fixed-layout { table-layout: auto; }
  .ipost-prose th,
  .ipost-prose td {
    padding: 10px 12px;
  }
  .ipost-cta-card {
    padding: 32px 24px;
    border-radius: 16px;
  }
  .ipost-cta-card::before { border-radius: 17px; }
  .ipost-cta-card::after { border-radius: 15px; }
}

/* ===== RESPONSIVE — 600px ===== */
@media (max-width: 600px) {
  .ipost-hero { padding-top: 100px; }
  .ipost-hero-inner { padding-bottom: var(--s-6); }
  .ipost-meta-line { gap: 8px; font-size: 11px; }
  .ipost-excerpt { font-size: 16px; }
  .ipost-cover-wrap {
    padding: 0;
  }
  .ipost-cover { border-radius: 0; }
  .ipost-body-wrap { padding-top: 48px; }
  .ipost-prose { font-size: 16px; }
  .ipost-prose > p:first-child,
  .ipost-prose > .wp-block-paragraph:first-child { font-size: 17px; }
  .ipost-prose img {
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    width: calc(100% + var(--gutter) * 2);
    max-width: none;
    border-radius: 0;
  }
  .ipost-prose figure,
  .ipost-prose .wp-block-table {
    margin-left: calc(-1 * var(--gutter));
    margin-right: calc(-1 * var(--gutter));
    overflow-x: auto;
  }
  .ipost-prose figure img {
    width: 100%; max-width: none; margin: 0;
  }
  .ipost-share-tags-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== DARK THEME OVERRIDES ===== */
[data-theme="dark"] .ipost-prose { color: var(--fg); }
[data-theme="dark"] .ipost-prose a { color: var(--accent); }
[data-theme="dark"] .ipost-prose a:hover { color: var(--white); }
[data-theme="dark"] .ipost-prose code {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  color: var(--accent);
}
[data-theme="dark"] .ipost-prose pre {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .ipost-prose th,
[data-theme="dark"] .ipost-prose tr:first-child td {
  background: rgba(255,255,255,0.06);
}
[data-theme="dark"] .ipost-prose tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.03);
}
[data-theme="dark"] .ipost-prose blockquote {
  color: rgba(255,255,255,0.9);
}
[data-theme="dark"] .ipost-toast { background: var(--ebony-clay); }
[data-theme="dark"] .ipost-cta-card::after { background: var(--bg); }
[data-theme="dark"] .ipost-tag {
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.65);
}
[data-theme="dark"] .ipost-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}
[data-theme="dark"] .ipost-share-btn {
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
}
[data-theme="dark"] .ipost-share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== DYNAMIC ISLAND TOC =====
 * Floating pill at bottom of screen.
 * Shows current heading + reading progress.
 * Expands to full table of contents on click.
 * ===== */

/* Backdrop overlay */
.ditoc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.ditoc-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Wrapper */
.ditoc-wrap {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  z-index: 9999;
  opacity: 0;
  animation: ditoc-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards;
}
@keyframes ditoc-enter {
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Island container */
.ditoc-island {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--black-rock, #0e0b1a);
  color: #fff;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.4),
    0 4px 16px rgba(0,0,0,0.25);
  width: min(380px, calc(100vw - 32px));
  height: 56px;
  border-radius: 28px;
  cursor: pointer;
  transition:
    width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    border-radius 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.ditoc-island.expanded {
  width: min(580px, calc(100vw - 24px));
  height: auto;
  max-height: 520px;
  border-radius: 24px;
  cursor: default;
}

/* Closed pill content */
.ditoc-pill {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  transition:
    opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.ditoc-island.expanded .ditoc-pill {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

/* Active dot */
.ditoc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  flex-shrink: 0;
}

/* Current heading text */
.ditoc-current {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
}

/* Progress circle */
.ditoc-progress-svg {
  flex-shrink: 0;
  transform: rotate(-90deg);
}
.ditoc-progress-track {
  fill: none;
  stroke: rgba(255,255,255,0.15);
  stroke-width: 2.5;
}
.ditoc-progress-fill {
  fill: none;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.15s ease-out;
}

/* Expanded menu content */
.ditoc-menu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
  transition:
    opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.08s,
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.08s;
}
.ditoc-island.expanded .ditoc-menu {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* Menu header */
.ditoc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 10px;
  flex-shrink: 0;
}
.ditoc-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.ditoc-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.ditoc-close:hover {
  color: #fff;
}

/* Scrollable list */
.ditoc-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ditoc-list::-webkit-scrollbar {
  width: 4px;
}
.ditoc-list::-webkit-scrollbar-track {
  background: transparent;
}
.ditoc-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

/* Heading item */
.ditoc-item {
  display: flex;
  align-items: center;
  width: 100%;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease-out;
  flex-shrink: 0;
}
.ditoc-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
}
.ditoc-item:hover .ditoc-item-text {
  transform: translateX(3px);
}
.ditoc-item.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-weight: 500;
}

.ditoc-item-text {
  flex: 1;
  white-space: normal;
  word-break: break-word;
  transition: transform 0.25s ease-out;
}

/* Active dot in menu */
.ditoc-item-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  margin-left: 10px;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0);
  transition: all 0.25s ease-out;
}
.ditoc-item.active .ditoc-item-dot {
  opacity: 1;
  transform: scale(1);
}

/* Responsive */
@media (max-width: 600px) {
  .ditoc-island {
    width: 300px;
  }
  .ditoc-island.expanded {
    width: calc(100vw - 24px);
    max-width: 420px;
    height: auto;
    max-height: 440px;
  }
}

@media (max-width: 480px) {
  .ipost-hero { padding-top: 88px; }
  .ipost-toast { max-width: calc(100vw - 48px); white-space: normal; }
  .ipost-share-btn { min-width: 44px; min-height: 44px; }
}
