/**
 * Suffah — UI refresh (Phase 28)
 * Timeline look: SVG icons everywhere, verified seal, compact post cards,
 * mobile top bar + bottom nav + floating compose button, new-posts pill.
 * Loaded after main.css so it can refine components without !important.
 */
:root {
    --color-verified: #1D9BF0;
    --color-verified-org: #D4A017;
    --color-like: #F91880;
    --color-repost: #00A56A;
}
[data-theme="dark"] { --color-like: #FF4B9C; --color-repost: #2BD08F; }

/* ---------- icons ---------- */
.icon { display: inline-block; flex-shrink: 0; vertical-align: middle; }
.nav-item__icon { display: inline-flex; align-items: center; justify-content: center; position: relative; }
.nav-item__icon .icon { width: 26px; height: 26px; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); color: var(--color-accent); font-size: var(--text-xl); font-weight: var(--weight-bold); width: fit-content; }
.brand:hover { background: var(--bg-hover); border-radius: var(--radius-full); }
@media (max-width: 899px) { .brand__word { display: none; } .brand { padding: var(--space-3); } }

/* ---------- verified seal ---------- */
.badge-verified { display: inline-flex; align-items: center; vertical-align: middle; flex-shrink: 0; width: auto; height: auto; color: var(--color-verified); }
.badge-verified svg { display: block; }
.badge-verified__seal { fill: var(--color-verified); }
.badge-verified--org .badge-verified__seal { fill: var(--color-verified-org); }

/* ---------- mobile top bar ---------- */
.mobile-topbar { display: none; }
@media (max-width: 687px) {
    .mobile-topbar { position: sticky; top: 0; z-index: var(--z-sticky-header); display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 var(--space-4); background: var(--bg-primary); }
    .mobile-topbar__side { display: inline-flex; align-items: center; justify-content: flex-start; width: 44px; height: 44px; color: var(--text-primary); }
    .mobile-topbar__side--end { justify-content: flex-end; }
    .mobile-topbar__logo { display: inline-flex; color: var(--color-accent); }
    .mobile-topbar__login { font-weight: var(--weight-bold); color: var(--color-accent); font-size: var(--text-sm); }
    .mobile-topbar ~ .main-header { display: none; }
    .mobile-topbar ~ .tabs { top: 52px; }
}

/* ---------- tabs (For you / Following) ---------- */
.tabs { position: sticky; top: 0; z-index: calc(var(--z-sticky-header) - 1); background: var(--bg-primary); }
.tab { position: relative; font-size: var(--text-md); font-weight: var(--weight-medium); border-bottom: 0; }
.tab[aria-selected="true"] { font-weight: var(--weight-bold); border-bottom-color: transparent; }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 56px; height: 4px; transform: translateX(-50%); border-radius: 4px; background: var(--color-accent); }

/* ---------- bottom nav + floating button ---------- */
@media (max-width: 687px) {
    .mobile-nav { border-top: 1px solid var(--border-color); }
    .mobile-nav .nav-item { width: 100%; height: 100%; justify-content: center; padding: 0; border-radius: 0; position: relative; }
    .mobile-nav .nav-item[aria-current="page"] { color: var(--text-primary); }
    .compose-fab { width: 56px; height: 56px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }
    .compose-fab .icon { width: 28px; height: 28px; stroke-width: 2.2; }
}
.nav-item__badge--float { position: absolute; top: 6px; left: calc(50% + 4px); margin: 0; min-width: 18px; height: 18px; background: var(--color-accent); color: var(--text-on-accent); border: 2px solid var(--bg-primary); box-sizing: content-box; }
.sidebar-left .nav-item .nav-item__badge { background: var(--color-accent); color: var(--text-on-accent); }
.nav-item__icon .icon { stroke-width: 1.9; }

/* ---------- post card ---------- */
.post-card { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.post-card__context { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-1) 24px; color: var(--text-tertiary); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.post-card__avatar { grid-column: 1; }
.post-card .avatar { width: 40px; height: 40px; }
.post-card__body { grid-column: 2; min-width: 0; }
.post-card__link { display: block; color: inherit; text-decoration: none; }
.post-card__header { display: flex; align-items: center; gap: 4px; padding-right: 36px; min-width: 0; font-size: var(--text-md); }
.post-card__name { font-weight: var(--weight-bold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.post-card__handle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex-shrink: 1; }
.post-card__timestamp { white-space: nowrap; flex-shrink: 0; }
.post-card__content { font-size: var(--text-md); line-height: 1.45; margin-top: 2px; }
.post-card__show-more { color: var(--color-accent); }
.post-card__show-more:hover { text-decoration: underline; }

/* more menu */
.post-menu { position: absolute; top: var(--space-2); right: var(--space-2); z-index: 5; }
.post-menu__btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: var(--radius-full); background: transparent; color: var(--text-tertiary); cursor: pointer; }
.post-menu__btn:hover { background: var(--bg-hover); color: var(--color-accent); }
.post-menu__list { position: absolute; right: 0; top: 36px; min-width: 190px; padding: var(--space-1) 0; background: var(--bg-elevated); border: 1px solid var(--border-color); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.post-menu__list[hidden] { display: none; }
.post-menu__list a, .post-menu__list button { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: var(--space-3) var(--space-4); border: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: var(--text-base); text-align: left; cursor: pointer; text-decoration: none; }
.post-menu__list a:hover, .post-menu__list button:hover, .post-menu__list a:focus-visible, .post-menu__list button:focus-visible { background: var(--bg-hover); outline: none; }

/* media (scoped so it beats post.css, which loads later) */
.post-card .media-grid, .post-detail .media-grid { display: grid; gap: 2px; margin: var(--space-3) 0 0; border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; }
.post-card .media-grid img, .post-detail .media-grid img { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--bg-tertiary); }
.post-card .media-grid--1, .post-card .media-grid--single, .post-detail .media-grid--single { grid-template-columns: 1fr; }
.post-card .media-grid--1 img, .post-card .media-grid--single img, .post-detail .media-grid--single img { height: auto; max-height: 510px; }
.post-card .media-grid--2, .post-card .media-grid--3, .post-card .media-grid--4 { grid-template-columns: 1fr 1fr; aspect-ratio: 16 / 9; }
.post-card .media-grid--3, .post-card .media-grid--4 { grid-template-rows: 1fr 1fr; }
.post-card .media-grid--3 img:first-child { grid-row: 1 / 3; }
.post-card .media-grid--2 img, .post-card .media-grid--3 img, .post-card .media-grid--4 img { height: 100%; max-height: none; }

/* action row */
.post-card__actions { display: flex; align-items: center; justify-content: space-between; max-width: none; gap: 2px; margin-top: var(--space-2); margin-left: -6px; margin-right: -4px; }
.post-card__actions-end { display: inline-flex; align-items: center; gap: 0; }
.post-action { min-height: 36px; padding: 0 2px; gap: 0; font-size: var(--text-sm); color: var(--text-tertiary); }
.post-action__icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-full); transition: background-color var(--transition-fast), color var(--transition-fast); margin-right: -2px; }
.post-action:hover:not(:disabled) { background: transparent; }
.post-action--reply:hover .post-action__icon, .post-action--views:hover .post-action__icon, .post-action--share:hover .post-action__icon, .post-action--bookmark:hover .post-action__icon { background: var(--bg-hover); color: var(--color-accent); }
.post-action--reply:hover, .post-action--views:hover, .post-action--share:hover, .post-action--bookmark:hover { color: var(--color-accent); }
.post-action--repost:hover .post-action__icon { background: color-mix(in srgb, var(--color-repost) 12%, transparent); }
.post-action--repost:hover, .post-action--repost[aria-pressed="true"] { color: var(--color-repost); }
.post-action--like:hover .post-action__icon { background: color-mix(in srgb, var(--color-like) 12%, transparent); }
.post-action--like:hover, .post-action--like[aria-pressed="true"] { color: var(--color-like); }
.post-action[data-post-action="like"][aria-pressed="true"] { color: var(--color-like); }
.post-action--repost[aria-pressed="true"] { font-weight: var(--weight-bold); }
.post-action--bookmark[aria-pressed="true"] { color: var(--color-accent); }
.post-action--static { cursor: default; }
/* outline vs filled icon, driven by aria-pressed */
.post-action .icon--on { display: none; }
.post-action[aria-pressed="true"] .icon--on { display: inline-block; }
.post-action[aria-pressed="true"] .icon--off { display: none; }
.post-action--repost[aria-pressed="true"] .icon--on { display: inline-block; stroke: currentColor; stroke-width: 2.6; fill: none; }
.post-action--repost .icon--on { }
.post-action--like[aria-pressed="true"] .icon { animation: heart-pop 220ms ease; }
@keyframes heart-pop { 50% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .post-action--like[aria-pressed="true"] .icon { animation: none; } }
.post-action__count { min-width: 1ch; }

/* repost/like "fill" variants: the repost icon has no filled shape, so it gets a heavier stroke instead (above) */
.post-card .sensitive-warning__overlay { display: flex; align-items: center; justify-content: center; gap: var(--space-2); }

/* ---------- new-posts pill ---------- */
.new-posts-pill { position: fixed; top: 112px; left: 50%; transform: translateX(-50%); z-index: calc(var(--z-sticky-header) + 5); display: inline-flex; align-items: center; gap: var(--space-2); padding: 6px 14px 6px 10px; border: 0; border-radius: var(--radius-full); background: var(--color-accent); color: var(--text-on-accent); font: inherit; font-weight: var(--weight-semibold); box-shadow: var(--shadow-md); cursor: pointer; }
.new-posts-pill[hidden] { display: none; }
.new-posts-pill__avatars { display: inline-flex; }
.new-posts-pill__avatars .avatar { width: 26px; height: 26px; margin-left: -8px; border: 2px solid var(--color-accent); font-size: 11px; }
.new-posts-pill__avatars .avatar:first-child { margin-left: 0; }
@media (min-width: 688px) { .new-posts-pill { top: 76px; } }

/* ---------- misc icon-bearing UI ---------- */
.profile-header__meta .icon, .list-form__meta .icon, .scripture-card__head .icon { margin-right: 4px; vertical-align: -4px; }
.back-link { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-secondary); }
.empty-state .icon { color: var(--text-tertiary); }
.notif-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; color: var(--text-secondary); }
.notif-icon--like { color: var(--color-like); } .notif-icon--repost { color: var(--color-repost); } .notif-icon--follow, .notif-icon--follow_request { color: var(--color-accent); }

/* ---------- post detail action bar ---------- */
.post-detail__actions .btn-icon[aria-label="Unlike"] { color: var(--color-like); }
.post-detail__actions .btn-icon[aria-label="Remove bookmark"] { color: var(--color-accent); }
.post-detail__actions .btn-icon .icon, .post-detail__actions .btn .icon { vertical-align: -4px; }
.post-detail__content { font-size: 1.125rem; line-height: 1.45; }
.post-detail .badge-verified { margin-left: 2px; }
.announcement__close { display: inline-flex; align-items: center; justify-content: center; }

.nav-item__badge[hidden] { display: none; }

/* ---- Phase 29: account drawer (mobile) ---- */
.drawer { position: fixed; inset: 0; z-index: calc(var(--z-modal, 300) + 10); display: none; }
@media (max-width: 687px) { .drawer:not([hidden]) { display: block; } }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .2s ease; }
.drawer__panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(86vw, 340px); padding: var(--space-4) var(--space-4) var(--space-6); overflow-y: auto; background: var(--bg-primary); color: var(--text-primary); transform: translateX(-100%); transition: transform .22s ease; border-radius: 0 16px 16px 0; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: flex-start; justify-content: space-between; }
.drawer__head .avatar { width: 48px; height: 48px; }
.drawer__close { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--border-color); border-radius: var(--radius-full); background: none; color: var(--text-primary); cursor: pointer; }
.drawer__name { display: inline-flex; align-items: center; gap: 4px; margin-top: var(--space-3); font-size: 1.35rem; font-weight: var(--weight-bold); color: var(--text-primary); }
.drawer__handle { color: var(--text-tertiary); }
.drawer__counts { display: flex; gap: var(--space-4); margin: var(--space-3) 0 var(--space-4); padding-bottom: var(--space-4); border-bottom: 1px solid var(--border-color); color: var(--text-tertiary); }
.drawer__counts strong { color: var(--text-primary); }
.drawer__nav { display: flex; flex-direction: column; }
.drawer__nav--small { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border-color); }
.drawer__item { display: flex; align-items: center; gap: var(--space-4); width: 100%; padding: 12px 0; border: 0; background: none; color: var(--text-primary); font: inherit; font-size: 1.25rem; font-weight: var(--weight-bold); text-align: left; cursor: pointer; }
.drawer__nav--small .drawer__item { font-size: var(--text-base); font-weight: var(--weight-medium, 500); padding: 10px 0; }
.drawer__pill { margin-left: 4px; padding: 2px 10px; border-radius: 8px; background: var(--color-verified); color: #fff; font-size: var(--text-sm); font-style: normal; font-weight: var(--weight-bold); }
.drawer__moon { display: none; }
:root[data-theme="dark"] .drawer__sun { display: none; }
:root[data-theme="dark"] .drawer__moon { display: inline-block; }
body.drawer-lock { overflow: hidden; }
.mobile-topbar__avatar { border: 0; background: none; padding: 0; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .drawer__panel, .drawer__backdrop { transition: none; } }
