/* Feed: composer, post cards, reactions, comments. */

/* composer */
.composer { display: flex; flex-direction: column; gap: var(--s3); }
.composer__top { display: flex; gap: var(--s3); align-items: flex-start; }
.composer__top textarea {
  flex: 1; min-height: 46px; resize: none; padding: 11px 16px; border-radius: 24px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; line-height: 1.45;
}
.composer__top textarea:focus { outline: 2px solid var(--leaf); outline-offset: 1px; border-radius: 16px; }
.composer__more { display: none; flex-direction: column; gap: var(--s3); }
.composer.is-open .composer__more, .composer:focus-within .composer__more { display: flex; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.chip-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip-radio span { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); font-size: var(--fs-sm); cursor: pointer; background: var(--surface-2); }
.chip-radio input:checked + span { border-color: var(--leaf); color: var(--leaf); box-shadow: 0 0 0 1px var(--leaf) inset; }
.chip-radio input:focus-visible + span { outline: 2px solid var(--leaf); outline-offset: 2px; }
.composer__row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.composer__date { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); color: var(--muted); }
.composer__date span { display: inline-flex; gap: 4px; align-items: center; }
.composer__date svg { width: 16px; height: 16px; }
.composer__date input, .composer__aud select {
  height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: var(--fs-sm);
}
.composer__date input { width: 130px; }
.composer__aud { margin-left: auto; max-width: 100%; }
.composer__aud select { max-width: 100%; }
.composer__previews { display: flex; gap: 6px; flex-wrap: wrap; }
.composer__previews img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.composer__bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); border-top: 1px solid var(--border); padding-top: var(--s3); }
.composer__photo { cursor: pointer; }
.composer__photo svg { width: 20px; height: 20px; color: var(--leaf); }
.composer__photo:focus-within { outline: 2px solid var(--leaf); outline-offset: 2px; }
.is-busy { opacity: .6; pointer-events: none; }

/* post card */
.feed { gap: var(--s4); }
.post { display: flex; flex-direction: column; gap: var(--s3); padding-bottom: var(--s2); }
.post__head { display: flex; gap: var(--s3); align-items: flex-start; }
.post__who { flex: 1; min-width: 0; }
.post__name { margin: 0; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.post__name a { color: var(--text); text-decoration: none; }
.post__name a:hover { text-decoration: underline; }
.post__arrow { color: var(--muted); margin: 0 4px; font-size: .8em; }
.post__meta { margin: 2px 0 0; font-size: var(--fs-xs); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.post__meta a { color: var(--muted); text-decoration: none; }
.post__meta a:hover { text-decoration: underline; }
.post__meta .kin { color: var(--gold); font-weight: 600; }
.post__aud svg { width: 14px; height: 14px; vertical-align: -2px; }
.post__menu { position: relative; }
.post__menu summary { list-style: none; cursor: pointer; }
.post__menu summary::-webkit-details-marker { display: none; }
.post__menu .menu__panel { width: 220px; top: calc(100% + 4px); }
.post__menu .menu__panel form { margin: 0; }
.post__type { margin: 0; display: inline-flex; align-self: flex-start; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); }
.post--birth .post__type { color: var(--leaf); }
.post--wedding .post__type { color: var(--gold); }
.post--death .post__type { color: var(--root); }
.post--achievement .post__type { color: var(--blue); }
.post__body { overflow-wrap: anywhere; line-height: 1.55; }
.post__body--big { font-size: var(--fs-lg); line-height: 1.35; }
.post__body a { color: var(--blue); }
.post__media { display: grid; gap: 3px; margin: 0 calc(-1 * var(--s4)); }
.post__media a { display: block; background: var(--surface-2); }
.post__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post__media--1 img { height: auto; max-height: 640px; object-fit: contain; background: #000; }
.post__media--2 { grid-template-columns: 1fr 1fr; }
.post__media--2 a, .post__media--3 a, .post__media--4 a { aspect-ratio: 1; }
.post__media--3 { grid-template-columns: 1fr 1fr; }
.post__media--3 a:first-child { grid-column: 1 / -1; aspect-ratio: 2; }
.post__media--4 { grid-template-columns: 1fr 1fr; }
.post__stats { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-sm); color: var(--muted); min-height: 20px; }
.post__stats a { color: var(--muted); text-decoration: none; }
.post__counts { display: inline-flex; align-items: center; gap: 6px; }
.post__emojis { display: inline-flex; }
.post__emojis span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--surface); margin-left: -6px; font-size: 12px; }
.post__emojis span:first-child { margin-left: 0; }
.post__actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px 0; }
.post__btn {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 40px; border-radius: 8px;
  background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; font-size: var(--fs-sm); cursor: pointer; text-decoration: none;
}
.post__btn:hover { background: var(--surface-2); }
.post__btn svg { width: 18px; height: 18px; }
.post__btn.is-on { color: var(--leaf); }
.react { position: relative; }
.react__pick {
  position: absolute; bottom: calc(100% + 6px); left: 8px; display: flex; gap: 2px; padding: 4px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .15s, transform .15s;
}
.react:hover .react__pick, .react:focus-within .react__pick { opacity: 1; transform: none; pointer-events: auto; }
.react__pick button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; font-size: 22px; cursor: pointer; transition: transform .12s; }
.react__pick button:hover, .react__pick button:focus-visible { transform: scale(1.25); }
@media (prefers-reduced-motion: reduce) { .react__pick, .react__pick button { transition: none; } }

/* comments */
.post__reply { display: flex; gap: var(--s2); align-items: center; }
.post__reply input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: var(--fs-sm); }
.post__reply input:focus { outline: 2px solid var(--leaf); outline-offset: 1px; }
.comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.comments:empty { display: none; }
.comment { display: grid; grid-template-columns: auto 1fr; gap: 0 var(--s2); }
.comment > a { grid-row: span 2; }
.comment__bubble { background: var(--surface-2); border-radius: 16px; padding: 8px 12px; justify-self: start; max-width: 100%; }
.comment__bubble p { margin: 0; overflow-wrap: anywhere; font-size: var(--fs-sm); }
.comment__name { font-weight: 600; font-size: var(--fs-sm); color: var(--text); text-decoration: none; }
.comment__meta { display: flex; gap: var(--s2); font-size: var(--fs-xs); padding: 2px 12px; align-items: center; }
.comment__meta form { margin: 0; }
.linklike { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }

.row--center { justify-content: center; }
.btn svg { width: 18px; height: 18px; flex: none; }
.post__head > a, .comment > a, .panel__list a, .menu__me { text-decoration: none; }
.post__stats:not(:has(a)):not(:has(.post__emojis)) { min-height: 0; margin-top: calc(-1 * var(--s3)); }

/* communities */
.comm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3); }
.comm-card { display: flex; flex-direction: column; gap: 6px; padding: 0 0 var(--s3); overflow: hidden; color: var(--text); text-decoration: none; }
.comm-card:hover { border-color: var(--gold); }
.comm-card > :not(.comm-card__cover) { margin: 0 var(--s3); }
.comm-card .chip { align-self: flex-start; }
.comm-card__cover { height: 84px; display: flex; align-items: flex-end; padding: 0 var(--s3); margin-bottom: 22px;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--gold) 35%, transparent), transparent 60%), linear-gradient(135deg, var(--bark-deep), var(--surface-2)); }
.comm-card__cover .comm-dot { transform: translateY(22px); border: 3px solid var(--surface); }
.comm-card__name { font-size: var(--fs-md); }
.comm-dot--lg { width: 56px; height: 56px; font-size: 1.4rem; border-radius: 14px; }
.comm-dot--xl { width: 96px; height: 96px; font-size: 2.4rem; border-radius: 22px; border: 4px solid var(--surface); }
.comm-head { padding: 0; overflow: hidden; }
.comm-head__cover { height: 150px; background:
  radial-gradient(80% 120% at 10% 0%, color-mix(in srgb, var(--gold) 40%, transparent), transparent 60%),
  radial-gradient(60% 100% at 90% 100%, color-mix(in srgb, var(--leaf) 30%, transparent), transparent 60%),
  linear-gradient(135deg, var(--bark-deep), var(--surface-2)); }
.comm-head__body { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; padding: 0 var(--s4) var(--s3); margin-top: -40px; }
.comm-head__text { flex: 1 1 220px; min-width: 0; }
.comm-head__name { font-size: var(--fs-xl); overflow-wrap: anywhere; margin: 0; }
.comm-head__text p { margin: 4px 0 0; font-size: var(--fs-sm); }
.comm-head__text svg { width: 14px; height: 14px; vertical-align: -2px; }
.comm-desc { overflow-wrap: anywhere; color: var(--muted); }
.tabs { display: flex; gap: 2px; border-top: 1px solid var(--border); padding: 0 var(--s3); }
.tabs a { padding: 12px 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
.tabs a:hover { background: var(--surface-2); }
.tabs a[aria-current="page"] { color: var(--leaf); border-bottom-color: var(--leaf); }
.member-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.member { display: flex; gap: var(--s3); align-items: center; padding: 8px; border-radius: 12px; flex-wrap: wrap; }
.member:hover { background: var(--surface-2); }
.member--pending { border: 1px solid var(--border); }
.member__text { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.member__text .muted { font-size: var(--fs-xs); }
.kin-check { font-size: var(--fs-sm); color: var(--root); display: flex; gap: 4px; align-items: flex-start; }
.kin-check.is-ok { color: var(--leaf); }
.kin-check svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.member .post__menu .menu__panel button { display: block; }

/* admin */
.tabs--card { padding: 0 var(--s2); border-top: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__n { font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 700; color: var(--gold); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; }
.table form { margin: 0; }
.comm-head__text svg { display: inline-block; }
.comm-head__name { color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .55); }
