/* Shared styles for the social pages: page frame, buttons, tabs, grid, popups, toasts. */

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(#d1d5db 1.2px, transparent 1.2px);
  background-size: 16px 16px;
  color: var(--black);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body.wb-modal-open { overflow: hidden; }

.wrap { max-width: 920px; margin: 0 auto; padding: 22px 18px 70px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 900; color: var(--black); text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.top-links { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.wb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; font-family: inherit; font-size: 13px; font-weight: 800; color: var(--border);
  text-decoration: none; background: #fff; border: 2.5px solid var(--border); border-radius: 8px;
  box-shadow: 3px 3px 0 var(--border); cursor: pointer; white-space: nowrap;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.wb-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--border); }
.wb-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--border); }
.wb-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.wb-btn[hidden] { display: none !important; }
.wb-btn-primary { background: var(--lime); }
.wb-btn-primary:hover { background: var(--lime-light); }
.wb-btn-danger { background: #fee2e2; color: #b91c1c; }
.wb-btn.on { background: var(--muted-light); }

.wb-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  font-family: inherit; font-size: 16px; font-weight: 900; color: var(--border); background: #fff;
  border: 2px solid var(--border); border-radius: 7px; cursor: pointer;
}
.wb-icon-btn:hover { background: var(--muted-light); }

.card { background: #fff; border: 2.5px solid var(--border); border-radius: 14px; box-shadow: 5px 5px 0 var(--border); padding: 24px; }

.wb-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden;
  font-weight: 900; text-transform: uppercase; background: var(--lime);
  border: 2px solid var(--border); border-radius: 50%;
}
.wb-avatar img { width: 100%; height: 100%; object-fit: cover; }

.wb-muted { color: var(--muted); font-size: 12px; font-weight: 600; }
.wb-section-title { margin: 18px 0 10px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.wb-chip {
  display: inline-block; align-self: flex-start; padding: 2px 9px; font-size: 11px; font-weight: 800;
  background: var(--lime-light); border: 1.5px solid var(--border); border-radius: 999px;
}

/* Tabs */
.wb-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 16px; padding-bottom: 12px; border-bottom: 2px solid var(--border); }
.wb-tab {
  padding: 8px 15px; font-family: inherit; font-size: 13px; font-weight: 800; color: var(--border);
  background: #fff; border: 2px solid var(--border); border-radius: 7px; box-shadow: 2px 2px 0 var(--border); cursor: pointer;
}
.wb-tab[aria-selected="true"] { background: var(--lime); box-shadow: 3px 3px 0 var(--border); }

/* Post grid */
.wb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.wb-post {
  display: flex; flex-direction: column; gap: 10px; padding: 14px;
  background: #fff; border: 2px solid var(--border); border-radius: 12px; box-shadow: 3px 3px 0 var(--border);
}
.wb-post-author { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wb-post-who { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--black); text-decoration: none; }
.wb-post-who:hover span { text-decoration: underline; }
.wb-post-link { display: flex; align-items: center; gap: 12px; color: var(--black); text-decoration: none; }
.wb-post-link:hover strong { text-decoration: underline; }
.wb-favicon { width: 40px; height: 40px; flex: none; padding: 6px; background: var(--muted-light); border: 1.5px solid var(--border); border-radius: 9px; }
.wb-post-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wb-post-text strong { font-size: 14px; font-weight: 800; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.wb-caption { font-size: 13px; line-height: 1.45; color: #334155; overflow-wrap: anywhere; white-space: pre-wrap; }
.wb-post-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; border-top: 1.5px solid #e2e8f0; }
.wb-spacer { flex: 1; }

.wb-like {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; font-family: inherit;
  font-size: 13px; font-weight: 800; color: var(--border); background: #fff;
  border: 2px solid var(--border); border-radius: 999px; cursor: pointer;
}
.wb-like:hover { background: var(--muted-light); }
.wb-like.liked { background: #fee2e2; color: #be123c; border-color: #be123c; }
.wb-heart { font-size: 15px; line-height: 1; }
.wb-like.big { padding: 8px 14px; font-size: 14px; }
.wb-like-btn.liked { color: #be123c; background: #fee2e2; }

/* ⋯ menu */
.wb-menu-wrap { position: relative; }
.wb-menu {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 20; min-width: 170px; padding: 5px;
  background: #fff; border: 2px solid var(--border); border-radius: 9px; box-shadow: 3px 3px 0 var(--border);
}
.wb-menu[hidden] { display: none; }
.wb-menu.down { bottom: auto; top: calc(100% + 6px); }
.wb-menu-item {
  display: block; width: 100%; padding: 8px 10px; font-family: inherit; font-size: 13px; font-weight: 700;
  text-align: left; color: var(--black); background: none; border: none; border-radius: 6px; cursor: pointer;
}
.wb-menu-item:hover { background: var(--lime-light); }
.wb-menu-item.danger { color: #b91c1c; }

/* Modals */
/* Popups sit in the middle of the screen; margin: auto keeps tall ones scrollable from the top */
.wb-backdrop { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px; overflow-y: auto; background: rgba(15, 23, 42, 0.55); animation: wbFadeIn 0.15s ease-out; }
.wb-modal { width: 100%; max-width: 520px; margin: auto; background: #fff; border: 3px solid var(--border); border-radius: 14px; box-shadow: 6px 6px 0 var(--border); animation: wbPopIn 0.18s cubic-bezier(0.2, 1.3, 0.4, 1); }
@keyframes wbFadeIn { from { opacity: 0; } }
@keyframes wbPopIn { from { opacity: 0; transform: translate(3px, 3px) scale(0.97); box-shadow: 0 0 0 var(--border); } }
@media (prefers-reduced-motion: reduce) { .wb-backdrop, .wb-modal { animation: none; } }
.wb-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 2px solid var(--border); }
.wb-modal-head h2 { font-size: 17px; font-weight: 900; overflow-wrap: anywhere; }
.wb-modal-body { padding: 16px 18px 18px; }
.wb-modal-body > .wb-post { box-shadow: none; }

.wb-form { display: flex; flex-direction: column; gap: 10px; }
.wb-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px; }
.wb-input {
  width: 100%; padding: 10px 12px; font-family: inherit; font-size: 14px; color: var(--black);
  background: #fff; border: 2px solid var(--border); border-radius: 8px; outline: none; resize: vertical;
}
.wb-input:focus { box-shadow: 3px 3px 0 var(--lime-dark); }
.wb-count { align-self: flex-end; margin-top: -6px; }
.wb-radio { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.wb-radio input { width: 16px; height: 16px; accent-color: var(--lime-dark); }

.wb-handle-box { display: flex; align-items: center; background: #fff; border: 2px solid var(--border); border-radius: 8px; }
.wb-handle-box:focus-within { box-shadow: 3px 3px 0 var(--lime-dark); }
.wb-handle-at { padding-left: 12px; font-size: 15px; font-weight: 900; color: var(--muted); }
.wb-handle-input { flex: 1; min-width: 0; padding: 10px 12px 10px 3px; font-family: inherit; font-size: 15px; font-weight: 700; color: var(--black); background: none; border: none; outline: none; }
.wb-handle-input:disabled { color: var(--muted); }
.wb-handle-status { min-height: 18px; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.wb-handle-status.ok { color: var(--success); }
.wb-handle-status.bad { color: #b91c1c; }
.wb-handle-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wb-handle-chips:empty { display: none; }
.wb-handle-chip { padding: 4px 10px; font-family: inherit; font-size: 12px; font-weight: 800; color: var(--black); background: var(--lime-light); border: 1.5px solid var(--border); border-radius: 999px; cursor: pointer; }
.wb-handle-chip:hover { background: var(--lime); }

.wb-edit-photo { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; margin-bottom: 14px; border-bottom: 1.5px solid #e2e8f0; }
.wb-edit-photo-text { min-width: 0; }
.wb-edit-photo-text strong { display: block; font-size: 15px; font-weight: 900; overflow-wrap: anywhere; }
.wb-edit-photo-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.wb-edit-photo-buttons .wb-btn { padding: 6px 11px; font-size: 12px; box-shadow: 2px 2px 0 var(--border); }
.wb-edit-form { gap: 14px; }
.wb-edit-row { display: flex; flex-direction: column; gap: 6px; }
.wb-edit-row .wb-count { margin-top: 0; }

.wb-comments { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.wb-comment { display: flex; align-items: flex-start; gap: 10px; }
.wb-comment-text { flex: 1; min-width: 0; }
.wb-comment-text p { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.wb-comment-line { display: flex; align-items: center; gap: 8px; }
.wb-comment-handle { font-size: 13px; font-weight: 800; color: var(--black); text-decoration: none; }
.wb-comment-handle:hover { text-decoration: underline; }
.wb-comment .wb-menu { bottom: auto; top: calc(100% + 4px); }
.wb-comment-form { display: flex; gap: 8px; }
.wb-comment-form .wb-btn { box-shadow: 2px 2px 0 var(--border); }

.wb-empty { padding: 30px 10px; text-align: center; color: var(--muted); font-size: 14px; font-weight: 600; }
.wb-more { display: flex; justify-content: center; margin-top: 18px; }

.wb-toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 2000; max-width: calc(100vw - 32px);
  padding: 11px 16px; font-size: 13px; font-weight: 800; color: #fff; background: var(--border);
  border-radius: 9px; box-shadow: 3px 3px 0 var(--lime); transform: translate(-50%, 140%);
  transition: transform 0.2s ease; pointer-events: none;
}
.wb-toast.show { transform: translate(-50%, 0); }


@media (max-width: 560px) {
  .top { gap: 8px; }
  .top-links { gap: 8px; flex-wrap: nowrap; }
  .top-links .wb-btn { padding: 7px 11px; font-size: 12px; box-shadow: 2px 2px 0 var(--border); }
  .top-links.signed-out .wb-hide-phone { display: none; } /* Log in and Sign up matter more here */
  .wb-tab { padding: 7px 11px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .wb-btn, .wb-toast { transition: none; }
}
