/* Widget-only rules on top of club.css. A widget page is one widget inside an iframe. */
body { min-height: 0; padding: 2px; }
.mw-transparent body { background: transparent; }
/* A dark-scheme iframe inside a light-scheme page gets an opaque backdrop from the browser;
   keep transparent widgets on the host's scheme so the page shows through. */
:root.mw-transparent { color-scheme: normal !important; }
.rise { opacity: 1; transform: none; animation: none; }       /* no entrance motion inside an iframe */
.w-main .w-head { margin-bottom: 4px; }

/* Directory */
.dir-card .nm { overflow-wrap: anywhere; }
.dir-meta { font-size: .86rem; line-height: 1.35; }
.dir-acts { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.dir-acts .dir-open { border-top: 0; padding-top: 0; }
.dir-more { display: flex; justify-content: center; margin-top: 18px; }
.dir-count { font-size: .86rem; margin: -6px 0 14px; }

/* Feed */
.meet .why { min-height: 1.2em; }
.meet .nm { overflow-wrap: anywhere; }
@media (max-width: 560px) { .meet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Side */
.w-side { max-width: 420px; }

/* Profile (sample) */
.pf { display: grid; gap: 22px; }
.pf-head { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.pf-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.pf-box { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); padding: 18px 20px; display: grid; gap: 10px; align-content: start; }
.pf-rows { display: grid; gap: 8px; font-size: .92rem; }
.pf-rows div { display: flex; gap: 10px; }
.pf-rows i { color: var(--muted); margin-top: 3px; }
@media (max-width: 720px) { .pf-grid { grid-template-columns: 1fr; } }

/* Loading and errors */
.mw-skel { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.mw-skel span { height: 168px; border-radius: var(--r-card); background: linear-gradient(90deg, var(--soft), var(--bg-alt), var(--soft)); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) { .mw-skel span { animation: mwshine 1.4s linear infinite; } }
@keyframes mwshine { to { background-position: -200% 0; } }
.mw-err { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); font-size: .92rem; }
.mw-src-note { font-size: .74rem; color: var(--faint); margin-top: 14px; }

/* People you should meet (4 cards with a coloured band) */
.pm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.pm-head .label-faint { display: block; margin-bottom: 10px; }
.pm-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.pm-more { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap; padding-bottom: 6px; }
.pm-more:hover { color: var(--accent); }
.pm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pm-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 0 14px 22px;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; text-decoration: none; color: var(--ink);
  box-shadow: 0 1px 2px var(--shadow); transition: transform .3s var(--ease), border-color .2s var(--ease), box-shadow .3s var(--ease); }
a.pm-card:hover { transform: translateY(-3px); border-color: var(--faint); box-shadow: 0 10px 24px var(--shadow); }
.pm-skel { min-height: 300px; background: linear-gradient(90deg, var(--soft), var(--bg-alt), var(--soft)); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) { .pm-skel { animation: mwshine 1.4s linear infinite; } }
.pm-band { display: block; width: calc(100% + 28px); height: 80px; margin: 0 -14px; background: linear-gradient(160deg, var(--b1), var(--b2)); }
.pm-av { position: relative; width: 80px; height: 80px; margin-top: -42px; margin-bottom: 14px; border-radius: 50%; border: 3px solid var(--surface);
  background: var(--fill); color: #fff; display: grid; place-items: center; overflow: hidden; font-size: 1.55rem; font-weight: 500; letter-spacing: .02em; }
.pm-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pm-nm { font-weight: 600; font-size: 1.12rem; line-height: 1.25; overflow-wrap: anywhere; }
.pm-role { color: var(--muted); font-size: .92rem; line-height: 1.35; }
.pm-loc { color: var(--faint); font-size: .88rem; }
.pm-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.pm-chip { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: .8rem; color: var(--muted); }
.pm-type { margin-top: 8px; border: 1px solid #7B5EA7; color: #6A4A8C; border-radius: 999px; padding: 3px 14px; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
:root[data-theme="dark"] .pm-type { border-color: #B79AE0; color: #CDB6F0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pm-type { border-color: #B79AE0; color: #CDB6F0; } }
@media (max-width: 720px) { .pm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .pm-grid { grid-template-columns: 1fr; } .pm-head { flex-wrap: wrap; } }

/* Members count (inline): avatar stack + total */
.mc { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); padding: 2px; }
a.mc:hover .mc-txt b { color: var(--accent); }
.mc-txt { font-size: .95rem; white-space: nowrap; }
.mc-txt b { font-weight: 600; color: var(--ink); }
.mc-ghost { background: var(--soft); box-shadow: 0 0 0 1px var(--line); border-color: transparent; }
.mc-bar { display: inline-block; width: 92px; height: .8em; border-radius: 6px; background: var(--soft); vertical-align: middle; }
@media (prefers-reduced-motion: no-preference) {
  .mc-wait .mc-ghost, .mc-bar { animation: mcpulse 1.2s ease-in-out infinite alternate; }
  .mc-in { animation: mcfade .35s ease-out both; }
}
@keyframes mcpulse { from { opacity: .55; } to { opacity: 1; } }
@keyframes mcfade { from { opacity: 0; } to { opacity: 1; } }
.mc-note { font-size: .85rem; }

/* Avatars: initials stay visible until the photo has loaded, then the photo fades in over them. */
.avatar img { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity .3s ease; }
.avatar img.on { opacity: 1; }
.avatar img + .ini { display: grid; }
/* On a host background (bg=transparent) the placeholders tint whatever is behind them. */
.mw-transparent .mc-ghost, .mw-transparent .mc-bar { background: color-mix(in srgb, var(--ink) 14%, transparent); box-shadow: none; }
