/* ═══════════════════════════════════════════
   Families Page — The user's home with family cards.
   ═══════════════════════════════════════════ */

/* ─── Welcome Header ─── */
.families-welcome {
  max-width: var(--sc-content-max);
  margin: 0 auto;
  padding: 36px 24px 0;
}

.families-welcome__title {
  font-family: var(--sc-font-display);
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  font-weight: 400;
  color: var(--sc-charcoal);
  margin-bottom: 4px;
}

.families-welcome__subtitle {
  font-family: var(--sc-font-body);
  font-size: 0.95rem;
  color: var(--sc-text-secondary);
}

/* ─── Section ─── */
.families-section {
  max-width: var(--sc-content-max);
  margin: 15px auto 0;
  padding: 32px 24px 80px;
}

.families-section__label {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sc-bark-faint);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.families-section__label svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  opacity: 0.6;
}

/* ─── Grid ─── */
.family-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

/* ─── Family Card ─── */
.family-card {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.family-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sc-sand);
  opacity: 0;
  transition: opacity 0.3s;
}

.family-card:hover {
  border-color: var(--sc-sand);
  box-shadow: 0 8px 28px rgba(90, 64, 50, 0.08);
  transform: translateY(-1px);
}

.family-card:hover::before { opacity: 1; }

.family-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.family-card__monogram {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sc-font-display);
  font-weight: 400;
  font-size: 1.3rem;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.family-card__info { flex: 1; min-width: 0; }

.family-card__name {
  font-family: var(--sc-font-display);
  font-size: 1.15rem;
  color: var(--sc-charcoal);
  margin: 0 0 3px;
}

.family-card__desc {
  font-family: var(--sc-font-body);
  font-size: 0.88rem;
  color: var(--sc-text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.family-card__stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.family-card__stat {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  color: var(--sc-text-tertiary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.family-card__stat .icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  opacity: 0.5;
}

.family-card__footer {
  padding-top: 10px;
  border-top: 1px solid var(--sc-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.family-card__last-active {
  font-family: var(--sc-font-ui);
  font-size: 0.75rem;
  color: var(--sc-text-tertiary);
}

/* ─── Role Badge ─── */
.badge {
  font-family: var(--sc-font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
}

.badge--admin   { background: rgba(184, 96, 63, 0.08); color: var(--sc-rust); }
.badge--manager { background: rgba(122, 107, 42, 0.08); color: var(--sc-status-in-progress); }
.badge--contributor { background: rgba(107, 127, 94, 0.1); color: var(--sc-sage); }
.badge--member  { background: var(--sc-cream-dark); color: var(--sc-text-tertiary); }
.badge--completed {
	background: var(--sc-status-success-bg);
	color: var(--sc-status-success);
}

.badge--muted {
	background: var(--sc-cream-dark);
	color: var(--sc-text-tertiary);
}

/* ─── Create New Family CTA ─── */
.families-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px dashed var(--sc-border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s, background 0.3s;
}

.families-cta:hover {
  border-color: var(--sc-rust-soft);
  background: rgba(184, 96, 63, 0.02);
}

.families-cta__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(184, 96, 63, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.3s;
}

.families-cta:hover .families-cta__icon { background: rgba(184, 96, 63, 0.1); }

.families-cta__icon svg { width: 20px; height: 20px; stroke: var(--sc-rust); fill: none; }

.families-cta__text { flex: 1; }

.families-cta__title {
  display: block;
  font-family: var(--sc-font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--sc-rust);
  margin-bottom: 2px;
}

.families-cta__desc {
  display: block;
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  color: var(--sc-text-tertiary);
}

.families-cta__arrow {
  width: 18px;
  height: 18px;
  stroke: var(--sc-text-tertiary);
  fill: none;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.3s, transform 0.3s;
}

.families-cta:hover .families-cta__arrow { opacity: 0.7; transform: translateX(2px); }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .families-welcome { padding: 28px 16px 0; }
  .families-section { padding: 24px 16px 80px; }
  .family-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .family-card { padding: 20px 18px; }
  .family-card__monogram { width: 44px; height: 44px; font-size: 1.1rem; border-radius: 12px; }
}

/* ── Landing Hub (V2 mockup: landing-hub.php + hub.css + settings.css hero) ─ */

.landing-hub {
  padding-bottom: 80px;
}

.welcome-hero {
  max-width: var(--sc-content-max);
  margin: 0 auto;
  padding: 32px 24px 0;
}

.welcome-hero__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 32px 36px;
  background:
    radial-gradient(ellipse 80% 60% at 20% 100%, rgba(107, 127, 94, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 0%, rgba(184, 96, 63, 0.06) 0%, transparent 70%),
    var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 20px;
  overflow: hidden;
}

.welcome-hero__inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--sc-rust-soft), var(--sc-sage), transparent);
  border-radius: 0 0 3px 3px;
  opacity: 0.45;
}

.welcome-hero__actions {
  position: absolute;
  top: 16px;
  right: 18px;
  display: flex;
  gap: 6px;
}

.welcome-hero__action {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sc-bark-faint);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, color 0.2s;
}

.welcome-hero__action:hover {
  background: rgba(184, 96, 63, 0.08);
  color: var(--sc-rust);
}

.welcome-hero__action--muted:hover {
  background: var(--sc-cream-dark);
  color: var(--sc-text-secondary);
}

.welcome-hero__action svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
}

.welcome-hero__avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sc-font-ui);
  font-weight: 600;
  font-size: 1.5rem;
  color: white;
  margin-bottom: 18px;
  box-shadow:
    0 0 0 3px var(--sc-warm-white),
    0 0 0 5px rgba(92, 64, 51, 0.08);
}

.welcome-hero__greeting {
  margin-bottom: 12px;
}

.welcome-hero__title {
  font-family: var(--sc-font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 400;
  color: var(--sc-charcoal);
  margin: 0 0 6px;
  line-height: 1.2;
}

.welcome-hero__tagline {
  font-family: var(--sc-font-body);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--sc-text-secondary);
  margin: 0;
  line-height: 1.4;
}

.welcome-hero__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--sc-font-ui);
  font-size: 0.75rem;
  color: var(--sc-text-tertiary);
}

.welcome-hero__meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--sc-sand);
  flex-shrink: 0;
}

/* Personal block — mockup hub.css */
.hub-personal {
  max-width: var(--sc-content-max);
  margin: 0 auto;
  padding: 32px 24px 0;
}

.hub-personal__label {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sc-bark-faint);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.hub-personal__label svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  opacity: 0.6;
}

.hub-personal__label .hub-section__manage,
.families-section__label .hub-section__manage {
  margin-left: auto;
}

.hub-section__manage {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--sc-font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--sc-text-tertiary);
  text-decoration: none;
  transition: color 0.2s;
}

.hub-section__manage:hover {
  color: var(--sc-rust);
}

.hub-section__manage svg {
  width: 13px;
  height: 13px;
  opacity: 0.5;
  flex-shrink: 0;
}

.hub-section__manage:hover svg {
  opacity: 0.8;
}

/* Personal library card — mockup personal-library-card.php */
.personal-lib-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.personal-lib-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sc-sage);
  opacity: 0;
  transition: opacity 0.3s;
}

.personal-lib-card:hover {
  border-color: var(--sc-sage);
  box-shadow: 0 8px 28px rgba(107, 127, 94, 0.1);
  transform: translateY(-1px);
}

.personal-lib-card:hover::before {
  opacity: 1;
}

.personal-lib-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(107, 127, 94, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.personal-lib-card__icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--sc-sage);
  fill: none;
}

.personal-lib-card__info {
  flex: 1;
  min-width: 0;
}

.personal-lib-card__name {
  font-family: var(--sc-font-display);
  font-size: 1.15rem;
  color: var(--sc-charcoal);
  margin-bottom: 4px;
}

.personal-lib-card__desc {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  color: var(--sc-text-secondary);
  margin-bottom: 10px;
}

.personal-lib-card__stats {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.personal-lib-card__stat {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  color: var(--sc-text-tertiary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.personal-lib-card__stat .icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  opacity: 0.5;
}

.personal-lib-card__storage {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  flex-shrink: 0;
}

.personal-lib-card__storage-bar {
  height: 4px;
  background: var(--sc-cream-dark);
  border-radius: 2px;
  overflow: hidden;
}

.personal-lib-card__storage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sc-sage), var(--sc-sage));
  border-radius: 2px;
  min-width: 0;
  transition: width var(--sc-transition-fast);
}

.personal-lib-card__storage-text {
  font-family: var(--sc-font-ui);
  font-size: 0.7rem;
  color: var(--sc-text-tertiary);
  text-align: right;
}

.personal-lib-card__arrow {
  width: 18px;
  height: 18px;
  stroke: var(--sc-text-tertiary);
  fill: none;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.3s, transform 0.3s;
}

.personal-lib-card:hover .personal-lib-card__arrow {
  opacity: 0.7;
  transform: translateX(2px);
}

.hub-divider {
  max-width: var(--sc-content-max);
  margin: 28px auto 0;
  padding: 0 24px;
}

.hub-divider hr {
  border: none;
  border-top: 1px solid var(--sc-border-subtle);
  margin: 0;
}

/* Landing hub: family section uses mockup label row + manage link */
.families-section.landing-hub__families {
  padding-top: 0;
}

/* Legacy hub-section (other routes if any) */
.hub-section {
  margin-bottom: var(--sc-space-2xl);
}

.hub-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sc-space-md);
}

.hub-section__title {
  display: flex;
  align-items: center;
  gap: var(--sc-space-xs);
  font-family: var(--sc-font-ui);
  font-size: var(--sc-text-sm);
  font-weight: var(--sc-weight-semibold);
  letter-spacing: var(--sc-tracking-wide);
  text-transform: uppercase;
  color: var(--sc-text-tertiary);
}

.hub-section__title svg {
  width: 18px;
  height: 18px;
  color: var(--sc-text-tertiary);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .welcome-hero {
    padding: 24px 16px 0;
  }

  .welcome-hero__inner {
    padding: 36px 20px 28px;
  }

  .welcome-hero__avatar {
    width: 64px;
    height: 64px;
    font-size: 1.3rem;
  }

  .hub-personal {
    padding: 24px 16px 0;
  }

  .personal-lib-card {
    flex-wrap: wrap;
    gap: 14px;
    padding: 20px;
  }

  .personal-lib-card__storage {
    width: 100%;
    min-width: unset;
  }
}

@media (max-width: 480px) {
  .welcome-hero__meta {
    flex-direction: column;
    gap: 4px;
  }

  .welcome-hero__meta-dot {
    display: none;
  }

  .personal-lib-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .personal-lib-card__icon svg {
    width: 20px;
    height: 20px;
  }
}
