/* ═══════════════════════════════════════
   COMMUNITY PROFILE PAGE — cp- namespace
   Extends groups-page.css base styles
   ═══════════════════════════════════════ */

/* ── Loading & Auth States ── */
.cp-loading,
.cp-login {
  padding: 12em 2em 6em;
  max-width: 76em;
  margin: 0 auto;
  text-align: center;
}

.cp-loading__spinner {
  font-size: 1.25em;
  color: #0a0a0a80;
  font-weight: 300;
}

.cp-login__title {
  font-size: 2em;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 0.5em;
}

.cp-login__text {
  font-size: 1.125em;
  font-weight: 300;
  color: #0a0a0a80;
  margin-bottom: 1.5em;
}

.cp-login__btn {
  display: inline-block;
  padding: 0.65em 1.6em;
  font-size: 0.9375em;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  background: #0a0a0a;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}
.cp-login__btn:hover {
  background: #333;
  transform: translateY(-1px);
}

/* ── Hero ── */
.cp-hero {
  padding: 10em 2em 2em;
  width: 80%;
  max-width: 1500px;
  margin: 0 auto;
}

.cp-hero__eyebrow {
  font-size: 0.75em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #000000;
  margin-bottom: 1em;
}

.cp-hero__title {
  font-size: 3em;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #0a0a0a;
  margin: 0 0 0.15em;
}

.cp-hero__name {
  font-weight: 300;
  color: #0a0a0a60;
}

/* ── Message Banner ── */
.cp-msg {
  display: none;
  font-size: 0.875em;
  padding: 0.6em 1em;
  border-radius: 0.375em;
  max-width: 40rem;
  margin: 0 auto 1em;
}
.cp-msg.is--success {
  display: block;
  color: #166534;
  background: #dcfce7;
}
.cp-msg.is--error {
  display: block;
  color: #991b1b;
  background: #fee2e2;
}

/* ── Form Container ── */
.cp-form {
  width: 80%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 2em 4em;
}

/* ── Section Dividers ── */
.cp-section {
  padding: 2em 0 0;
}

.cp-section__title {
  font-size: 0.75em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0a0a0a70;
  margin-bottom: 1.25em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

/* ── Field Grid ── */
.cp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25em;
}

.cp-field {
  display: flex;
  flex-direction: column;
  gap: 0.375em;
}

.cp-field--full {
  grid-column: 1 / -1;
}

.cp-label {
  font-size: 0.75em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0a0a0a80;
}

.cp-input {
  padding: 0.85em 1em;
  font-size: 0.9375em;
  font-family: inherit;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 0.5em;
  background: #fff;
  color: #0a0a0a;
  transition: border-color 0.2s;
}
.cp-input:focus {
  outline: none;
  border-color: #0a0a0a;
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.06);
}
.cp-input::placeholder {
  color: #0a0a0a50;
}
.cp-input[readonly] {
  background: #f5f5f5;
  color: #0a0a0a70;
  cursor: not-allowed;
}

.cp-textarea {
  resize: vertical;
  min-height: 5em;
}

.cp-hint {
  font-size: 0.75em;
  color: #0a0a0a60;
  font-weight: 300;
}

/* ── Select ── */
.cp-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%230a0a0a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85em center;
  padding-right: 2.5em;
}
.cp-select:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f5f5f5;
}

/* ── Checkbox ── */
.cp-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5em;
  cursor: pointer;
  font-size: 0.875em;
  color: #0a0a0a;
  font-weight: 400;
}

.cp-checkbox input[type='checkbox'] {
  width: 1.125em;
  height: 1.125em;
  accent-color: #0a0a0a;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Toggle (is_published) ── */
.cp-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.75em;
}

.cp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.cp-toggle__track {
  width: 2.5em;
  height: 1.375em;
  background: #ccc;
  border-radius: 100px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.cp-toggle[aria-checked='true'] .cp-toggle__track {
  background: #0a0a0a;
}

.cp-toggle__thumb {
  position: absolute;
  top: 0.1875em;
  left: 0.1875em;
  width: 1em;
  height: 1em;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.cp-toggle[aria-checked='true'] .cp-toggle__thumb {
  transform: translateX(1.125em);
}

.cp-toggle__label {
  font-size: 0.875em;
  font-weight: 400;
  color: #0a0a0a;
}

/* ── Photo Upload ── */
.cp-photo-zone {
  display: flex;
  align-items: center;
  gap: 1em;
}

.cp-photo-preview {
  width: 5em;
  height: 5em;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.cp-photo-placeholder {
  width: 5em;
  height: 5em;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0a0a40;
  cursor: pointer;
  transition: background 0.2s;
}
.cp-photo-placeholder:hover {
  background: #e5e7eb;
}

.cp-photo-actions {
  display: flex;
  gap: 0.5em;
}

.cp-photo-btn {
  padding: 0.4em 0.75em;
  font-size: 0.8125em;
  font-family: inherit;
  font-weight: 500;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.375em;
  cursor: pointer;
  transition: background 0.2s;
}
.cp-photo-btn:hover {
  background: rgba(0, 0, 0, 0.03);
}

.cp-photo-btn--remove {
  color: #dc2626;
  border-color: transparent;
}
.cp-photo-btn--remove:hover {
  background: #fee2e2;
}

/* ── Save Button ── */
.cp-save-wrap {
  padding-top: 2em;
  display: flex;
  justify-content: flex-end;
}

.cp-save-btn {
  display: inline-block;
  padding: 0.65em 1.6em;
  font-size: 0.9375em;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  background: #0a0a0a;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}
.cp-save-btn:hover:not(:disabled) {
  background: #333;
  transform: translateY(-1px);
}
.cp-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Skills ── */

.cp-tags-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375em;
  margin-top: 0.5em;
}

.cp-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375em;
  padding: 0.25em 0.625em;
  font-size: 0.8125em;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 100px;
  color: #0a0a0a;
}

.cp-tag-pill__remove {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1em;
  line-height: 1;
  color: #0a0a0a60;
  padding: 0;
}
.cp-tag-pill__remove:hover {
  color: #dc2626;
}

/* ── Content Tabs ── */
.cp-tabs {
  width: 80%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 2em 2em 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 2.5em;
}

.cp-tab {
  padding-bottom: 1em;
  font-size: 0.9375em;
  font-weight: 400;
  color: #0a0a0a50;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  transition: color 0.2s;
}
.cp-tab:hover {
  color: #0a0a0a;
}
.cp-tab.is--active {
  color: #0a0a0a;
}
.cp-tab.is--active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #0a0a0a;
}

.cp-tab__count {
  font-size: 0.75em;
  font-weight: 500;
  background: #0a0a0a10;
  color: #0a0a0a80;
  padding: 0.15em 0.5em;
  border-radius: 100px;
  margin-left: 0.25em;
}

/* ── Tab Panels ── */
.cp-panel {
  display: none;
  width: 80%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 2em 2em 4em;
}
.cp-panel.is--active {
  display: block;
}

/* Slider panel: full-width dark host for OSMO slider */
.cp-panel--slider {
  width: 100%;
  max-width: none;
  padding: 0;
}

.cp-slider-host {
  width: 100%;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 0.75rem;
  overflow: hidden;
}
.cp-slider-host .os-wrap {
  padding: 2rem 0 3rem;
}
/* Constrain the slider host */
.cp-panel--slider .cp-slider-host {
  width: 80%;
  max-width: 1500px;
  margin: 2em auto;
}

/* Override os- colors for white background context */
.cp-slider-host .os-title {
  color: #0a0a0a;
}
.cp-slider-host .os-count {
  color: #0a0a0a60;
}
.cp-slider-host .os-add-btn {
  background: #0a0a0a;
  color: #fff;
}
.cp-slider-host .os-add-btn:hover {
  background: #333;
}
.cp-slider-host .os-nav-btn {
  background: #0a0a0a;
  color: #fff;
}
.cp-slider-host .os-nav-btn:disabled {
  opacity: 0.3;
}
.cp-slider-host .os-empty {
  color: #0a0a0a60;
}

.cp-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5em;
}

.cp-panel__title {
  font-size: 0.75em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0a0a0a70;
  margin: 0;
}

/* ── Card Grid (synced with community page pattern) ── */
.cp-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16em, 1fr));
  gap: 1rem;
}

.cp-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.04);
  transition:
    box-shadow 0.2s,
    transform 0.2s;
}
.cp-card:hover {
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.08);
  transform: translateY(-0.125rem);
}
a.cp-card {
  text-decoration: none;
  color: inherit;
}

.cp-card__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.5rem;
}

.cp-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: #0a0a0a;
  margin: 0;
}

.cp-card__meta {
  font-size: 0.8125em;
  color: #888;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cp-card__tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.125rem 0.5rem;
  border-radius: 100px;
  background: #0a0a0a;
  color: #fff;
}

/* ── Empty state (reused in panels) ── */
.cp-list__empty {
  padding: 2em 0;
  text-align: center;
  color: #0a0a0a60;
  font-size: 0.9375em;
  font-weight: 300;
}

/* ── View Mode Hero ── */
.cp-view {
  width: 80%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 10em 2em 2em;
}

.cp-view-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3em;
  align-items: start;
}

.cp-view-hero__info {
  min-width: 0;
}

.cp-view-hero__major {
  font-size: 0.75em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #0a0a0a60;
  margin-bottom: 0.75em;
}

.cp-view-hero__name {
  font-size: 3em;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #0a0a0a;
  margin: 0 0 0.25em;
}

.cp-view-hero__bio {
  font-size: 1.125em;
  font-weight: 300;
  line-height: 1.6;
  color: #0a0a0a80;
  margin-bottom: 1em;
  max-width: 40em;
}

.cp-view-hero__website {
  margin-bottom: 1em;
}
.cp-view-hero__website a {
  font-size: 0.9375em;
  color: #0a0a0a;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.cp-view-hero__website a:hover {
  color: #555;
}

.cp-view-hero__socials {
  display: flex;
  gap: 0.625em;
  flex-wrap: wrap;
  margin-bottom: 1.5em;
}

.cp-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25em;
  height: 2.25em;
  border-radius: 50%;
  background: #0a0a0a;
  color: #fff;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.cp-social-icon:hover {
  background: #333;
  transform: translateY(-1px);
}
.cp-social-icon svg {
  width: 1em;
  height: 1em;
}

.cp-view-hero__photo-col {
  flex-shrink: 0;
}

.cp-view-hero__photo {
  width: 16em;
  height: 16em;
  border-radius: 1em;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ── Edit Button ── */
.cp-edit-btn {
  display: inline-block;
  padding: 0.65em 1.6em;
  font-size: 0.9375em;
  font-weight: 500;
  font-family: inherit;
  color: #fff;
  background: #0a0a0a;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.cp-edit-btn:hover {
  background: #333;
  transform: translateY(-1px);
}

/* ── Edit Back Link ── */
.cp-edit-back-wrap {
  width: 80%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 8em 2em 0;
}

.cp-edit-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375em;
  font-size: 0.875em;
  font-weight: 400;
  color: #0a0a0a80;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: color 0.2s;
}
.cp-edit-back:hover {
  color: #0a0a0a;
}

/* ── Error State ── */
.cp-error {
  padding: 12em 2em 6em;
  max-width: 76em;
  margin: 0 auto;
  text-align: center;
}

/* ── Docs Panel ── */
.cp-docs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.cp-doc-row {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 0.75em 1em;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.5em;
  transition: box-shadow 0.2s;
}
.cp-doc-row:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cp-doc-row__name {
  font-size: 0.9375em;
  font-weight: 500;
  color: #0a0a0a;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cp-doc-row__type {
  font-size: 0.75em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0a0a0a60;
}

.cp-doc-row__dl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4em 0.75em;
  font-size: 0.8125em;
  font-weight: 500;
  font-family: inherit;
  background: #0a0a0a;
  color: #fff;
  border: none;
  border-radius: 0.375em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}
.cp-doc-row__dl:hover {
  background: #333;
}

/* ═══ RESPONSIVE ═══ */

@media screen and (max-width: 991px) {
  .cp-hero__title {
    font-size: 2.5em;
  }
  .cp-view-hero__name {
    font-size: 2.5em;
  }
  .cp-view-hero__photo {
    width: 12em;
    height: 12em;
  }
}

@media screen and (max-width: 767px) {
  .cp-view {
    width: 100%;
    padding: 8em 1em 1.5em;
  }
  .cp-view-hero {
    grid-template-columns: 1fr;
  }
  .cp-view-hero__photo {
    width: 10em;
    height: 10em;
  }
  .cp-view-hero__name {
    font-size: 2em;
  }
  .cp-edit-back-wrap {
    width: 100%;
    padding: 6em 1em 0;
  }

  .cp-hero {
    padding: 8em 1em 1.5em;
  }

  .cp-form {
    padding: 0 1em 3em;
  }

  .cp-tabs {
    width: 100%;
    padding: 1.5em 1em 0;
    gap: 1.5em;
  }

  .cp-panel {
    width: 100%;
    padding: 1.5em 1em 3em;
  }

  .cp-panel--slider {
    padding: 0;
  }

  .cp-panel--slider .cp-slider-host {
    width: 100%;
    border-radius: 0;
    margin: 1em auto;
  }

  .cp-card-grid {
    grid-template-columns: 1fr;
  }

  .cp-hero__title {
    font-size: 2em;
  }

  .cp-grid {
    grid-template-columns: 1fr;
  }

  .cp-photo-zone {
    flex-direction: column;
    align-items: flex-start;
  }
}
