/* Post cards, profile tiles and the post popup. */

/* ── Instagram-style posts ── */
.wb-feed { display: flex; flex-direction: column; gap: 24px; max-width: 480px; margin: 0 auto; }
.wb-post { gap: 0; padding: 0; overflow: hidden; border-width: 2.5px; border-radius: 14px; box-shadow: 4px 4px 0 var(--border); }
.wb-post-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 10px 10px 12px; }
.wb-post-who { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--black); text-decoration: none; }
.wb-post-who:hover strong { text-decoration: underline; }
.wb-post-names { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.wb-post-handle-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-post-handle-line strong { font-size: 14px; font-weight: 800; }
.wb-post-handle-line .wb-muted { font-size: 13px; }
.wb-post-board { font-size: 11px; font-weight: 700; color: var(--muted); }
.wb-post-head .wb-icon-btn { border: none; font-size: 18px; }

.wb-media { position: relative; aspect-ratio: 1.91 / 1; overflow: hidden; background: var(--muted-light); border-top: 2px solid var(--border); border-bottom: 2px solid var(--border); user-select: none; }
.wb-media-clickable { cursor: pointer; }
.wb-media-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wb-media-img.wb-media-shot, .wb-pv-media .wb-media-img.wb-media-shot { object-fit: cover; object-position: top center; }
.wb-media-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 100%; padding: 16px; text-align: center; }
.wb-media-tile img { width: 58px; height: 58px; padding: 9px; background: #fff; border: 2px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.wb-media-tile strong { max-width: 90%; font-size: 17px; font-weight: 900; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wb-media-tile span { font-size: 12px; font-weight: 700; color: #475569; }
.wb-heart-pop { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; }
.wb-heart-pop svg { width: 96px; height: 96px; fill: #fff; stroke: var(--border); stroke-width: 1; }
.wb-heart-pop.show { animation: wbHeartPop 0.9s ease forwards; }
@keyframes wbHeartPop {
  0% { opacity: 0; transform: scale(0.4); }
  15% { opacity: 1; transform: scale(1.15); }
  30% { transform: scale(0.95); }
  45% { transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}


.wb-actions { display: flex; align-items: center; gap: 2px; padding: 4px 6px 0; }
.wb-act { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: var(--black); background: none; border: none; border-radius: 50%; cursor: pointer; transition: transform 0.1s ease; }
.wb-act:hover { color: #475569; }
.wb-act:active { transform: scale(0.85); }
.wb-act.on svg { fill: currentColor; }
.wb-act-like.on { color: #ef4444; animation: wbLikePop 0.3s ease; }
@keyframes wbLikePop { 50% { transform: scale(1.25); } }
.wb-likes { padding: 0 14px; font-size: 14px; font-weight: 800; }
.wb-caption-line { padding: 4px 14px 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.wb-caption-handle, .wb-comment-handle { font-weight: 800; color: var(--black); text-decoration: none; }
.wb-caption-handle:hover, .wb-comment-handle:hover { text-decoration: underline; }
.wb-mention { font-weight: 700; color: #1d4ed8; text-decoration: none; }
.wb-mention:hover { text-decoration: underline; }
.wb-more-link { padding: 0; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: none; border: none; cursor: pointer; }
.wb-time { display: block; padding: 6px 14px 14px; font-size: 10px; font-weight: 700; letter-spacing: 0.4px; color: var(--muted); }

/* Profile grid: 3 squares per row */
.wb-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.wb-tile { position: relative; aspect-ratio: 1 / 1; padding: 0; overflow: hidden; font-family: inherit; text-align: left; background: var(--muted-light); border: 2px solid var(--border); border-radius: 8px; cursor: pointer; }
.wb-tile .wb-media { height: 100%; aspect-ratio: auto; border: none; }
.wb-tile .wb-media-tile img { width: 46px; height: 46px; }
.wb-tile-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 8px; font-size: 11px; font-weight: 800; color: #fff; background: rgba(15, 23, 42, 0.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-tile-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 15px; font-weight: 900; color: #fff; background: rgba(15, 23, 42, 0.55); opacity: 0; transition: opacity 0.15s ease; }
.wb-tile:hover .wb-tile-overlay, .wb-tile:focus-visible .wb-tile-overlay { opacity: 1; }

/* Post view: one column, the picture with a quiet strip underneath */
.wb-modal.wb-modal-post { position: relative; max-width: 760px; }
.wb-modal-post .wb-modal-body { padding: 0; }
/* Close sits inside the popup, top-left over the picture */
.wb-modal-post .wb-modal-head { position: absolute; top: 12px; left: 12px; z-index: 3; padding: 0; border: none; }
.wb-modal-post .wb-modal-head .wb-icon-btn { box-shadow: 2px 2px 0 var(--border); }
.wb-modal-post .wb-modal-head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wb-pv { display: flex; flex-direction: column; }
.wb-pv-media { display: flex; flex-direction: column; height: min(62vh, 520px); background: #fff; border-bottom: 2px solid var(--border); border-radius: 11px 11px 0 0; overflow: hidden; }
.wb-pv-media .wb-media { flex: 1; aspect-ratio: auto; border: none; }
.wb-pv-media .wb-media-img { position: relative; z-index: 1; object-fit: contain; }
/* Pictures that don't fill the space sit on a soft, bright blur of themselves */
.wb-media-backdrop { display: none; }
.wb-pv-media .wb-media-backdrop { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(60px) saturate(1.6) brightness(1.15); transform: scale(1.4); opacity: 0.6; pointer-events: none; }
.wb-pv-media .wb-media:has(.wb-media-backdrop) { background: #fff; }
.wb-pv-media .wb-media:has(.wb-media-backdrop) .wb-media-img { padding: 22px; filter: drop-shadow(0 8px 20px rgba(15, 23, 42, 0.16)); }
/* The whole picture is a link to the website */
.wb-pv-open { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; color: inherit; text-decoration: none; cursor: pointer; }
.wb-pv-open-hint { position: absolute; right: 14px; bottom: 14px; z-index: 2; max-width: calc(100% - 28px); padding: 7px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 800; color: var(--black); background: #fff; border: 2px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-sm); opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; pointer-events: none; }
.wb-pv-open:hover .wb-pv-open-hint, .wb-pv-open:focus-visible .wb-pv-open-hint { opacity: 1; transform: none; }
.wb-pv-open:hover .wb-pv-open-hint { background: var(--lime-light); }
@media (hover: none) { .wb-pv-open-hint { opacity: 1; transform: none; } }
/* The strip under the picture */
.wb-pv-info { display: flex; flex-direction: column; gap: 2px; padding: 6px 4px 14px; }
.wb-pv-info .wb-post-head { padding-bottom: 4px; border: none; }
.wb-pv-info .wb-actions { align-items: center; }
.wb-pv-info .wb-likes { margin: 0 0 0 6px; padding: 0; font-size: 14px; }
.wb-pv-info .wb-caption-line { padding: 4px 14px 0; font-size: 14px; line-height: 1.5; color: #334155; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .wb-backdrop:has(.wb-modal-post) { padding: 0; }
  .wb-modal.wb-modal-post { max-width: none; min-height: 100vh; border: none; border-radius: 0; box-shadow: none; }
  .wb-modal-post .wb-modal-head { position: sticky; top: 0; left: auto; z-index: 3; justify-content: flex-start; padding: 8px 10px; background: #fff; border-bottom: 2px solid var(--border); }
  .wb-pv-media { height: auto; border-radius: 0; }
  .wb-pv-media .wb-media { aspect-ratio: 1.91 / 1; }
  .wb-tiles { gap: 3px; }
  .wb-tile { border-width: 1.5px; border-radius: 4px; }
  .wb-tile-title { display: none; }
  .wb-feed { gap: 18px; }
}
