/* Member profile — Figma "Member Page Remastered" (desktop 1440, tablet
   1023, mobile 480). Public 3:19117, Member 3:11157, Staff 3:2688. */

.member-profile {
  background-color: var(--secan-white);
}

/* Tab bar ---------------------------------------------------------------- */

.member-profile__tabs {
  padding-top: var(--secan-space-s);
  border-bottom: 1px solid var(--secan-divider);
  background-color: var(--secan-white);
}

.member-profile__tabs-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--secan-space-12xl);
}

.member-profile__tabs .tabs--underline .tabs__list {
  border-bottom: 0;
}

/* Body and panels -------------------------------------------------------- */

.member-profile__body {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--secan-space-2xl);
  box-sizing: content-box;
}

.member-profile__panel:focus-visible {
  outline: none;
  box-shadow: var(--secan-focus-ring);
}

.member-profile__stack {
  display: flex;
  flex-direction: column;
  gap: var(--secan-space-l);
  min-width: 0;
}

/* Cards ------------------------------------------------------------------ */

.member-profile__card {
  min-width: 0;
  padding: var(--secan-space-l);
  border: 1px solid var(--secan-chip-bg);
  border-radius: var(--secan-radius-3);
  background-color: var(--secan-white);
}

.member-profile__card--flush {
  padding: 0;
  overflow: hidden;
}

.member-profile__card-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--secan-space-s);
  margin: 0 0 var(--secan-space-s);
  padding-bottom: var(--secan-space-xxs);
  border-bottom: 1px solid var(--secan-modal-bg);
  font-family: var(--secan-font-body);
  font-size: var(--secan-fs-body);
  font-weight: var(--secan-fw-medium);
  line-height: var(--secan-lh-body);
  color: var(--secan-black);
}

.member-profile__card-title {
  margin: 0;
  font: inherit;
  color: inherit;
}

.member-profile__card-subtitle {
  margin: 0 0 var(--secan-space-s);
  font-family: var(--secan-font-body);
  font-size: var(--secan-fs-label);
  line-height: var(--secan-lh-label);
  color: var(--secan-gray-dark);
}

.member-profile__table-header {
  padding: var(--secan-space-m) var(--secan-space-m) var(--secan-space-s);
}

.member-profile__table-title {
  margin: 0;
  font-family: var(--secan-font-body);
  font-size: var(--secan-fs-body);
  font-weight: var(--secan-fw-regular);
  line-height: var(--secan-lh-body);
  color: var(--secan-black);
}

.member-profile__empty {
  margin: 0;
  font-family: var(--secan-font-body);
  font-size: var(--secan-fs-label);
  line-height: var(--secan-lh-label);
  color: var(--secan-gray);
}

.member-profile__card--flush .member-profile__empty {
  padding: 0 var(--secan-space-m) var(--secan-space-m);
}

/* Outstanding fee balance — Figma 3:4980. */
.member-profile__balance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--secan-space-xs);
  margin: 0;
  padding: var(--secan-space-l);
  border: 1px solid var(--secan-error-text);
  border-radius: var(--secan-radius-3);
  background-color: var(--secan-white);
  font-family: var(--secan-font-body);
  font-size: var(--secan-fs-body);
  font-weight: var(--secan-fw-medium);
  line-height: var(--secan-lh-body);
  color: var(--secan-error-text);
}

.member-profile__balance dt,
.member-profile__balance dd {
  margin: 0;
}

/* Key Highlights badges: membership status first, then program
   authorisations (logo or text). Text badges are 32px pills; logo badges
   are 56px so the program marks stay legible. */
.member-profile__badges {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--secan-space-xs);
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.member-profile__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 32px;
  max-width: 100%;
  padding: 0 var(--secan-space-s);
  border: 1px solid transparent;
  border-radius: var(--secan-radius-pill);
  font-family: var(--secan-font-body);
  font-size: var(--secan-fs-label);
  font-weight: var(--secan-fw-medium);
  line-height: var(--secan-lh-label);
  white-space: nowrap;
}

.member-profile__badge--active {
  background-color: #2e6e45;
  color: var(--secan-white);
}

.member-profile__badge--retailer {
  background-color: var(--secan-blue);
  color: var(--secan-white);
}

/* Warning text darkened from --secan-warning-text for 4.5:1 contrast. */
.member-profile__badge--pending {
  border-color: #f0d9b0;
  background-color: var(--secan-warning-bg);
  color: #7a5109;
}

.member-profile__badge--inactive {
  background-color: var(--secan-gray);
  color: var(--secan-white);
}

.member-profile__badge--program {
  border-color: #dbe5d6;
  background-color: var(--secan-white);
  color: #14301f;
}

.member-profile__badge--logo {
  height: 56px;
  min-height: 56px;
  padding: 0 var(--secan-space-s);
}

.member-profile__badge--logo img {
  display: block;
  width: auto;
  max-width: 176px;
  height: 40px;
  object-fit: contain;
}

/* Key Highlights — Figma 3:19302. Logo, member-since and description on the
   left; the contact rows (moved out of the hero) stack in a right column. */
.member-profile__highlights {
  display: grid;
  grid-template-areas:
    "brand contact"
    "about contact";
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  grid-template-rows: auto 1fr;
  gap: var(--secan-space-m) var(--secan-space-2xl);
  padding: 6px 0;
}

.member-profile__brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: var(--secan-space-xl);
}

.member-profile__logo {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 240px;
  height: 140px;
  padding: var(--secan-space-s);
  border-radius: var(--secan-radius-3);
  background-color: #f9f9f9;
}

.member-profile__logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.member-profile__logo-name {
  font-family: var(--secan-font-body);
  font-size: var(--secan-fs-body);
  font-weight: 800;
  color: #166534;
  text-align: center;
}

.member-profile__about {
  grid-area: about;
  display: flex;
  flex-direction: column;
  gap: var(--secan-space-s);
  min-width: 0;
}

.member-profile__since {
  margin: 0;
}

.member-profile__contact-list {
  grid-area: contact;
  display: flex;
  flex-direction: column;
  gap: var(--secan-space-m);
  align-self: start;
  margin: 0;
  padding-left: var(--secan-space-2xl);
  border-left: 1px solid var(--secan-modal-bg);
}

.member-profile__contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--secan-space-s);
  min-width: 0;
}

.member-profile__contact-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
}

.member-profile__contact-text {
  min-width: 0;
}

.member-profile__contact-text .member-profile__value {
  overflow-wrap: anywhere;
}

.member-profile__contact-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.member-profile__contact-link:hover {
  color: var(--secan-red);
}

.member-profile__contact-link:focus-visible {
  outline: none;
  border-radius: 2px;
  box-shadow: var(--secan-focus-ring);
}

.member-profile__term {
  display: block;
  font-family: var(--secan-font-heading);
  font-size: var(--secan-fs-small);
  line-height: var(--secan-lh-small);
  color: var(--secan-gray);
  text-transform: uppercase;
}

.member-profile__value {
  display: block;
  margin: 0;
  padding-top: var(--secan-space-xxxs);
  font-family: var(--secan-font-body);
  font-size: var(--secan-fs-label);
  line-height: var(--secan-lh-label);
  color: var(--secan-black);
}


.member-profile__description .member-profile__value {
  text-align: justify;
}

.member-profile__description .member-profile__value p {
  margin: 0 0 var(--secan-space-s);
}

.member-profile__description .member-profile__value p:last-child {
  margin-bottom: 0;
}

.member-profile__read-more {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--secan-font-body);
  font-size: var(--secan-fs-label);
  line-height: var(--secan-lh-label);
  color: var(--secan-red);
  text-decoration: underline;
  cursor: pointer;
}

.member-profile__read-more[hidden] {
  display: none;
}

/* Fee Report Summary — Figma 3:5148. */
.member-profile__fee-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--secan-space-xxs);
  margin: 0;
  padding: 6px 0;
  font-family: var(--secan-font-body);
  font-size: var(--secan-fs-label);
  font-weight: var(--secan-fw-medium);
  line-height: var(--secan-lh-label);
  color: var(--secan-black);
}

.member-profile__fee-status dt,
.member-profile__fee-status dd {
  display: inline-flex;
  align-items: center;
  gap: var(--secan-space-xxxs);
  margin: 0;
}

.member-profile__fee-status dd {
  margin-right: var(--secan-space-xs);
}

.member-profile__fee-status img {
  width: 20px;
  height: 20px;
}

.member-profile__reports {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--secan-space-xs);
  padding-top: 14px;
}

.member-profile__report-button {
  padding: var(--secan-space-xxs) var(--secan-space-xs);
  border: 1px solid var(--secan-chip-bg);
  border-radius: 6px;
  background-color: var(--secan-input-bg);
  font-family: var(--secan-font-body);
  font-size: var(--secan-fs-label);
  font-weight: var(--secan-fw-medium);
  line-height: var(--secan-lh-label);
  color: var(--secan-black);
  text-align: left;
  cursor: pointer;
}

.member-profile__report-button:hover {
  border-color: var(--secan-divider);
  background-color: var(--secan-chip-bg);
}

.member-profile__report-button:focus-visible {
  outline: none;
  box-shadow: var(--secan-focus-ring);
}

/* Varieties grid — Figma 3:3141. */
.member-profile__varieties {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--secan-space-3xl) var(--secan-space-l);
  margin: var(--secan-space-2xl) 0 0;
  padding: 0;
  list-style: none;
}

.member-profile__varieties > li {
  display: flex;
  min-width: 0;
}

.member-profile__varieties > li[hidden] {
  display: none;
}

.member-profile__varieties .variety-card {
  width: 100%;
}

.member-profile__more {
  display: flex;
  justify-content: center;
  margin-top: var(--secan-space-2xl);
}

.member-profile__more[hidden],
.member-profile__more-button[hidden] {
  display: none;
}

.member-profile__more-button {
  padding: var(--secan-space-xs) var(--secan-space-2xl);
  border: 1px solid var(--secan-red);
  border-radius: var(--secan-radius-pill);
  background: var(--secan-white);
  font-family: var(--secan-font-body);
  font-size: var(--secan-fs-body);
  color: var(--secan-red);
  cursor: pointer;
}

.member-profile__more-button:focus-visible {
  outline: none;
  box-shadow: var(--secan-focus-ring);
}

/* Production & Sales — Figma 3:6155. */
.member-profile__production .secan-chart {
  margin-top: var(--secan-space-s);
}

/* Member Details — Figma 3:7335. */
.member-profile__contacts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--secan-space-xl);
  margin: var(--secan-space-2xl) 0 0;
  padding: 0;
  list-style: none;
}

/* Chart modals — Figma 3:22705, 3:22992, 3:23230. */
.member-profile__modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--secan-space-2xl);
}

.member-profile__modal-body .data-table__row--total {
  background-color: var(--secan-input-bg);
  font-weight: var(--secan-fw-medium);
}

.member-profile__chart-title {
  margin: 0;
  font-family: var(--secan-font-body);
  font-size: var(--secan-fs-body);
  font-weight: var(--secan-fw-regular);
  color: var(--secan-black);
}

/* Tablet ------------------------------------------------------------------ */

@media (max-width: 1023px) {
  .member-profile__tabs-inner {
    padding: 0 var(--secan-space-2xl);
  }

  .member-profile__body {
    padding: var(--secan-space-l) var(--secan-space-l) var(--secan-space-2xl);
  }

  .member-profile__varieties {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .member-profile__contacts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--secan-space-m);
  }
}

/* Mobile ------------------------------------------------------------------ */

@media (max-width: 600px) {
  .member-profile__tabs-inner {
    padding: 0;
  }

  .member-profile__body {
    padding: var(--secan-space-l) var(--secan-space-m) var(--secan-space-2xl);
  }

  .member-profile__card-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Contacts sit between the logo row and the (clamped) description. */
  .member-profile__highlights {
    grid-template-areas:
      "brand"
      "contact"
      "about";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    gap: var(--secan-space-l);
  }

  .member-profile__contact-list {
    padding: var(--secan-space-m) 0;
    border-left: 0;
    border-top: 1px solid var(--secan-modal-bg);
    border-bottom: 1px solid var(--secan-modal-bg);
  }

  .member-profile__logo {
    width: 55%;
    max-width: 240px;
    height: 120px;
    padding: var(--secan-space-xs);
  }

  /* Badges start under the title and wrap; long text badges wrap inside. */
  .member-profile__badges {
    justify-content: flex-start;
  }

  .member-profile__badge {
    height: auto;
    min-height: 32px;
    padding-top: var(--secan-space-xxxs);
    padding-bottom: var(--secan-space-xxxs);
    white-space: normal;
    text-align: center;
  }

  /* Figma 3:20341: the description is clamped behind "Read More". */
  .member-profile__description.is-clamped:not(.is-expanded) .member-profile__value {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 14;
  }

  .member-profile__reports {
    grid-template-columns: minmax(0, 1fr);
  }

  .member-profile__varieties,
  .member-profile__contacts {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--secan-space-l);
  }

  .member-profile__varieties {
    row-gap: var(--secan-space-3xl);
  }

  /* Figma 3:9294 re-orders Production & Sales on mobile. */
  .member-profile__production {
    display: flex;
    flex-direction: column;
  }

  .member-profile__production-chart {
    order: 1;
  }

  .member-profile__production-inventory {
    order: 2;
  }

  .member-profile__production-applications {
    order: 3;
  }

  .member-profile__production-top {
    order: 4;
  }
}

/* The description clamp only applies on mobile; wider screens show it all. */
@media (min-width: 601px) {
  .member-profile__read-more {
    display: none;
  }
}
