
:root {
  --bg: #0f0f0f;
  --fg: #e8e8e8;
  --muted: #888;
  --accent: #58a6ff;
  --card-bg: #1a1a1a;
  --border: #2a2a2a;
  --tag-bg: #243140;
  --tag-fg: #79c0ff;
  --shared-bg: #1a2030;
  --shared-fg: #79c0ff;
  --persp-a-bg: #1c2a1c;
  --persp-a-fg: #7ee787;
  --persp-b-bg: #2a1f2a;
  --persp-b-fg: #d2a8ff;
  --confirms-bg: #1a2030;
  --confirms-fg: #79c0ff;
  --fact-bg: #2a1f1a;
  --fact-fg: #ffa657;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
header { border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1.2rem; }
h1 { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; }
h1 a { color: var(--fg); text-decoration: none; }
.subtitle { color: var(--muted); font-size: 0.95rem; margin-top: 0.3rem; }
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--accent); }
.card h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.card h2 a { color: var(--fg); text-decoration: none; }
.card .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.7rem; }
.card .tldr { color: var(--fg); font-size: 0.95rem; }
.card .stats { display: flex; gap: 1rem; margin-top: 0.7rem; font-size: 0.8rem; color: var(--muted); }
.card .stats .pol { color: var(--accent); }
.post {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
}
.post h2 {
  font-size: 1.4rem;
  margin: 1.5rem 0 0.6rem;
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}
.post h2:first-of-type { border-top: 0; padding-top: 0; }
.post h3 { font-size: 1.05rem; margin: 1rem 0 0.5rem; }
.post p { margin-bottom: 0.9rem; }
.post ul { margin: 0.5rem 0 1rem 1.5rem; }
.post li { margin-bottom: 0.3rem; }
.post ul li::marker { color: var(--muted); }
.back { display: inline-block; margin-bottom: 1.5rem; color: var(--accent); text-decoration: none; font-size: 0.9rem; }
.back:hover { text-decoration: underline; }

/* Shared colored blocks (Общие факты, Подтверждается, Факты) */
.interp-label { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0.6rem 0 0.3rem; font-weight: 600; }
.shared-block {
  margin: 0.6rem 0;
  padding: 0.5rem 0.7rem 0.55rem;
  border-radius: 6px;
  background: var(--shared-bg);
  border-left: 3px solid var(--accent);
}
.shared-block h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--shared-fg);
  margin: 0 0 0.25rem;
}
.shared-block p { margin-bottom: 0.25rem; font-size: 0.92rem; }
.shared-block p:last-child { margin-bottom: 0; }
.shared-block ul { margin: 0.2rem 0 0.1rem 1.2rem; }
.shared-block li { font-size: 0.9rem; margin-bottom: 0.15rem; }

/* Side-by-side interpretations */
.interpretations-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
.interpretation {
  padding: 1rem 1.2rem;
  border-radius: 8px;
  min-width: 0;
}
.interpretation.a {
  background: var(--persp-a-bg);
  border-left: 3px solid var(--persp-a-fg);
}
.interpretation.b {
  background: var(--persp-b-bg);
  border-left: 3px solid var(--persp-b-fg);
}
.interpretation .src {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  color: inherit;
}
.interpretation.a .src { color: var(--persp-a-fg); }
.interpretation.b .src { color: var(--persp-b-fg); }

@media (max-width: 700px) {
  /* Mobile: split with snap — tap to expand one panel, see the other as a thin tab */
  .interpretations-grid {
    display: block;
    position: relative;
    height: 360px;
    overflow: hidden;
    margin: 0.5rem 0;
    touch-action: manipulation;
  }
  /* Split mode (default): both panels 50%, peeking from edges */
  .interpretation {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 0.6rem;
    overflow: visible;
  }
  .interpretation.a {
    left: 0;
    transform: translateX(-25%);
  }
  .interpretation.b {
    right: 0;
    transform: translateX(25%);
  }
  /* Expanded: clicked panel takes ~92%, other collapses to a slim 8% tab */
  .interpretation.a.expanded {
    width: calc(100% - 32px);
    transform: translateX(0);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .interpretation.b.expanded {
    width: calc(100% - 32px);
    transform: translateX(-32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Collapsed: shrunk into a slim tab on the opposite side */
  .interpretation.a.collapsed {
    width: 32px;
    transform: translateX(0);
    overflow: hidden;
    cursor: pointer;
    padding: 0.4rem 0.2rem;
  }
  .interpretation.b.collapsed {
    width: 32px;
    transform: translateX(-100%);
    overflow: hidden;
    cursor: pointer;
    padding: 0.4rem 0.2rem;
  }
  /* Collapsed tab styling: hide most text, show vertical short label */
  .interpretation.collapsed .src {
    font-size: 0;
    margin-bottom: 0;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
  }
  .interpretation.collapsed .src::after {
    content: attr(data-short);
    font-size: 0.7rem;
    font-weight: 600;
    color: inherit;
    letter-spacing: 0.05em;
  }
  .interpretation.collapsed .body { display: none; }
  .interpretation.collapsed .expand-arrow {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
  }
  .interpretation:not(.collapsed) .expand-arrow { display: none; }
  /* Center divider only in split mode (no .expanded class on grid) */
  .interpretations-grid:not(.expanded)::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 10%;
    height: 80%;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--accent), transparent);
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
    opacity: 0.4;
  }
  .interpretations-grid.expanded::before { display: none; }
  /* Smaller src heading inside split panels */
  .interpretations-grid:not(.expanded) .interpretation:not(.collapsed) .src { font-size: 0.85rem; margin-bottom: 0.3rem; }
  .interpretations-grid:not(.expanded) .interpretation:not(.collapsed) .body { font-size: 0.85rem; line-height: 1.4; }
}

.shared-block {
  background: var(--shared-bg);
  border-left: 3px solid var(--shared-fg);
  padding: 0.9rem 1.2rem;
  border-radius: 0 6px 6px 0;
  margin: 1rem 0;
}
.shared-block.confirms { background: var(--confirms-bg); border-left-color: var(--confirms-fg); }

.facts { background: var(--fact-bg); border-left: 3px solid var(--fact-fg); padding: 0.9rem 1.2rem; border-radius: 0 6px 6px 0; margin: 1rem 0; }
.facts h2 { border-top: 0; padding-top: 0; color: var(--fact-fg); }

.sources { color: var(--muted); font-size: 0.85rem; margin-top: 1.5rem; }
.sources a { color: var(--accent); }
.tag { display: inline-block; background: var(--tag-bg); color: var(--tag-fg); padding: 0.15rem 0.55rem; border-radius: 12px; font-size: 0.75rem; margin-right: 0.3rem; }
.muted { color: var(--muted); font-size: 0.85rem; }
