/* ==========================================================
   FAMILY IDENTITY & MEDIA v1.1.1c
   Family Core — module-neutral family identity
========================================================== */

.family-profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 24px 20px;
  text-align: center;
}

.family-photo-wrap {
  position: relative;
  width: 104px;
  height: 104px;
  margin-bottom: 14px;
}

.family-photo-button {
  width: 104px;
  height: 104px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.family-photo-button:disabled {
  cursor: default;
  opacity: 1;
}

.family-photo-visual {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100%;
  height: 100%;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface-strong);
  color: var(--color-secondary);
  box-shadow: var(--shadow-sm);
}

.family-photo-visual ion-icon {
  font-size: 42px;
}

.foto-keluarga-gambar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.family-photo-edit {
  position: absolute;
  right: -2px;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 3px solid var(--color-surface);
  border-radius: 50%;
  background: var(--color-secondary);
  color: #071109;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.family-photo-edit[hidden] {
  display: none !important;
}

.family-photo-edit ion-icon {
  font-size: 17px;
}

.family-photo-edit:disabled {
  opacity: .6;
  cursor: wait;
}

.family-profile-eyebrow {
  color: var(--color-text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.family-profile-card > h2 {
  margin: 5px 0 6px;
  max-width: 100%;
  font-size: clamp(24px, 6vw, 30px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.family-profile-card > p {
  margin: 0;
  max-width: 38ch;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.55;
}

/* Member avatar preview */
.avatar-anggota-previewable {
  cursor: zoom-in;
  outline: none;
}

.avatar-anggota-previewable:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 24%, transparent);
}

/* ==========================================================
   IMAGE PREVIEW / LIGHTBOX
========================================================== */
body.media-preview-open {
  overflow: hidden;
}

.media-preview-layer {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 8, 7, .78);
  backdrop-filter: blur(10px);
}

.media-preview-layer[hidden] {
  display: none !important;
}

.media-preview-card {
  position: relative;
  width: min(100%, 430px);
  max-height: min(92dvh, 760px);
  overflow-y: auto;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: 26px;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

.media-preview-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-surface) 90%, transparent);
  color: var(--color-text);
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.media-preview-close ion-icon {
  font-size: 21px;
}

.media-preview-visual {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  background: var(--color-surface-soft);
}

.media-preview-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--color-surface-soft);
}

.media-preview-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--color-secondary);
}

.media-preview-fallback ion-icon {
  font-size: 72px;
}

.media-preview-info {
  padding: 16px 4px 2px;
  text-align: center;
}

.media-preview-info h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.media-preview-info p {
  margin: 5px 0 0;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.family-photo-owner-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.family-photo-owner-actions[hidden] {
  display: none !important;
}

.family-photo-owner-actions .tombol-link-bahaya {
  width: 100%;
  justify-content: center;
  min-height: 46px;
}

@media (min-width: 700px) {
  .family-profile-card {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .family-photo-wrap,
  .family-photo-button {
    width: 112px;
    height: 112px;
  }
}
