/* ============================================================================
   Torus UI-Kit — Social Post
   Inline-visning av siste post fra et sosialt medium (Twitter/X, Mastodon,
   Bluesky, Instagram, Threads). Brukes i sidebar/aside for å vise hva
   en person eller institusjon har publisert sist på sin offentlige
   plattform.

   Markup:
     <a class="tw-social-post" href="https://x.com/.../status/..." target="_blank" rel="noopener">
       <header class="tw-social-post-head">
         <svg class="tw-social-post-icon" aria-hidden="true">…X-logo…</svg>
         <span class="tw-social-post-handle">@renate_fossdal</span>
         <time class="tw-social-post-time" datetime="2026-05-02T08:14">2t</time>
       </header>
       <p class="tw-social-post-text">«…tweet-tekst her…»</p>
       <footer class="tw-social-post-meta">
         <span>↺ 142</span>
         <span>♥ 2.1k</span>
       </footer>
     </a>

   Varianter (via plattform-modifier):
     .is-x          (default — X / Twitter)
     .is-mastodon
     .is-bluesky
     .is-instagram
     .is-threads
   ============================================================================ */

:root{
  --social-post-pad:var(--space-16);
  --social-post-radius:var(--radius-md);
  --social-post-bg:var(--surface-feature-bg);
  --social-post-border:1px solid var(--stroke-soft);
  --social-post-hover-bg:var(--list-hover-bg);
  --social-post-hover-border:1px solid var(--stroke-gentle);

  --social-post-icon-size:16px;
  --social-post-icon-color:var(--text-tertiary);

  --social-post-handle-family:var(--font-mono);
  --social-post-handle-size:11.5px;
  --social-post-handle-tracking:.04em;
  --social-post-handle-color:var(--text-tertiary);

  --social-post-time-family:var(--font-mono);
  --social-post-time-size:11px;
  --social-post-time-color:var(--text-tertiary);

  --social-post-text-family:var(--font-serif);
  --social-post-text-style:italic;
  --social-post-text-size:15px;
  --social-post-text-leading:1.5;
  --social-post-text-color:var(--text-primary);

  --social-post-meta-family:var(--font-mono);
  --social-post-meta-size:11px;
  --social-post-meta-color:var(--text-tertiary);
  --social-post-meta-gap:var(--space-12);
}

/* Dark mode: social-post-kortet brukte --surface-feature-bg (≈ #353535) som
   leste for lyst. Senk til container-flaten (≈ #2b2b2b) — fortsatt et tydelig
   hevet kort over arket, men mørkere. */
html.dark,
html[data-theme="dark"]{
  --social-post-bg:var(--surface-container-bg);
}
@media (prefers-color-scheme:dark){
  html:not([data-theme="light"]){
    --social-post-bg:var(--surface-container-bg);
  }
}

.tw-social-post{
  display:block;
  padding:var(--social-post-pad);
  background:var(--social-post-bg);
  border:var(--social-post-border);
  border-radius:var(--social-post-radius);
  text-decoration:none;
  color:inherit;
  transition:
    background var(--motion-fast) var(--ease-out),
    border-color var(--motion-fast) var(--ease-out);
}
.tw-social-post:hover{
  background:var(--social-post-hover-bg);
  border:var(--social-post-hover-border);
}

.tw-social-post-head{
  display:flex;
  align-items:center;
  gap:var(--space-8);
  margin-bottom:var(--space-8);
}

.tw-social-post-icon{
  width:var(--social-post-icon-size);
  height:var(--social-post-icon-size);
  fill:var(--social-post-icon-color);
  flex-shrink:0;
}

.tw-social-post-handle{
  font-family:var(--social-post-handle-family);
  font-size:var(--social-post-handle-size);
  letter-spacing:var(--social-post-handle-tracking);
  color:var(--social-post-handle-color);
  text-transform:lowercase;
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.tw-social-post-time{
  font-family:var(--social-post-time-family);
  font-size:var(--social-post-time-size);
  color:var(--social-post-time-color);
  flex-shrink:0;
}

.tw-social-post-text{
  font-family:var(--social-post-text-family);
  font-style:var(--social-post-text-style);
  font-size:var(--social-post-text-size);
  line-height:var(--social-post-text-leading);
  color:var(--social-post-text-color);
  margin:0;
}

.tw-social-post-meta{
  display:flex;
  gap:var(--social-post-meta-gap);
  margin-top:var(--space-12);
  padding-top:var(--space-12);
  border-top:1px dashed var(--hairline);
  font-family:var(--social-post-meta-family);
  font-size:var(--social-post-meta-size);
  color:var(--social-post-meta-color);
}

/* Plattform-modifiers — ikon-farge tunes per plattform om ønsket.
   Default er nøytral tertiary; bruk denne kun hvis brand-farge gir
   mening i konteksten. */
.tw-social-post.is-x        { --social-post-icon-color:var(--text-primary); }
.tw-social-post.is-bluesky  { --social-post-icon-color:#0085ff; }
.tw-social-post.is-mastodon { --social-post-icon-color:#6364ff; }
.tw-social-post.is-instagram{ --social-post-icon-color:#e4405f; }
.tw-social-post.is-threads  { --social-post-icon-color:var(--text-primary); }
