/* sq8-post.css — shared post card styles (Wave 6 foundation)
   Consumed by: hashtag.html, post.html, explore.html, and future pages.
   diwaniya.html still has these inline; migrate it last. */

/* ── Media grid ──────────────────────────────────────────────── */
.post-media-grid {
  display: grid; gap: 4px; margin-top: 10px; border-radius: 16px; overflow: hidden;
}
.post-media-grid.count-1 { grid-template-columns: 1fr; }
.post-media-grid.count-2 { grid-template-columns: 1fr 1fr; }
.post-media-grid.count-3 { grid-template-columns: 1fr 1fr; }
.post-media-grid.count-3 .post-media-item:first-child { grid-column: span 2; }
.post-media-grid.count-4 { grid-template-columns: 1fr 1fr; }
.post-media-item {
  position: relative; background: var(--slate); overflow: hidden; cursor: pointer;
}
.post-media-item img, .post-media-item video {
  width: 100%; height: 220px; object-fit: cover; display: block; transition: opacity 0.2s;
}
.post-media-item:hover img, .post-media-item:hover video { opacity: 0.92; }
.post-media-item audio { width: 100%; padding: 10px; }

/* ── Post card ───────────────────────────────────────────────── */
.dw-post {
  display: flex; gap: 12px; padding: 13px 16px;
  border-bottom: none; transition: background .2s ease; cursor: pointer; position: relative;
}
.dw-post::after {
  content: ''; position: absolute; inset-inline: 16px; bottom: 0; height: 1px;
  background: linear-gradient(to left, transparent, var(--line) 16%, var(--line) 84%, transparent);
}
.dw-post::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 14px; bottom: 14px;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--line) 28%, var(--line) 72%, transparent);
  border-radius: 2px; opacity: .4;
}
.dw-post:hover { background: rgba(255,255,255,0.018); }
body.light .dw-post:hover { background: rgba(0,0,0,0.018); }

.post-ava {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 16px;
  flex-shrink: 0; background: var(--slate); color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.12), 0 1px 3px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06); overflow: hidden;
}
.post-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.post-body { flex: 1; min-width: 0; padding-top: 2px; }
.post-meta {
  display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
  font-feature-settings: "tnum";
}
.post-name { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.post-handle { color: var(--mute); font-size: 13.5px; font-family: var(--font-en); opacity: .85; }
.post-time { color: var(--mute); font-size: 12.5px; font-family: var(--font-en); margin-inline-start: 2px; }
.post-creative-badge {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 2px;
  border-radius: 999px; border: 1px solid var(--line); font-size: 11px; font-weight: 600;
  color: var(--soft); text-decoration: none; font-family: var(--font-ar);
  transition: border-color .15s, color .15s; white-space: nowrap; vertical-align: middle; cursor: pointer;
}
.post-creative-badge:hover { border-color: rgba(255,255,255,.3); color: var(--white); }
.verified-badge {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--white); opacity: .85; flex-shrink: 0; vertical-align: middle;
  margin-inline-start: 2px; line-height: 1;
}
.post-text {
  font-size: 16px; line-height: 1.6; margin-top: 5px;
  word-break: break-word; color: var(--white);
}
body.light .post-text { color: #111; }
.post-mention, .post-hashtag {
  color: var(--soft); text-decoration: none; font-weight: 500; transition: color 0.15s;
}
.post-mention:hover, .post-hashtag:hover { color: var(--white); text-decoration: underline; }
.post-hashtag.active-tag { color: var(--white); font-weight: 700; }

/* ── Action bar ─────────────────────────────────────────────── */
.post-actions {
  display: flex; gap: 2px; margin-top: 8px; max-width: none;
  padding-top: 4px; border-top: 1px solid rgba(255,255,255,0.04); align-items: center;
}
body.light .post-actions { border-top-color: rgba(0,0,0,0.06); }
/* Share sits at the far inline-end; the rest cluster tight (X-style, denser). */
.post-actions .post-action:last-child { margin-inline-start: auto; }
.post-action {
  display: flex; align-items: center; gap: 5px; color: var(--mute); font-size: 13px;
  cursor: pointer; transition: all .15s ease; font-family: var(--font-en);
  flex: none; padding: 5px 9px; border-radius: 999px; text-decoration: none;
}
.post-action svg { width: 18px; height: 18px; flex-shrink: 0; border-radius: 50%; transition: all .15s ease; }
.post-action:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.post-action:hover svg { background: var(--accent-soft); color: var(--white); }
.post-action.on-like, .post-action.on-like svg { color: var(--white); }
.post-action.on-like svg { fill: var(--white); }
.post-action.on-repost, .post-action.on-repost svg { color: var(--white); }
.post-action.on-bookmark, .post-action.on-bookmark svg { color: var(--white); }
.post-action.on-bookmark svg { fill: var(--white); }

/* ── Post menu ──────────────────────────────────────────────── */
.post-menu-wrap { position: relative; margin-inline-start: auto; }
.post-menu-btn {
  background: none; border: none; color: var(--mute); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 4px;
  transition: color .15s, background .15s; font-family: var(--font-en);
}
.post-menu-btn:hover { color: var(--white); background: var(--char); }
.post-menu-dropdown {
  position: absolute; top: calc(100% + 4px); inset-inline-end: 0;
  background: var(--char); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; min-width: 160px; z-index: 200;
  display: none; box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.post-menu-dropdown.open { display: block; animation: menu-pop .14s ease; }
@keyframes menu-pop { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
.post-menu-dropdown button {
  width: 100%; text-align: start; background: none; border: none;
  color: var(--white); font-family: var(--font-ar); font-size: 13px;
  padding: 10px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: background .12s;
}
.post-menu-dropdown button:hover { background: var(--slate); }
.post-menu-dropdown button.danger { color: #e07070; }

/* ── Quote card ─────────────────────────────────────────────── */
.quote-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px;
  margin-top: 10px; cursor: pointer; transition: background .15s;
}
.quote-card:hover { background: var(--slate); }
.qc-header { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.qc-ava {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 8px; font-weight: 700; flex-shrink: 0; color: #fff;
}
.qc-name { font-size: 13px; font-weight: 700; }
.qc-handle { font-size: 12px; color: var(--mute); font-family: var(--font-en); }
.qc-body { font-size: 14px; color: var(--paper); line-height: 1.6; word-break: break-word; }

/* ── Link preview card ──────────────────────────────────────── */
.lp-card {
  display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  margin-top: 10px; text-decoration: none; color: inherit; transition: background .15s;
  cursor: pointer;
}
.lp-card:hover { background: var(--char); }
.lp-thumb { width: 90px; min-height: 80px; flex-shrink: 0; overflow: hidden; }
.lp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lp-text { padding: 10px 12px; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lp-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-desc { font-size: 12px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lp-domain { font-size: 11px; color: var(--mute); margin-top: auto; }

/* ── Repost dropdown ────────────────────────────────────────── */
.repost-wrap { position: relative; }
.repost-menu {
  display: none; position: absolute; bottom: calc(100% + 6px); inset-inline-start: 0;
  background: var(--char); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; min-width: 160px; z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.repost-menu.open { display: block; animation: menu-pop .14s ease; }
.repost-menu button {
  width: 100%; text-align: start; background: none; border: none;
  color: var(--white); font-family: var(--font-ar); font-size: 13px;
  padding: 10px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: background .12s;
}
.repost-menu button:hover { background: var(--slate); }
.repost-menu button svg { width: 16px; height: 16px; }
