/*
 * MewUI — mymewgem only (MGCS-123). Loaded AFTER mewui.css, the shared core that is identical
 * in every site. Rules here are either used only by this site, or deliberately override a
 * shared rule for it. Something two sites need belongs in the core instead.
 */

.mu-sidebar-heading {
    margin: 0.9rem 0.9rem 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mu-text-muted);
    opacity: 0.85;
}

/* ─── Membership ring effects ─── */

@keyframes mu-ring-glow {
    0%, 100% { box-shadow: 0 0 8px 2px var(--mu-ring-color, #a259ff); }
    50% { box-shadow: 0 0 16px 4px var(--mu-ring-color, #a259ff); }
}

.mu-avatar.mu-ring-plus {
    --mu-ring-color: #a259ff;
    border-color: #a259ff;
    animation: mu-ring-glow 2.5s ease-in-out infinite;
}

.mu-avatar.mu-ring-pro {
    border: 3px solid transparent;
    background-clip: padding-box;
    box-shadow: 0 0 0 3px #ffd700, 0 0 12px 3px rgba(255, 215, 0, 0.3);
    animation: mu-ring-glow 2s ease-in-out infinite;
    --mu-ring-color: #ffd700;
}

/* Any other tier with the animated ring feature (MGCS-63). The two above are named styles
   from when the client knew the tier ids; a tier staff add later glows in its own colour
   rather than not at all. */
.mu-avatar.mu-ring-glow {
    --mu-ring-color: var(--mu-ring-glow-color, #a259ff);
    border-color: var(--mu-ring-glow-color, #a259ff);
    animation: mu-ring-glow 2.5s ease-in-out infinite;
}

/* ─── Gradient & image ring wrappers ─── */

.mu-ring-gradient-wrap,
.mu-ring-image-wrap {
    display: inline-block;
    padding: 4px;
    border-radius: var(--mu-border-radius-full);
    margin-top: -100px;
}

.mu-ring-gradient-inner,
.mu-ring-image-inner {
    border: none !important;
    margin: 0 !important;
    background: var(--mu-background, #1a1a2e);
    display: block;
}

.mu-ring-image-wrap {
    background-size: cover;
    background-position: center;
}

/* MewUI v1.0.0 */

/* ---- signup: honeypot and captcha ------------------------------------------
   The honeypot is moved off-screen rather than display:none. Simple scrapers skip
   display:none inputs, and the whole point is that they should fill this one in.
   Everything here keeps it away from people: it is aria-hidden in the markup, has no
   tab stop, and takes no space in the layout. */
.mu-honeypot {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.mu-captcha-image {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto var(--mu-space-sm);
    border: 2px solid var(--mu-border-color);
    border-radius: var(--mu-border-radius-sm);
    /* The image is rendered on a light ground so the characters stay legible; the frame
       is what ties it to the dark card around it. */
    background: #f4f4f8;
}

.mu-captcha-help {
    display: flex;
    flex-direction: column;
    gap: var(--mu-space-xs);
    margin-top: var(--mu-space-xs);
    text-align: center;
}

/* `hidden` on the group must win over any display rule the form styles apply, or the
   captcha would be visible to everyone before it is ever needed. */
.mu-captcha[hidden] {
    display: none;
}

/* ─── Profile sections (MGCS-82) ─── */

/* Drawn by assets/scripts/profilesections.js, on the public profile and in the editor's
   preview. One stylesheet for both, so the preview cannot flatter the real thing. */
.mu-section { margin-bottom: var(--mu-space-md); }

.mu-section-text { color: var(--mu-text); overflow-wrap: anywhere; }

.mu-section-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mu-space-sm);
}

.mu-section-link {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--mu-border-color);
    border-radius: var(--mu-border-radius-full);
    color: var(--mu-text-bright);
    /* A label can be sixty characters of anything, including one long word. */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mu-section-link:hover { border-color: var(--mu-primary); }

.mu-section-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--mu-space-sm);
}

.mu-section-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: var(--mu-border-radius-sm);
    background: var(--mu-surface-light);
}

.mu-section-space {
    display: flex;
    align-items: center;
    gap: var(--mu-space-md);
}

.mu-section-space-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--mu-border-radius);
    object-fit: cover;
}

/* A section the owner has saved but cannot currently show — over their tier limit, or a
   lapsed membership. Only ever seen in the editor; visitors are sent the visible ones. */
/* Sections placed freely on the profile, like CES elements (see profilesections.js). Across
   is a share of the width, down is pixels; a card that is shorter than its content scrolls
   inside itself rather than spilling over the one below. */
.mu-section-board { position: relative; }
.mu-section-board > .mu-section {
    margin: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}
.mu-section-board > .mu-section > .mu-card-body { flex: 1; min-height: 0; overflow: auto; }
.mu-section-stacked > .mu-section { margin-bottom: var(--mu-space-md); }

/* The editor's board: a grid to place against, a cover over each card so a drag is a drag and
   not a click on the link or embed underneath, and a corner to resize from. */
.mu-section-board.mu-section-editing {
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 5% 40px;
    border: 1px dashed var(--mu-border-color);
    border-radius: var(--mu-border-radius);
    min-height: 200px;
}
.mu-section-grab {
    position: absolute; inset: 0; z-index: 2;
    cursor: move; touch-action: none;
    border-radius: inherit;
}
.mu-section-editing > .mu-section:hover .mu-section-grab,
.mu-section-grab.mu-dragging { outline: 2px solid var(--mu-primary); outline-offset: -2px; }
.mu-section-resize {
    position: absolute; right: 0; bottom: 0; z-index: 3;
    width: 18px; height: 18px;
    cursor: nwse-resize; touch-action: none;
    background: linear-gradient(135deg, transparent 50%, var(--mu-primary) 50%);
    border-bottom-right-radius: var(--mu-border-radius);
}
.mu-section-star { color: var(--mu-text-muted, #888); }
.mu-section-star.mu-on { color: var(--mu-warning, #f5c518); }

/* A business org's card on its public profile (MGCS-100). */
.mu-org-business { margin-top: var(--mu-space-md); }

.mu-section-locked {
    opacity: 0.55;
    border-style: dashed;
}

/* A gallery image at full size, over the page rather than away from it. */
.mu-section-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--mu-space-lg);
    cursor: zoom-out;
}

.mu-section-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: var(--mu-border-radius);
}

/* ============================================
   PROFILE EDITOR (/profile, MGCS-121)
   Grouped editor on the left, the public card as a live preview on the right; on a phone the
   preview folds away above the groups and the tab bar sticks under the navbar.
   ============================================ */
.mu-profile-tabs {
    position: sticky;
    top: var(--mu-navbar-height);
    z-index: 20;
    display: flex;
    gap: var(--mu-space-xs);
    overflow-x: auto;
    padding: 6px;
    margin-bottom: var(--mu-space-md);
    background: var(--mu-background);
    border: 1px solid var(--mu-border-color);
    border-radius: var(--mu-border-radius);
    scrollbar-width: none;
}
.mu-profile-tabs a {
    flex: 0 0 auto;
    padding: 6px 14px;
    border-radius: var(--mu-border-radius-full);
    color: var(--mu-text);
    text-decoration: none;
    font-size: var(--mu-font-size-sm);
}
.mu-profile-tabs a:hover { color: var(--mu-primary); }
.mu-profile-tabs a.mu-active { background: var(--mu-primary); color: var(--mu-background); font-weight: 600; }

.mu-profile-editor {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--mu-space-lg);
    align-items: start;
}
@media (min-width: 1025px) {
    .mu-profile-editor { grid-template-columns: minmax(0, 1fr) 340px; }
    .mu-profile-preview-col { order: 2; position: sticky; top: calc(var(--mu-navbar-height) + 64px); }
}

.mu-profile-group {
    scroll-margin-top: calc(var(--mu-navbar-height) + 64px);
    margin-bottom: var(--mu-space-xl);
}
.mu-profile-group .mu-card { margin-bottom: var(--mu-space-md); }
.mu-profile-group-title {
    font-size: var(--mu-font-size-lg);
    color: var(--mu-text-bright);
    margin: 0 0 var(--mu-space-sm);
}

.mu-profile-preview > summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--mu-text-bright);
    margin-bottom: var(--mu-space-sm);
}
.mu-profile-preview-card {
    overflow: hidden;
    border-radius: var(--mu-border-radius-lg);
    border: 1px solid var(--mu-border-color);
    background: var(--mu-surface);
    color: var(--mu-text);
}
.mu-profile-preview-banner { display: block; width: 100%; height: 110px; object-fit: cover; }
.mu-profile-preview-body { padding: 0 var(--mu-space-md) var(--mu-space-md); text-align: center; margin-top: -56px; }
.mu-profile-preview-body .mu-avatar-lg { width: 112px; height: 112px; }
.mu-profile-preview-flair { margin-left: 2px; }
.mu-profile-preview-status { font-size: var(--mu-font-size-sm); opacity: 0.9; margin-bottom: var(--mu-space-sm); overflow-wrap: anywhere; }
.mu-profile-preview-bio { font-size: var(--mu-font-size-sm); overflow-wrap: anywhere; white-space: pre-line; }
/* The bio box is multi-line now (MGCS-121); line breaks show as typed. */
.mu-profile-bio-text { white-space: pre-line; }
.mu-profile-preview-status:empty::before { content: 'No status set'; opacity: 0.6; }
.mu-profile-preview-bio:empty::before { content: 'No bio set'; opacity: 0.6; }

.mu-profile-uploads {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--mu-space-md);
}

.mu-color-input { width: 50px; height: 40px; padding: 2px; flex: none; }

.mu-profile-advanced > summary { cursor: pointer; list-style-position: inside; }

.mu-section-link-row > .mu-input { flex: 1 1 140px; min-width: 0; }

/* ── Dashboard (MGCS-135) ── phone width first: one column, then wider tiles. */
.mu-dash { max-width: 960px; }
.mu-dash-hello {
    display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
    gap: var(--mu-space-sm); margin-bottom: var(--mu-space-lg);
}
.mu-dash-hello-link { font-size: var(--mu-font-size-sm); color: var(--mu-text-muted); text-decoration: none; }
.mu-dash-hello-link:hover { color: var(--mu-text); text-decoration: underline; }
.mu-dash-section { margin-bottom: var(--mu-space-lg); }
.mu-dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--mu-space-sm); }
.mu-dash-title { margin: 0 0 var(--mu-space-sm); }
.mu-dash-more { font-size: var(--mu-font-size-sm); color: var(--mu-text-muted); }
.mu-dash-count:not(:empty) {
    display: inline-block; min-width: 1.5em; padding: 0 6px; margin-left: 4px; border-radius: 999px;
    background: var(--mu-primary); color: var(--mu-background); font-size: var(--mu-font-size-sm);
    text-align: center; vertical-align: middle;
}
.mu-dash-pad { padding: var(--mu-space-md); }
.mu-dash-list > .mu-dash-row + .mu-dash-row { border-top: 1px solid var(--mu-border-color); }
.mu-dash-row {
    display: flex; align-items: center; gap: var(--mu-space-md); padding: var(--mu-space-md);
    flex-wrap: wrap; color: inherit; text-decoration: none;
}
.mu-dash-row-link:hover { background: var(--mu-surface-light); }
/* An event row is date, text, tag: it stays on one line, the text taking what is left. */
.mu-dash-row-link { flex-wrap: nowrap; }
.mu-dash-row-link .mu-dash-row-text { flex: 1 1 auto; }
.mu-dash-row-icon {
    width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--mu-surface-light); overflow: hidden;
}
.mu-dash-row-icon .mu-avatar { width: 40px; height: 40px; }
.mu-dash-row-text { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.mu-dash-row-main { font-weight: 600; }
.mu-dash-row-actions { display: flex; gap: var(--mu-space-sm); margin-left: auto; }
.mu-dash-date {
    width: 44px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-radius: var(--mu-border-radius); background: var(--mu-surface-light); padding: 4px 0; line-height: 1.1;
}
.mu-dash-date-mon { font-size: 0.7rem; text-transform: uppercase; opacity: 0.8; }
.mu-dash-date-day { font-size: 1.2rem; font-weight: 700; }
.mu-dash-tag {
    flex: none; font-size: var(--mu-font-size-sm); padding: 2px 10px; border-radius: 999px;
    border: 1px solid var(--mu-border-color); color: var(--mu-text-muted);
}
.mu-dash-tag-strong { border-color: var(--mu-primary); color: var(--mu-primary); }
.mu-dash-empty {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: var(--mu-space-sm); padding: var(--mu-space-md);
}
.mu-dash-spaces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--mu-space-sm); }
.mu-dash-spaces > .mu-dash-empty, .mu-dash-spaces > p { grid-column: 1 / -1; }
.mu-dash-space {
    display: flex; align-items: center; gap: var(--mu-space-sm); padding: var(--mu-space-sm);
    color: inherit; text-decoration: none; min-width: 0; margin: 0;
}
.mu-dash-space:hover { background: var(--mu-surface-light); }
.mu-dash-space-icon {
    width: 36px; height: 36px; flex: none; border-radius: 10px; overflow: hidden;
    display: flex; align-items: center; justify-content: center; font-weight: 700;
    background: var(--mu-surface-light);
}
.mu-dash-space-icon img { width: 100%; height: 100%; object-fit: cover; }
.mu-dash-space-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mu-dash-space-fav { font-size: 0.75rem; color: var(--mu-highlight); }
.mu-dash-steps { display: grid; grid-template-columns: 1fr; gap: var(--mu-space-sm); }
.mu-dash-step {
    display: flex; flex-direction: column; gap: 4px; padding: var(--mu-space-md); margin: 0;
    color: inherit; text-decoration: none;
}
.mu-dash-step > i { font-size: 1.25rem; color: var(--mu-primary); }
.mu-dash-step:hover { background: var(--mu-surface-light); }
.mu-dash-news { margin-bottom: var(--mu-space-sm); }
.mu-dash-news-body { margin-top: var(--mu-space-sm); overflow-wrap: anywhere; }
.mu-dash-news-image { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--mu-border-radius); margin-top: var(--mu-space-sm); }
@media (min-width: 769px) {
    .mu-dash-spaces { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mu-dash-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Organizations (MGCS-136): the list, the org page and its sections. ── */
.mu-org-page { max-width: 960px; }
.mu-org-back {
    display: inline-flex; align-items: center; gap: 6px; margin-bottom: var(--mu-space-md);
    font-size: var(--mu-font-size-sm); color: var(--mu-text-muted); text-decoration: none;
}
.mu-org-back:hover { color: var(--mu-text); }
/* Declared after .mu-hidden, so it would otherwise win over it. */
.mu-org-back.mu-hidden { display: none; }
.mu-org-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--mu-space-md); margin-bottom: var(--mu-space-sm); }
.mu-org-head-names { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.mu-org-head-actions { display: flex; flex-wrap: wrap; gap: var(--mu-space-sm); }
.mu-org-acting { font-size: var(--mu-font-size-sm); color: var(--mu-text-muted); margin: 0 0 var(--mu-space-md); }
.mu-org-verified { color: #3b9dff; }
.mu-org-warn { color: var(--mu-warning); }
.mu-org-section { margin-bottom: var(--mu-space-lg); }
.mu-org-section-title { margin: 0 0 var(--mu-space-sm); }
.mu-org-subtitle { margin: var(--mu-space-md) 0 var(--mu-space-sm); }
.mu-org-label { display: block; margin-bottom: var(--mu-space-sm); }
.mu-org-choice { display: flex; align-items: center; gap: var(--mu-space-sm); cursor: pointer; }
.mu-org-msg { font-size: var(--mu-font-size-sm); margin: var(--mu-space-sm) 0; color: var(--mu-primary); }
.mu-org-msg.mu-org-msg-bad { color: var(--mu-danger); }
.mu-org-list { margin: 0; overflow: hidden; }
.mu-org-list > .mu-org-row + .mu-org-row { border-top: 1px solid var(--mu-border-color); }
.mu-org-row {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: var(--mu-space-sm); padding: var(--mu-space-sm) var(--mu-space-md); margin: 0;
}
.mu-org-row-main { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.mu-org-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--mu-space-sm); }
.mu-org-select { width: auto; max-width: 220px; }
.mu-org-inline { display: flex; flex-wrap: wrap; gap: var(--mu-space-sm); }
.mu-org-inline > .mu-input { flex: 1 1 160px; }
.mu-org-input-short { max-width: 220px; }
.mu-org-perms { display: grid; gap: 4px; margin-bottom: var(--mu-space-sm); }
.mu-org-perm { display: flex; align-items: center; gap: var(--mu-space-sm); cursor: pointer; }
.mu-org-perm-locked { opacity: 0.55; cursor: not-allowed; }
.mu-org-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--mu-space-sm); }
.mu-org-plans > .mu-card { margin: 0; }
.mu-org-invite-card { border-left: 3px solid var(--mu-primary); }
.mu-org-card-head { display: flex; align-items: center; gap: var(--mu-space-sm); margin-bottom: var(--mu-space-sm); color: inherit; text-decoration: none; }
.mu-org-card-names { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) {
    .mu-org-select, .mu-org-input-short { max-width: none; flex: 1 1 100%; }
}
