/* Member area + community (pages_member.py). Builds on .dash / .community from site.css. */

.cm-foot a { text-decoration: underline; text-underline-offset: 3px; }
.cm-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-clamp1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cm-ltr-title { font-size: var(--fs-lg); line-height: 1.35; text-align: start; unicode-bidi: plaintext; }

/* Dashboard layout */
.cm-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 16px; }
.cm-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cm-grid h2, .cm-grid-2 h2 { font-size: var(--fs-md); }

.cm-resume { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 22px; align-items: center; }
.cm-resume-media { position: relative; border-radius: var(--r-sm); overflow: hidden; aspect-ratio: 4 / 3; background: #000; }
.cm-resume-media img { width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.cm-play { position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%; background: var(--signal); color: var(--on-signal); display: grid; place-items: center; }
.cm-play svg { width: 24px; height: 24px; }
[dir="rtl"] .cm-play svg { transform: scaleX(-1); }
.cm-resume .cm-ltr-title { font-size: var(--fs-md); }

/* Ticket: the forest gradient carries the event, a perforation splits it from the QR stub */
.cm-ticket { display: flex; flex-direction: column; border-radius: var(--r-md); overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
html[data-theme="night"] .cm-ticket { background: var(--raised); }
.cm-ticket-top { padding: 22px; color: #fff; background: linear-gradient(150deg, var(--forest), var(--forest-deep)); flex: 1; }
.cm-ticket-top .xs { color: var(--signal); font-weight: 600; }
.cm-ticket-top h2 { color: #fff; margin: 6px 0 12px; font-size: var(--fs-md); }
.cm-ticket-top .meta { color: rgba(255,255,255,.78); }
.cm-ticket-cut { height: 0; border-top: 2px dashed var(--line-strong); margin-inline: 14px; position: relative; }
.cm-ticket-cut::before, .cm-ticket-cut::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--raised); }
html[data-theme="night"] .cm-ticket-cut::before, html[data-theme="night"] .cm-ticket-cut::after { background: var(--bg); }
.cm-ticket-cut::before { inset-inline-start: -25px; }
.cm-ticket-cut::after { inset-inline-end: -25px; }
.cm-ticket-bottom { display: flex; gap: 16px; align-items: center; padding: 18px 22px; }
.cm-ticket-bottom b { font-size: var(--fs-sm); letter-spacing: .02em; }
.cm-qr {
  width: 86px; height: 86px; flex: none; border-radius: 8px; padding: 6px; background: #fff;
  border: 1px solid var(--line);
  background-image:
    repeating-conic-gradient(#101010 0 25%, transparent 0 50%),
    linear-gradient(#fff, #fff);
  background-size: 14px 14px, 100% 100%;
  background-origin: content-box;
  background-clip: content-box;
  mask: none;
  position: relative;
}
.cm-qr::before, .cm-qr::after { content: ""; position: absolute; width: 24px; height: 24px; border: 5px solid #101010; background: #fff; border-radius: 4px; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 10px #101010; }
.cm-qr::before { top: 4px; inset-inline-start: 4px; }
.cm-qr::after { bottom: 4px; inset-inline-end: 4px; }

/* Small list cards (recommended, products upsell) */
.cm-mini { display: flex; align-items: center; gap: 14px; padding: 10px; margin-inline: -10px; border-radius: var(--r-sm); }
.cm-mini:hover { background: var(--raised); }
html[data-theme="night"] .cm-mini:hover { background: var(--raised-2); }
.cm-mini .grow { flex: 1; min-width: 0; }
.cm-mini .grow b { display: block; font-size: var(--fs-sm); }
.cm-swatch { width: 52px; height: 52px; aspect-ratio: auto; padding: 0; border-radius: 12px; flex: none; }

/* My learning */
.cm-track { display: flex; gap: 20px; align-items: flex-start; }
.cm-track .cm-swatch { width: 96px; height: 96px; border-radius: 16px; }
.cm-track .grow { flex: 1; min-width: 0; }
.cm-add { display: flex; align-items: center; justify-content: center; gap: 10px; border-style: dashed; border-color: var(--line-strong); color: var(--slate); font-weight: 500; background: transparent !important; }
.cm-add:hover { color: var(--ink); border-color: var(--ink); }
.cm-add svg { width: 20px; height: 20px; }

/* Recordings */
.cm-seg-sep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--line-strong); }
.cm-rec .photo-top { position: relative; }
.cm-rec .chip { position: absolute; top: 12px; inset-inline-start: 12px; display: inline-flex; gap: 6px; align-items: center; }
.cm-rec .chip svg { width: 14px; height: 14px; }
.cm-dur { position: absolute; bottom: 10px; inset-inline-end: 10px; padding: 2px 8px; border-radius: 6px; font-size: 12px; color: #fff; background: rgba(0,0,0,.65); }
.cm-rec h3 { line-height: 1.5; min-height: 3em; }
.cm-rec .card-body { display: grid; gap: 10px; }

/* Masterclass */
.cm-lesson { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.cm-lessons-box { position: sticky; top: calc(var(--header-h) + 24px); }
.cm-lessons-box .lessons a span:first-of-type { flex: 1; min-width: 0; text-align: start; }
.cm-lesson .player .locked h2 { color: #fff; font-size: var(--fs-lg); }
.cm-lesson textarea.input { min-height: 120px; resize: vertical; }
.cm-file { display: grid; place-items: center; width: 48px; color: var(--signal-text); }
.cm-file svg { width: 22px; height: 22px; }

/* Products */
.cm-prod .cover { padding: 18px; }

/* Profile */
.cm-pick { position: relative; cursor: pointer; }
.cm-pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.cm-pick span { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: var(--fs-sm); color: var(--ink-2); transition: background .15s, border-color .15s; }
.cm-pick input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.cm-pick input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }
.field input[readonly] { background: var(--raised); color: var(--slate); }
.cm-toggle { cursor: pointer; position: relative; }
.cm-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cm-switch { width: 44px; height: 26px; border-radius: 99px; background: var(--raised-2); border: 1px solid var(--line-strong); position: relative; flex: none; transition: background .15s; }
.cm-switch::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: inset-inline-start .15s; }
.cm-toggle input:checked + .cm-switch { background: var(--signal); border-color: var(--signal); }
.cm-toggle input:checked + .cm-switch::after { inset-inline-start: 20px; }
.cm-toggle input:focus-visible + .cm-switch { outline: 2px solid var(--signal); outline-offset: 2px; }
.cm-danger { border-color: rgba(220, 60, 60, .35); }
.cm-danger-btn { color: #c23b3b; border-color: rgba(220, 60, 60, .45); }
html[data-theme="night"] .cm-danger-btn { color: #ff7a7a; }

/* Community */
.cm-community { background: var(--raised); min-height: calc(100vh - var(--header-h)); }
html[data-theme="night"] .cm-community { background: var(--bg); }
.cm-community .c-nav { position: sticky; top: calc(var(--header-h) + 28px); align-self: start; }
.cm-community .c-aside { position: sticky; top: calc(var(--header-h) + 28px); align-self: start; }
.cm-h5 { margin: 0 0 4px; padding-inline: 12px; font-size: var(--fs-xs); color: var(--slate); font-weight: 500; }
.channels .hash svg { margin: 0; width: 15px; height: 15px; }
.channels a .grow { flex: 1; }
.channels .count { margin-inline-start: auto; background: var(--signal); color: var(--on-signal); padding: 0 7px; border-radius: 99px; font-weight: 600; }
.cm-chan-head { padding: 0; overflow: hidden; }
.cm-chan-head > .row { padding: 0 20px 18px; }
.cm-cover { height: 132px; overflow: hidden; }
.cm-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.cm-chan-cover { aspect-ratio: auto; height: 132px; border-radius: 0; justify-content: flex-end; }
.cm-h1 { font-size: var(--fs-lg); }
.c-feed > .composer { margin-top: 14px; }
.post .pin { display: inline-flex; gap: 6px; align-items: center; font-size: var(--fs-xs); font-weight: 600; color: var(--signal-text); margin-bottom: 12px; }
.post .pin svg { width: 14px; height: 14px; }
.post-img img { width: 100%; max-height: 340px; object-fit: cover; display: block; }
.post-actions [aria-pressed="true"] { color: #e0245e; }
.post-actions [aria-pressed="true"] svg { fill: currentColor; }
.cm-staff { background: #101010; padding: 7px; }
.cm-staff img { width: 100%; height: 100%; object-fit: contain; }
.cm-ev { border-radius: var(--r-sm); overflow: hidden; aspect-ratio: 16 / 9; }
.cm-ev img { width: 100%; height: 100%; object-fit: cover; }
.cm-switcher { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding: 10px 14px; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); }
.cm-gate-wait .badge-ico { background: rgba(255, 194, 77, .2); color: #a87400; }
html[data-theme="night"] .cm-gate-wait .badge-ico { color: #ffc24d; }
.cm-gate-bad .badge-ico { background: rgba(220, 60, 60, .14); color: #c23b3b; }
html[data-theme="night"] .cm-gate-bad .badge-ico { color: #ff7a7a; }
.gate { background: var(--bg); }
html[data-theme="night"] .gate { background: var(--raised); }

@media (max-width: 1180px) {
  .cm-grid, .cm-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .cm-lesson { grid-template-columns: minmax(0, 1fr); }
  .cm-lessons-box { position: static; }
}
@media (max-width: 640px) {
  .cm-resume { grid-template-columns: minmax(0, 1fr); }
  .cm-track { flex-direction: column; }
  .cm-track .cm-swatch { width: 100%; height: 64px; }
  .cm-community .community { padding-top: 16px; }
  .cm-chan-head > .row { flex-direction: column; align-items: flex-start; }
  .dash-main .table-wrap { margin-inline: calc(-1 * clamp(24px, 3vw, 40px)); border-radius: 0; }
}

/* Fixes after visual QA */
[dir="rtl"] .cm-ltr-title { text-align: right; }
.dash-side { gap: 16px; }
.dash-group a { padding-block: 8px; }
.post-img img { height: 300px; max-height: none; }
.cm-community .channels.stack-xs { gap: 2px; }
@media (max-width: 640px) { .post-img img { height: 200px; } }
.cm-rec h3 { font-size: var(--fs-sm); font-weight: 600; }
.c-feed .gate h2 { font-size: var(--fs-lg); }
@media (max-width: 640px) {
  .cm-mini { flex-wrap: wrap; }
  .cm-mini .grow { flex: 1 1 calc(100% - 80px); }
  .cm-mini .chip { margin-inline-start: 66px; }
}
.list-row b, .list-row .grow b { unicode-bidi: plaintext; }
