/* ══════════════════════════════════════════════════════
   main-screen.css — Cream paper + ink-doodle redesign
   Matches startup-screen.css so the site reads as ONE.
   ══════════════════════════════════════════════════════ */

* { box-sizing: border-box; }

/* overflow-x: clip (not hidden) — `hidden` makes the element a
   scroll container, which breaks `position: sticky` for descendants
   (left sidebar, right widgets). `clip` hides overflow without
   creating that scroll context. */
html { scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

:root {
  /* ── Paper palette ── */
  --paper:    #f4ead6;
  --paper-2:  #ecddbe;
  --paper-3:  #e6d2ad;

  /* ── Ink ── */
  --ink:       #1a1410;
  --ink-soft:  #4a3f37;
  --ink-mid:   #6e5f53;
  --ink-light: #8a7a6e;

  /* ── Accent ── */
  --accent:    #c89456;
  --accent-2:  #d6533c;
  --accent-3:  #6d8268;

  /* ── Lines ── */
  --line:      rgba(26, 20, 16, 0.18);
  --line-soft: rgba(26, 20, 16, 0.10);

  /* legacy surface tokens */
  --bg-1: var(--paper); --bg-2: var(--paper); --bg-3: var(--paper-2); --bg-4: var(--paper);
  --surface-nav:     rgba(244, 234, 214, 0.68);
  --surface-card:    rgba(255, 252, 245, 0.92);
  --surface-sidebar: rgba(255, 252, 245, 0.78);
  --surface-widget:  rgba(255, 252, 245, 0.78);
  --surface-menu:    rgba(255, 252, 245, 0.97);
  --surface-modal:   rgba(255, 252, 245, 0.97);
  --surface-input:   #fffaf0;
  --surface-footer:  rgba(244, 234, 214, 0.85);
  --border-glass:    rgba(26, 20, 16, 0.10);
  --border-nav:      rgba(26, 20, 16, 0.10);
  --border-subtle:   rgba(26, 20, 16, 0.10);
  --border-divider:  rgba(26, 20, 16, 0.10);
  --border-footer:   rgba(26, 20, 16, 0.10);
  --text-light:      var(--ink-light);
  --text-mid:        var(--ink-soft);
  --text-mid-light:  var(--ink-mid);
  --text-dark:       var(--ink);
  --charcoal:        var(--ink);
  --color-danger:    #c0392b;
  --color-rose:      #c97c8c;
  --color-success:   #6d8268;
  --pil-active:      #e1d5b9;
  --accent-warm:     #d6b58a;
}

body {
  margin: 0;
  font-family: "Ubuntu", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: var(--paper);
  overflow-x: clip;
  width: 100%;
}

/* Subtle paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  filter: url(#noise);
  mix-blend-mode: multiply;
  opacity: 0.45;
}

a { color: inherit; text-decoration: none; }

.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

.icon { display: block; }

/* ══════════════════════════════════════════════════════
   NAVBAR — identical to startup-page
   ══════════════════════════════════════════════════════ */
.top-info {
  display: flex;
  align-items: center;
  padding: 13px 38px;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  z-index: 100;
  background: rgba(244, 234, 214, 0.68);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border-bottom: 1px solid var(--line-soft);
  animation: slideDown 0.6s ease-out;
  transition: padding 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
              background 0.35s ease;
}
.top-info.is-scrolled {
  padding: 9px 38px;
  background: rgba(244, 234, 214, 0.85);
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.logo {
  font-weight: 700;
  font-size: 26px;
  white-space: nowrap;
  color: var(--ink);
  margin-right: auto;
  letter-spacing: -0.015em;
  position: relative;
  transition: letter-spacing 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.logo:hover { letter-spacing: 0.04em; transform: translateY(-1px); }
.logo::after {
  content: "*";
  display: inline-block;
  margin-left: 4px;
  color: var(--accent-2);
  font-size: 16px;
  vertical-align: super;
  font-weight: 400;
  transform: rotate(-12deg);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.logo:hover::after { transform: rotate(12deg) scale(1.2); }

.nav { display: flex; gap: 2px; margin-left: auto; align-items: center; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px 9px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mid);
  border-radius: 0;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  transition: color 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  position: relative;
  background: none;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 16px; right: 12px; bottom: 4px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(0.6,0,0.2,1);
}
.nav-link::before {
  content: "";
  position: absolute;
  top: 50%; left: 6px;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--accent-2);
  transform: translateY(-50%) scale(0);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-link:hover { color: var(--ink); transform: translateY(-1px); }
.nav-link:hover::after  { transform: scaleX(1); }
.nav-link:hover::before { transform: translateY(-50%) scale(1); }

.nav-link .icon {
  width: 17px; height: 17px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-link:hover .icon { transform: rotate(-8deg) scale(1.1); }

.nav-link--stack { flex-direction: row; }

/* Hamburger menu trigger — pill style */
.main-menu-dropdown { position: relative; margin-left: 8px; }
.main-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
}
.main-menu-trigger:hover { transform: translateY(-1px); background: var(--accent-2); }
.main-menu-trigger .icon { width: 18px; height: 18px; color: var(--paper); }

.main-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  list-style: none;
  margin: 0;
  padding: 8px;
  background: var(--surface-menu);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px -10px rgba(26,20,16,0.18), 0 2px 6px rgba(26,20,16,0.05);
  min-width: 220px;
  display: none;
}
.main-menu-panel.is-open { display: block; }
.mmenu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.25s ease;
}
.mmenu-item:hover { background: var(--paper-2); color: var(--ink); transform: translateX(2px); }
.mmenu-item .icon, .mmenu-item svg { width: 16px; height: 16px; }
.mmenu-divider { height: 1px; background: var(--line-soft); margin: 6px 4px; list-style: none; }

/* ══════════════════════════════════════════════════════
   MAIN GRID
   ══════════════════════════════════════════════════════ */
.main-main {
  display: grid;
  grid-template-columns: 270px 1fr 310px;
  max-width: 1500px;
  margin: 0 auto;
  gap: 28px;
  padding: 104px 28px 48px;
  flex: 1;
  position: relative;
}

/* ══════════════════════════════════════════════════════
   SIDEBAR — left, paper card
   ══════════════════════════════════════════════════════ */
.sidebar {
  position: sticky;
  top: 92px;
  height: fit-content;
  background: var(--surface-sidebar);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px 18px 20px;
  box-shadow:
    0 1px 0 rgba(26,20,16,0.04),
    0 14px 32px -16px rgba(26,20,16,0.14);
  z-index: 1;
}

.sidebar-nav {
  display: flex; flex-direction: column; gap: 4px;
}

.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background 0.25s ease, color 0.25s ease, transform 0.3s cubic-bezier(0.2,0.7,0.2,1);
  position: relative;
  text-decoration: none;
}
.sidebar-item::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent-2);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform 0.3s ease;
  border-radius: 2px;
}
.sidebar-item:hover { background: rgba(247, 234, 184, 0.55); color: var(--ink); transform: translateX(2px); }
.sidebar-item.active { background: rgba(247, 234, 184, 0.75); color: var(--ink); font-weight: 600; }
.sidebar-item.active::before { transform: scaleY(1); }
.sidebar-item .icon { width: 18px; height: 18px; }

.sidebar-item.small {
  padding: 7px 14px;
  font-size: 13px;
}

.asidebar-divider {
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 8px);
  margin: 14px 4px;
  border: none;
}

.sidebar-top {
  font-family: "Ubuntu", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: var(--ink-light);
  padding: 4px 14px 8px;
  margin: 0;
  text-transform: uppercase;
}

.topic-span {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(26,20,16,0.10);
}
.topic-anxiety       { background: #d6533c; }
.topic-depression    { background: #7c6fa3; }
.topic-relationships { background: #c97c8c; }
.topic-grief         { background: #6d8268; }
.topic-burnout       { background: #c89456; }

.topic-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-light);
  background: rgba(255,252,245,0.6);
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 500;
}

.sidebar-more {
  width: 100%;
  padding: 6px 12px;
  margin-top: 6px;
  background: none;
  border: none;
  color: var(--ink-light);
  font-family: "Ubuntu", sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease;
  text-align: center;
}
.sidebar-more:hover { color: var(--ink-soft); }

.sidebar-create-post-button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 4px;
  padding: 11px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease;
  text-decoration: none;
  position: relative;
}
.sidebar-create-post-button:hover { transform: translateY(-1px); background: var(--accent-2); }
.sidebar-create-post-button .icon { width: 16px; height: 16px; color: var(--paper); }

/* ══════════════════════════════════════════════════════
   FEED HEAD
   ══════════════════════════════════════════════════════ */
.main-feed { min-width: 0; position: relative; }

.feed-head {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 20px;
  position: relative;
}
.feed-title {
  margin: 0;
  font-family: "Caveat", "Ubuntu", cursive;
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-transform: lowercase;
  line-height: 1.05;
  position: relative; /* anchors .feed-title-star */
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1;          /* text sits above the star */
}
.feed-title-eyebrow {
  display: block;
  font-family: "Ubuntu", sans-serif;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-light);
}

.feed-filter-actions {
  display: flex; gap: 8px;
}

.button-icon {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  height: 40px;
  background: var(--ink);
  border: none;
  border-radius: 999px;
  color: var(--paper);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s ease, transform 0.25s ease;
}
.button-icon:hover { background: var(--accent-2); transform: translateY(-1px); }
.button-icon .icon { width: 17px; height: 17px; }

/* Ghost variant — outline style for secondary action */
.button-icon--ghost {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--ink);
}
.button-icon--ghost:hover { background: var(--paper-2); border-color: var(--ink); }

/* ══════════════════════════════════════════════════════
   FILTER PANEL — paper card
   ══════════════════════════════════════════════════════ */
.filter-panel {
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 18px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.2,0.7,0.2,1), margin-bottom 0.3s ease;
  position: relative;
}
.filter-panel.is-open { max-height: 800px; }
.filters-container {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.search-bar:focus-within {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(214,83,60,0.12);
}
.search-icon { color: var(--ink-light); flex-shrink: 0; }
.search-input {
  flex: 1; min-width: 0;
  background: none; border: none; outline: none;
  font: inherit; color: var(--ink);
  font-size: 14px;
}
.search-input::placeholder { color: var(--ink-light); }
.search-clear {
  background: none; border: none;
  color: var(--ink-light);
  cursor: pointer;
  display: none;
  padding: 4px;
}
.search-clear.is-visible { display: inline-flex; }

.lang-strip { display: flex; flex-direction: column; gap: 8px; }
.lang-strip-label {
  font-family: "Ubuntu", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-light);
}
.lang-select-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lang-popular { display: flex; gap: 6px; flex-wrap: wrap; }
.lang-item input { display: none; }
.lang-pill {
  display: inline-flex; align-items: center;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.lang-pill:hover { transform: translateY(-1px) rotate(-1deg); background: var(--paper-3); }
.lang-pill.pill-active,
.lang-item input:checked + .lang-pill {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.lang-select-other {
  padding: 5px 10px;
  font-size: 12px;
  font: inherit;
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
}

.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-title {
  font-family: "Ubuntu", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-light);
}
.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.pill:hover { transform: translateY(-1px) rotate(-1.5deg); background: var(--paper-3); }
.pill.pill-active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.pill .icon { width: 14px; height: 14px; }

.filter-select {
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  background: var(--surface-input);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  align-self: flex-start;
}

/* ══════════════════════════════════════════════════════
   FEED + POST CARD
   ══════════════════════════════════════════════════════ */
.feed { display: flex; flex-direction: column; gap: 18px; }

.post-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 22px 22px 16px;
  box-shadow:
    0 1px 0 rgba(26,20,16,0.04),
    0 12px 24px -16px rgba(26,20,16,0.12);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  z-index: 1; /* above background doodles */
}
.post-card:hover {
  box-shadow:
    0 1px 0 rgba(26,20,16,0.04),
    0 18px 36px -16px rgba(26,20,16,0.20);
  transform: translateY(-0.9px);
}

.post-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.post-author-info { display: flex; gap: 10px; align-items: center; }
.post-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-light);
  flex-shrink: 0;
}
.post-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.post-include-info { display: flex; flex-direction: column; gap: 2px; }
.post-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.post-time {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px;
  color: var(--ink-light);
}
.post-time .icon { width: 12px; height: 12px; }

.post-actions-menu { position: relative; }
.post-menu-trigger,
.button-icon.post-menu-trigger {
  width: 32px; height: 32px;
  padding: 0;
  border-radius: 50%;
  background: none !important;
  border: 1px solid transparent !important;
  color: var(--ink-soft) !important;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  transform: none !important;
  font-size: 0;
}
.post-menu-trigger:hover,
.button-icon.post-menu-trigger:hover {
  background: rgba(26, 20, 16, 0.06) !important;
  border-color: transparent !important;
  color: var(--ink) !important;
  transform: none !important;
}
.post-menu-trigger .icon,
.button-icon.post-menu-trigger .icon,
.post-menu-trigger svg,
.button-icon.post-menu-trigger svg {
  width: 18px; height: 18px;
  fill: var(--ink-soft);
  color: var(--ink-soft);
  flex-shrink: 0;
}
.post-menu-down {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  list-style: none;
  margin: 0; padding: 6px;
  background: var(--surface-menu);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 190px;
  box-shadow:
    0 2px 8px rgba(26,20,16,0.08),
    0 18px 40px -10px rgba(26,20,16,0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 20;
}
.post-menu-down.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.post-menu-down button,
.post-menu-down a {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  color: #4a3f37;
  font: inherit;
  font-size: 13.5px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
  letter-spacing: 0.005em;
}
.post-menu-down button:hover,
.post-menu-down a:hover { background: rgba(244, 234, 214, 0.9); color: var(--ink); }
.post-menu-down .icon { width: 15px; height: 15px; flex-shrink: 0; }
.menu-item-danger { color: var(--color-danger) !important; }
.menu-item-danger:hover { background: rgba(192,57,43,0.08) !important; color: var(--color-danger) !important; }
.menu-item-report { color: var(--color-danger) !important; }
.menu-item-report .icon { color: var(--color-danger); }
.menu-item-report:hover { background: rgba(192,57,43,0.08) !important; color: var(--color-danger) !important; }
.post-menu-divider { height: 1px; background: rgba(26,20,16,0.10); margin: 5px 6px; list-style: none; }

.save-post-btn--saved { color: var(--accent-2) !important; font-weight: 700; }

.post-content { display: flex; flex-direction: column; gap: 8px; }
.post-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.post-title a { color: inherit; }
.post-title a:hover { color: var(--accent-2); }

.post-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  text-transform: lowercase;
}
.tag-lang { background: var(--paper-3); }
.tag-topic { background: rgba(214,83,60,0.10); color: var(--accent-2); border-color: rgba(214,83,60,0.18); }
.tag-no-advice { background: rgba(109,130,104,0.14); color: var(--accent-3); border-color: rgba(109,130,104,0.22); }
.tag-need-support { background: rgba(200,148,86,0.16); color: #8a5a20; border-color: rgba(200,148,86,0.30); }
.tag .icon { width: 11px; height: 11px; }

.post-preview {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.post-media-strip {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border-radius: 4px;
  overflow: hidden;
}
.post-media-strip--1 { grid-template-columns: 1fr; }
.post-media-strip--2 { grid-template-columns: 1fr 1fr; }
.post-media-strip--3,
.post-media-strip--4 { grid-template-columns: 1fr 1fr 1fr; }
.post-media-cell {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--paper-2);
  overflow: hidden;
}
.post-media-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-media-more {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26,20,16,0.55);
  color: var(--paper);
  font-size: 22px;
  font-weight: 700;
}

.post-actions {
  display: flex; gap: 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-soft);
}
.post-actions-item {
  display: inline-flex; align-items: center; gap: 6px;
  background: none;
  border: none;
  font: inherit;
  font-size: 13px;
  color: var(--ink-mid);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.25s ease, background 0.25s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.post-actions-item:hover { color: var(--accent-2); transform: translateY(-1px); background: rgba(214,83,60,0.06); }
.post-actions-item--active { color: var(--accent-2); font-weight: 600; }
.post-actions-item .icon { width: 16px; height: 16px; }
.action-stat { font-weight: 600; }
.action-title { letter-spacing: 0.01em; }

.feed-empty {
  padding: 60px 20px;
  text-align: center;
  font-family: "Caveat", cursive;
  font-size: 22px;
  color: var(--ink-light);
}

.loading-indicator {
  display: none;
  flex-direction: column; align-items: center; gap: 8px;
  padding: 24px 0;
  color: var(--ink-light);
  font-size: 13px;
}
.loading-indicator.is-visible { display: flex; }
.spinner {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent-2);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════
   RIGHT SIDEBAR — widgets
   ══════════════════════════════════════════════════════ */
.right-sidebar {
  /* align-self: start — without this the grid stretches the column
     to match the (very tall) post-feed sibling, which means the
     column's bottom is always far below the viewport and the
     "scrolled past column" check never fires. With `start` the
     column collapses to its natural content height (the 4 widgets). */
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* Same fix for the left sidebar so its sticky behaviour works as
   intended (it was already declared sticky higher up). */
.sidebar { align-self: start; }

/* Wrapper for the first two widgets (Crisis + AI support).
   At the top of the page it behaves like normal flow — all four
   right-column widgets render naturally, no overlap.
   Once the user has scrolled past the entire right column, JS
   adds .is-floating, which lifts the pair into a fixed panel
   anchored to the top-right with a soft fade-in. Scrolling back
   up removes the class before widgets 3+4 come into view, so
   nothing ever sits on top of anything. */
.right-sticky {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.right-sticky.is-floating {
  position: fixed;
  top: 92px;
  /* right + width + opacity + transform are driven by JS so the
     fade is tied directly to scroll progress — no CSS animation,
     no flicker at class-add, smooth in both directions. */
  z-index: 50;
  pointer-events: auto;
  will-change: opacity, transform;
}

.widget {
  position: relative;
  background: var(--surface-widget);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 18px;
  box-shadow:
    0 1px 0 rgba(26,20,16,0.04),
    0 10px 24px -14px rgba(26,20,16,0.14);
}

/* ── Crisis — urgent, stands out ── */
.widget.support {
  background: rgba(214, 83, 60, 0.05);
  border-color: rgba(214, 83, 60, 0.22);
}

/* ── AI support — clean, no tint ── */
.widget.support.ai {
  background: var(--surface-widget);
  border-color: var(--line);
}
.widget.support.ai .widget-title { color: var(--ink); }

/* ── Guidelines — same as other cards ── */
.widget.guidelines {
  background: var(--surface-widget);
  border-color: var(--line);
}

/* ── Statistics — clean ── */
.widget.statistic { background: var(--surface-widget); }

.widget-title {
  margin: 0 0 6px;
  font-family: "Ubuntu", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  letter-spacing: -0.005em;
}
/* Crisis widget keeps handwritten feel — it's personal */
.widget.support .widget-title {
  font-family: "Caveat", cursive;
  font-size: 22px;
  line-height: 1.1;
}
.widget-subtitle {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.widget-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: var(--accent-2);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.01em;
  transition: background 0.25s ease, transform 0.25s ease;
  text-decoration: none;
}
.widget-link:hover { background: var(--ink); transform: translateY(-1px); }

.widgetai-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: transparent;
  color: var(--accent-3);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  border: 1.5px solid var(--accent-3);
  letter-spacing: 0.01em;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
  text-decoration: none;
}
.widgetai-link:hover { background: var(--accent-3); color: var(--paper); transform: translateY(-1px); }
.widget-link .icon, .widgetai-link .icon { width: 16px; height: 16px; }

.widget-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.widget-list li {
  position: relative;
  padding-left: 20px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.widget-list li::before {
  content: "–";
  position: absolute;
  left: 0; top: 0;
  color: var(--ink-light);
  font-size: 12px;
}
.widget-link-guidelines {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: "Ubuntu", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-light);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.2s ease, gap 0.2s ease;
}
.widget-link-guidelines:hover { gap: 7px; color: var(--ink-soft); }

.statistic-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-soft);
  gap: 12px;
}
.statistic-row:last-child { border-bottom: none; }
.statistic-title { font-size: 13px; color: var(--ink-soft); }
.statistic-value {
  font-family: "Caveat", cursive;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
}

/* ══════════════════════════════════════════════════════
   ACTIVE LANG TAGS (filter chips shown on top of feed)
   ══════════════════════════════════════════════════════ */
.active-lang-tags {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin: -4px 0 14px;
}

/* ══════════════════════════════════════════════════════
   TOAST + DELETE MODAL
   ══════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  z-index: 1000;
  box-shadow: 0 14px 32px -10px rgba(26,20,16,0.40);
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.del-backdrop {
  position: fixed; inset: 0;
  background: rgba(26,20,16,0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 999;
}
.del-backdrop.is-open { display: flex; }
.del-modal {
  background: var(--surface-modal);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 28px 28px 24px;
  width: min(340px, calc(100% - 32px));
  text-align: center;
  position: relative;
  box-shadow: 0 30px 60px -20px rgba(26,20,16,0.30);
}
.del-icon-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(214,83,60,0.10);
  color: var(--accent-2);
  margin: 0 auto 12px;
}
.del-title {
  margin: 0 0 8px;
  font-family: "Ubuntu", sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.del-desc {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--ink-mid, var(--ink-soft));
  line-height: 1.5;
}
.del-actions { display: flex; gap: 10px; justify-content: center; }
.del-btn {
  padding: 9px 18px;
  font: inherit; font-size: 13px; font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--paper, var(--surface-input));
  color: var(--ink-soft);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), background 0.25s ease;
}
.del-btn--cancel:hover { background: var(--paper-2); transform: rotate(-1deg); }
.del-btn--confirm {
  background: var(--accent-2);
  color: var(--paper);
  border-color: var(--accent-2);
}
.del-btn--confirm:hover { transform: rotate(1deg) translateY(-1px); }

/* ══════════════════════════════════════════════════════
   DOODLES + PAPER NOTES (shared helpers)
   ══════════════════════════════════════════════════════ */
.d-img { display: block; mix-blend-mode: multiply; user-select: none; -webkit-user-drag: none; }

@keyframes dBob {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50%      { transform: translateY(-6px) rotate(var(--rot, 0deg)); }
}
.d-bob { animation: dBob 5.5s ease-in-out infinite; }

.paper-note {
  position: absolute;
  width: 150px;
  display: inline-flex; align-items: center; justify-content: center;
  pointer-events: none;
  font-family: "Caveat", cursive;
  color: var(--ink);
  z-index: 4;
}
.paper-note-bg {
  width: 100%; height: auto; display: block;
  mix-blend-mode: multiply;
}
.paper-note-text {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  transform: rotate(-3deg);
  padding: 12px;
}
.paper-note .skotch {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%) rotate(-4deg);
  width: 56px;
  mix-blend-mode: multiply;
  opacity: 0.9;
}

/* ══════════════════════════════════════════════════════
   PAGE-LEVEL BACKGROUND DOODLES — position:fixed, z-index 0
   Behind the grain, behind all content.
   ══════════════════════════════════════════════════════ */
.pg-doodle {
  position: fixed;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.11;
  z-index: 0;
  user-select: none;
  -webkit-user-drag: none;
}
/* Each doodle keeps a base rotation in --rot and floats around it */
/* Cloud — top left corner area */
.pg-doodle--1 {
  width: 120px; top: 14%; left: 1.5%;
  --rot: -8deg;
  transform: rotate(var(--rot));
  animation: pgFloatA 9s ease-in-out infinite;
}
/* Asterisk — mid left, well outside content */
.pg-doodle--2 {
  width: 64px; top: 52%; left: 0.8%;
  --rot: 14deg;
  transform: rotate(var(--rot));
  animation: pgSpin 14s ease-in-out infinite;
}
/* Heart — bottom right outside content */
.pg-doodle--3 {
  width: 68px; bottom: 18%; right: 1%;
  --rot: -6deg;
  transform: rotate(var(--rot));
  animation: pgFloatB 8s ease-in-out infinite;
}
/* Asterisk — top right */
.pg-doodle--4 {
  width: 52px; top: 22%; right: 1.2%;
  --rot: -18deg;
  transform: rotate(var(--rot));
  animation: pgSpin 12s ease-in-out infinite reverse;
}

/* ── Visible drift keyframes — calm but unmistakably moving ── */
@keyframes pgFloatA {
  0%, 100% { transform: rotate(var(--rot, 0deg))                translateY(0)     translateX(0); }
  50%      { transform: rotate(calc(var(--rot, 0deg) + 6deg))   translateY(-24px) translateX(10px); }
}
@keyframes pgFloatB {
  0%, 100% { transform: rotate(var(--rot, 0deg))                translateY(0)     translateX(0); }
  25%      { transform: rotate(calc(var(--rot, 0deg) - 4deg))   translateY(-12px) translateX(-10px); }
  75%      { transform: rotate(calc(var(--rot, 0deg) + 3deg))   translateY(-22px) translateX(6px); }
}
@keyframes pgSpin {
  0%, 100% { transform: rotate(calc(var(--rot, 0deg) - 12deg))  translateY(0); }
  50%      { transform: rotate(calc(var(--rot, 0deg) + 12deg))  translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
  .pg-doodle--1, .pg-doodle--2, .pg-doodle--3, .pg-doodle--4 { animation: none; }
}

/* Hide at small widths where they'd overlap the layout */
@media (max-width: 1180px) {
  .pg-doodle--1, .pg-doodle--2 { display: none; }
}
@media (max-width: 880px) {
  .pg-doodle { display: none; }
}

/* Ambient side doodles inside feed (only very wide screens) */
.main-doodle {
  position: absolute;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: 0.12;
  z-index: 0;
  user-select: none;
  -webkit-user-drag: none;
}
.main-doodle--b { width: 44px; top: 42%; left: -56px; transform: rotate(-5deg); }
.main-doodle--c { width: 34px; top: 70%; left: -48px; transform: rotate(10deg); }
@media (max-width: 1400px) {
  .main-doodle--b, .main-doodle--c { display: none; }
}

/* Star after "community feed" — inline accent like in the screenshot */
.feed-title-line {
  position: relative;
  display: inline-block;
}
.feed-title-star {
  display: inline-block;
  width: 22px; height: auto;
  mix-blend-mode: multiply;
  opacity: 0.80;
  vertical-align: middle;
  margin-left: 6px;
  transform: rotate(-8deg);
  position: relative;
  top: -4px;
}

/* ══════════════════════════════════════════════════════
   FOOTER — identical to startup-page
   ══════════════════════════════════════════════════════ */
.footer {
  background: var(--paper-2);
  border-top: 1.5px solid var(--ink);
  padding: 72px 40px 32px;
  position: relative;
  z-index: 3;
  color: var(--ink-soft);
}

.footer_content { max-width: 1280px; margin: 0 auto; }

.footer_main {
  display: flex;
  justify-content: space-between;
  gap: 64px;
  margin-bottom: 56px;
  flex-wrap: wrap;
}

.footer_stillhere { display: flex; flex-direction: column; gap: 8px; }

.footer_logo p {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.footer_subtitle {
  font-size: 13px;
  color: var(--ink-mid);
  max-width: 240px;
  line-height: 1.55;
  font-style: italic;
  margin: 0;
}

.footer_links {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
}

.footer_links h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  margin: 0 0 18px;
}

.footer_links ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer_links a {
  font-size: 14px;
  color: var(--ink-soft);
  transition: color 0.2s, transform 0.2s;
  display: inline-block;
  padding: 2px 0;
}
.footer_links a:hover { color: var(--accent-2); transform: translateX(3px); }

.footer_footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-mid);
  flex-wrap: wrap;
  gap: 16px;
}
.footer_footer p { margin: 0; }

/* ══════════════════════════════════════════════════════
   Constrain oversized user-uploaded images everywhere
   (feed cards + post detail + comments). Tall screenshots
   stay readable instead of dominating the layout.
   ══════════════════════════════════════════════════════ */
.post-card img,
.post-content img,
.post-body img,
.comment-card img,
.comment-body img,
.post-media-grid img,
.post-media-grid video {
  max-width: 100%;
  max-height: 500px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  margin: 10px auto;
}

/* Long-word break — prevent runaway text from expanding cards */
.post-card,
.post-content,
.post-body,
.comment-body,
.post-title {
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* Copyright + implicit-consent line, side-by-side on the same row */
.footer_legal {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.footer_legal > p:first-child { margin: 0; }
.implicit-consent {
  margin: 0;
  padding: 0;
  font-family: "Ubuntu", sans-serif;
  font-size: 10.5px;
  color: var(--ink-light);
  letter-spacing: 0.02em;
  line-height: 1.4;
  opacity: 0.72;
  transition: opacity 0.25s ease;
}
.implicit-consent:hover { opacity: 1; }
.implicit-consent a {
  color: var(--ink-mid);
  border-bottom: 1px dotted var(--line);
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
}
.implicit-consent a:hover {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
}

.footer_social { display: flex; gap: 14px; }

.footer_social a {
  color: var(--ink-mid);
  transition: color 0.2s, transform 0.2s;
  display: flex;
}
.footer_social a:hover { color: var(--accent-2); transform: translateY(-2px); }
.footer_social svg { width: 24px; height: 24px; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════ */
@media (max-width: 1180px) {
  .main-main { grid-template-columns: 1fr 300px; padding: 100px 22px 40px; gap: 22px; }
  .sidebar { display: none; }
  .bg-doodle--bl { display: none; }
}
@media (max-width: 880px) {
  .top-info { padding: 11px 18px; }
  .top-info.is-scrolled { padding: 8px 18px; }
  .nav-link span { display: none; }
  .nav-link { padding: 7px 9px; }
  .main-main { grid-template-columns: 1fr; padding: 96px 16px 32px; gap: 18px; }
  .right-sidebar { position: static; }
  .feed-title { font-size: 2rem; }
  .footer_main { grid-template-columns: 1fr; }
  .footer_links { grid-template-columns: 1fr 1fr; }
  .bg-doodle { display: none; }
  .note-feed--welcome, .note-feed--breathe { display: none; }
}
@media (max-width: 520px) {
  .post-card { padding: 18px 16px 14px; }
  .post-actions { gap: 10px; flex-wrap: wrap; }
  .footer_links { grid-template-columns: 1fr; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .d-bob { animation: none; }
  .post-card, .widget, .sidebar { transform: none !important; }
}
