/* File: assets/feed.css */

/* ---------------------------
   Futuristic AI theme tokens
---------------------------- */
:root{
  --bg0:#070A12;
  --bg1:#0B1022;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.08);
  --stroke: rgba(255,255,255,.10);
  --stroke2: rgba(255,255,255,.14);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --muted2: rgba(255,255,255,.50);
  --brand:#7c3aed;     /* violet */
  --brand2:#22d3ee;    /* cyan */
  --brand3:#34d399;    /* green */
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --shadow2: 0 10px 30px rgba(0,0,0,.35);
  --radius: 16px;
  --radius2: 22px;
}

/* Base */
html, body{
  height:100%;
}
body{
  margin:0;
  color: var(--text);
  background:
    radial-gradient(1200px 900px at 10% 10%, rgba(124,58,237,.20), transparent 55%),
    radial-gradient(900px 700px at 95% 20%, rgba(34,211,238,.18), transparent 55%),
    radial-gradient(900px 700px at 60% 95%, rgba(52,211,153,.10), transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height:1.55;
}

/* Optional: make header area feel app-like (works with your existing header.php) */
header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10,12,22,.55) !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
}

header a{
  color: var(--text) !important;
}
header nav a{
  color: var(--muted) !important;
  padding: 8px 10px;
  border-radius: 999px;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
header nav a:hover{
  color: var(--text) !important;
  background: rgba(255,255,255,.08);
  transform: translateY(-1px);
}

/* page width + 3-column layout (Quora-ish) */
.feed-shell{
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 16px 28px;
  display: grid;
  grid-template-columns: 260px minmax(0, 660px) 300px;
  gap: 16px;
  align-items: start;
  position: relative;
}

/* IMPORTANT: allows columns to shrink (prevents overflow) */
.left, .center, .right{ min-width: 0; }

/* Subtle animated background glow layer */
.feed-shell::before{
  content:"";
  position: fixed;
  inset: -20vh -20vw;
  pointer-events:none;
  z-index: -1;
  background:
    radial-gradient(700px 500px at var(--mx, 40%) var(--my, 30%), rgba(124,58,237,.18), transparent 60%),
    radial-gradient(650px 480px at calc(var(--mx, 40%) + 35%) calc(var(--my, 30%) + 20%), rgba(34,211,238,.14), transparent 60%),
    radial-gradient(650px 520px at calc(var(--mx, 40%) - 30%) calc(var(--my, 30%) + 45%), rgba(52,211,153,.10), transparent 62%);
  filter: blur(0px);
  animation: floatGlow 9s ease-in-out infinite alternate;
}
@keyframes floatGlow{
  from{ transform: translate3d(0,0,0) scale(1); opacity: .85; }
  to{ transform: translate3d(0,-12px,0) scale(1.02); opacity: 1; }
}

/* Cards = glass */
.cardx{
  border: 1px solid var(--stroke);
  border-radius: var(--radius2);
  background: linear-gradient(180deg, var(--card), rgba(255,255,255,.03));
  box-shadow: var(--shadow2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Side cards */
.side-card{ padding: 14px; }
.side-title{
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing:.2px;
  display:flex;
  align-items:center;
  gap:8px;
}
.side-title::before{
  content:"";
  width:10px;height:10px;border-radius:999px;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 0 18px rgba(124,58,237,.35);
}

.side-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 10px;
  border-radius: 14px;
  text-decoration:none;
  color: var(--muted);
  border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.side-item:hover{
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
  transform: translateY(-1px);
}
.side-item:active{
  transform: translateY(0);
}
.side-sep{
  height:1px;
  background: rgba(255,255,255,.08);
  margin: 10px 0;
}

.tiny{ font-size:.86rem; }
.muted{ color: var(--muted); }
.dot{ margin:0 8px; color: rgba(255,255,255,.35); }

/* Composer */
.composer{ padding: 14px; }
.composer-top{
  display:flex;
  gap:12px;
  align-items:center;
}
.avatar{
  width:36px;height:36px;border-radius:999px;
  background: linear-gradient(135deg, rgba(124,58,237,.9), rgba(34,211,238,.85));
  box-shadow: 0 0 28px rgba(124,58,237,.25);
  flex:0 0 auto;
}
.avatar.sm{ width:30px; height:30px; }

.composer-input{
  width:100%;
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(0,0,0,.18);
  color: var(--text);
  outline: none;
}
.composer-input::placeholder{ color: rgba(255,255,255,.45); }

.composer-actions{
  display:flex;
  gap:10px;
  margin-top: 12px;
}
.pill{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.70);
  border-radius: 999px;
  padding: 9px 14px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.pill:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.22);
  color: var(--text);
  transform: translateY(-1px);
}

/* Post */
.post{ padding: 14px; }
.post-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.who{ display:flex; gap:10px; align-items:center; min-width:0; }
.who-meta{ min-width:0; }
.who-name{
  font-weight: 850;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.who-sub{
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  color: var(--muted2);
}

/* Close button (UI only) */
.xbtn{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  width: 34px; height: 34px;
  border-radius: 999px;
  cursor:not-allowed;
  color: rgba(255,255,255,.75);
}

/* Title */
.post-title{
  margin: 6px 0 8px;
  font-size: 18px;
  line-height:1.25;
  letter-spacing:.1px;
}
.post-title a{
  color: var(--accent);
  text-decoration: none;
}
.post-title a:hover{
  text-decoration:none;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  -webkit-background-clip:text;
  background-clip:text;
  color: transparent;
}



/* ✅ allow kebab dropdown to escape the card */
.cardx.post{ overflow: visible; }

.kebab{ position: relative; z-index: 50; }
.menu{ z-index: 99999; }


/* keep only the image clipped */
.post-media{ overflow: hidden; }

.post-media{
  margin-top: 10px;
  width: 100%;
  height: 420px;              /* consistent preview height like a feed */
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  overflow: hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Choose ONE behavior:
   A) “Fill container” (no empty space) -> object-fit: cover (can crop)
   B) “Show full image” (no crop) -> object-fit: contain (can show padding)

   Since you asked “fill the container no space”, we use COVER.
   Click still opens full image in lightbox.
*/
.post-media img{
  display:block;
  width: 100%;
  height: auto;
  max-height: 520px;     /* “portable”: not too tall */
  object-fit: contain;   /* shows full image (no crop) */
  background: #0b0b0b;
  cursor: zoom-in;
}
/* For very tall screenshots: keep it readable in-feed */
@media (min-width: 760px){
  .post-media img{ max-height: 560px; }
}
@media (max-width: 720px){
  .post-media img{ max-height: 420px; }
}

/* Footer */
.post-footer{
  display:flex;
  align-items:center;
  gap: 8px;
  margin-top: 10px;
}
.iconpill{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  cursor: not-allowed;
  transition: transform .12s ease;
}

.iconpill:active{ transform: scale(.98); }

/* Right column ad box */
.adbox{
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: 16px;
  padding: 12px;
  color: rgba(255,255,255,.60);
  background: rgba(0,0,0,.16);
}

/* Lightbox */
.img-lightbox{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.78);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 99999;
}
.img-lightbox.open{ display:flex; }
.img-lightbox img{
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}
.img-lightbox .close{
  position:absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.90);
  cursor:pointer;
  font-size: 22px;
  line-height: 1;
  backdrop-filter: blur(10px);
}

/* Responsive */
@media (max-width: 1100px){
  .feed-shell{ grid-template-columns: 240px minmax(0, 1fr); }
  .right{ display:none; }
}
@media (max-width: 780px){
  .feed-shell{ grid-template-columns: 1fr; }
  .left, .right{ display:none; }
  .post-media{ height: 360px; }
}

/* ================================
   POST SIZE (match your white screenshot)
   Paste at very bottom of feed.css
   ================================ */

/* Center column: keep a nice app-like width */
.feed-shell{
  grid-template-columns: 260px minmax(0, 720px) 300px; /* slightly wider center like the white version */
}



/* Post padding like the white screenshot */
.center .post{
  padding: 14px 14px 12px;
}

/* Title spacing */
.center .post-title{
  margin: 10px 0 10px;
  font-size: 20px;
  line-height: 1.25;
}

/* MEDIA BOX: the main thing you want */
.center .post-media{
  margin-top: 10px;
  border-radius: 18px;
  overflow: hidden;

  /* This is what makes it feel like the white screenshot */
  height: 520px;            /* ✅ “post size” feeling */
  background: #0b0f16;      /* dark neutral behind images */
  border: 1px solid rgba(255,255,255,.08);
}

/* Image fills the box nicely without distortion */
.center .post-media img{
  width: 100%;
  height: 100%;
  display: block;

  /* Use contain so NOTHING is cropped (like Quora preview shows full image) */
  object-fit: contain;
}

/* Footer spacing */
.center .post-footer{
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* Responsive: keep the same “white screenshot” feel on smaller screens */
@media (max-width: 760px){
  .feed-shell{
    grid-template-columns: 1fr; /* your existing collapse behavior */
  }

  

  .center .post-media{
    height: 420px; /* smaller but same style */
    border-radius: 16px;
  }
}

/* ✅ Force readable text inside the compose modals */
#askModalOverlay,
#answerModalOverlay{
  color:#111;
}

#askEditor,
#answerEditor{
  color:#111 !important;
  caret-color:#111 !important;
  -webkit-text-fill-color:#111 !important; /* fixes “invisible text” on some styles */
  opacity:1 !important;
  font-size:16px;
  line-height:1.6;
  white-space:pre-wrap;
  word-break:break-word;
}

/* If your theme applies filters/blend modes globally, neutralize them here */
#askEditor *,
#answerEditor *{
  color:#111 !important;
  -webkit-text-fill-color:#111 !important;
  mix-blend-mode:normal !important;
  filter:none !important;
  opacity:1 !important;
}

/* Quora-like excerpt under title */
.post-excerpt{
  margin-top: 6px;
  line-height: 1.55;
  opacity: .9;

  /* clamp like Quora */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.post-more{
  margin-left: 6px;
  text-decoration: none;
  opacity: .9;
}
.post-more:hover{
  text-decoration: underline;
}

/* --- Quora-like upvote pill --- */
.answer-meta{
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.vote-pill-wrap{ display:flex; align-items:center; }

.vote-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.88);
  cursor: pointer;
  user-select: none;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  font-weight: 600;
  line-height: 1;
}

.vote-pill:active{ transform: scale(0.98); }

.vote-icon{
  font-size: 14px;
  transform: translateY(-1px);
  opacity: .9;
}

.vote-dot{ opacity: .45; }

.vote-count{
  font-variant-numeric: tabular-nums;
  opacity: .95;
}

/* “Upvoted” state */
.vote-pill.is-on{
  background: rgba(60, 160, 255, .20);
  border-color: rgba(60, 160, 255, .55);
  color: #d9efff;
  box-shadow: 0 0 0 3px rgba(60,160,255,.12);
}

/* Optional: hover polish */
.vote-pill:hover{
  background: rgba(255,255,255,.09);
  border-color: rgba(255,255,255,.20);
}

.vote-pill.is-on:hover{
  background: rgba(60, 160, 255, .26);
}

/* right-side meta */
.meta-right{ color: rgba(255,255,255,.70); font-size: .92rem; }
.meta-sep{ margin: 0 8px; opacity:.5; }

/* --- Feed footer: Quora-like pill --- */
.post-footer{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:12px;
}

.q-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color:rgba(255,255,255,.90);
  font-size:13px;
  line-height:1;
}

.q-pill-icon{
  width:22px;
  height:22px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.12);
  font-size:12px;
}

.q-pill-text{ opacity:.85; }
.q-pill-count{ font-weight:700; }

.q-open{
  color:rgba(255,255,255,.85);
  text-decoration:none;
  font-size:13px;
}
.q-open:hover{ text-decoration:underline; }

.dot{ color:rgba(255,255,255,.30); }

/* Make the pill ACT like a link/button */
.q-pill{
  cursor: pointer;
  text-decoration: none;
}

.q-pill:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
}

.q-pill:focus-visible{
  outline: 2px solid rgba(34,211,238,.55);
  outline-offset: 3px;
}

.brand-link{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
}

.brand-logo{
  width:34px;
  height:34px;
  border-radius:999px;
  object-fit:cover;
  box-shadow: 0 0 22px rgba(124,58,237,.25);
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
}

.brand-text{
  font-weight:800;
  color: rgba(255,255,255,.92);
  letter-spacing:.2px;
}

.brand-badge{
  width:34px;
  height:34px;
  border-radius:999px;
  object-fit:cover;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  box-shadow: 0 0 22px rgba(124,58,237,.25);
}

.brand-link{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color: inherit;
}

.brand-logo{
  width:34px;
  height:34px;
  border-radius:999px;
  object-fit:cover;
  box-shadow: 0 0 22px rgba(124,58,237,.25);
}

.brand-text{
  font-weight:800;
  letter-spacing:.2px;
}

.brand-link{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  color: inherit;
}

.brand-logo{
  width:34px;
  height:34px;
  border-radius:999px;
  object-fit:cover;
}

.brand-text{
  font-weight:800;
  letter-spacing:.2px;
}


/* Avatar can contain your logo image */
.avatar{
  overflow: hidden;            /* important for round crop */
}

.avatar img{
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 999px;
  object-fit: cover;
}

.avatar{
  background: transparent;
  box-shadow: 0 0 28px rgba(124,58,237,.25);
}

/* --- 3-dot menu (Quora-ish) --- */
.kebab{
  position: relative;
  flex: 0 0 auto;
}

.kebab-btn{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.kebab-btn:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
}

.menu{
  position: absolute;
  top: 44px;
  right: 0;
  min-width: 220px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(14,18,30,.92);
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
}

.menu-item{
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,.90);
  text-decoration: none;
  cursor: pointer;
  display: block;
  font-size: 14px;
}

.menu-item:hover{
  background: rgba(255,255,255,.08);
}

.menu-item.danger{
  color: #ffb4b4;
}
.menu-item.danger:hover{
  background: rgba(255, 80, 80, .12);
}

/* optional: answer header row layout */
.answer-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.avatar{ overflow:hidden; }
.avatar img{
  width:100%;
  height:100%;
  display:block;
  object-fit: cover;
}

.side-lang .lang-btn{
  width:100%;
  text-align:left;
  background: transparent;
}

.side-lang .chev{
  margin-left:auto;
  opacity:.8;
}

.lang-menu{
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* =========================
   CENTER COLUMN SPACING (FIXED)
   ========================= */

.center{
  display: flex;
  flex-direction: column;
  gap: 22px;                 /* ✅ space between posts */
}

/* don’t kill margins with !important (it removes the visible separation) */
.center > .composer,
.center > .cardx{
  margin: 0;
}

/* add a little “breathing room” so footer + next header never touch */
.center > .cardx.post{
  margin: 0;
  padding-bottom: 6px;       /* subtle separation inside card */
}

/* optional: make the gap more obvious visually */
.center > .cardx.post + .cardx.post{
  margin-top: 6px;           /* extra space on top of every post after the first */
}


/* add a tiny separation glow so cards don't visually merge */
.center > .cardx.post{
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

/* =========================
   HARD GUARANTEED FEED SPACING
   ========================= */

/* Don’t rely on gap — add spacing between direct children */
.center{
  display: block !important;   /* override anything else */
}

/* remove any margins that could collapse weirdly */
.center > *{
  margin: 0 !important;
}

/* ✅ add spacing between every block inside center */
.center > * + *{
  margin-top: 22px !important;
}

/* ===================================
   FEED SPACING (Quora-like)
   Put this at the VERY BOTTOM
   =================================== */

/* Space under the composer */
.center .composer{
  margin: 0 auto 14px auto !important;
}

/* Space between each post card */
.center .cardx.post{
  margin: 0 auto 14px auto !important;   /* <- this is the gap */
}

/* Optional: keep last one tight */
.center .cardx.post:last-child{
  margin-bottom: 0 !important;
}

/* Make q-pill work as a real button */
.q-pill{
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.90);
  font: inherit;
}

/* Upvoted state (blue) */
.q-pill.is-on{
  background: rgba(60, 160, 255, .20);
  border-color: rgba(60, 160, 255, .55);
  color: #d9efff;
  box-shadow: 0 0 0 3px rgba(60,160,255,.12);
}

/* Disabled (no answers yet) */
.q-pill.is-disabled,
.q-pill:disabled{
  opacity: .45;
  cursor: not-allowed;
}


/* ✅ Make <button class="side-item ..."> look exactly like the <a class="side-item"> links */
button.side-item{
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font: inherit;
  width: 100%;
  text-align: left;
  padding: 10px 10px;
  border-radius: 14px;
  cursor: pointer;
}

/* keep same hover behavior as links */
button.side-item:hover{
  color: var(--text);
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
  transform: translateY(-1px);
}

button.side-item:active{ transform: translateY(0); }

.menu[hidden]{ display:none; }
