/*
 * Tribe home.
 *
 * Modern minimal: white, one typeface, the tribe's own photographs doing the
 * work. The sense of entering a place comes from sequence and scale, not
 * ornament: the palace photograph first, with the main leader's card at its
 * foot, then the name, then the rest of the leadership, then a walk through
 * the gallery.
 *
 * Two themes, read from data-tribe-theme on the page wrapper. A root tribe
 * (palace) gets the taller photograph and the larger name; a sub-tribe
 * (hall) is a quieter, shorter version of the same page on a faintly
 * tinted ground. Each theme is a block of tokens; nothing else differs.
 */

[data-tribe-theme="palace"] {
  --home-photo-aspect: 4 / 3;
  --home-photo-aspect-wide: 3 / 2;
  --home-name-size: clamp(1.9rem, 5.2vw, 2.6rem);
  --home-ground: var(--color-surface);
  --home-seat-size: 4rem;
  --home-seat-overlap: 1.75rem;
}

[data-tribe-theme="hall"] {
  --home-photo-aspect: 16 / 10;
  --home-photo-aspect-wide: 2 / 1;
  --home-name-size: clamp(1.6rem, 4.4vw, 2.1rem);
  --home-ground: var(--color-surface-muted);
  --home-seat-size: 3.5rem;
  --home-seat-overlap: 1.5rem;
}

/* ── Arrival: the photograph, the symbol, the name ──────────────────────── */

.home-gate {
  background: var(--home-ground);
}

.home-gate__stage {
  position: relative;
}

.home-gate__photo {
  display: block;
  width: 100%;
  aspect-ratio: var(--home-photo-aspect);
  object-fit: cover;
  background: var(--color-surface-hover);
}

@media (min-width: 640px) {
  .home-gate__photo {
    aspect-ratio: var(--home-photo-aspect-wide);
  }
}

.home-gate__body {
  padding: 1.5rem 1rem 1.75rem;
}

.home-gate__body--seated {
  padding-top: calc(1.5rem + var(--home-seat-overlap));
}

.home-gate__symbol {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.625rem;
  display: grid;
  place-items: center;
  background: var(--color-surface-hover);
  color: var(--color-ink-700);
  font-size: 1.1rem;
  font-weight: 500;
  overflow: hidden;
}

.home-gate__symbol img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-gate__name {
  margin-top: 1.1rem;
  font-size: var(--home-name-size);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--color-ink-900);
  text-wrap: balance;
}

/*
 * The facts line wraps on narrow screens. The separators hang off the left
 * of each item and the row is pulled left by the same amount inside a
 * clipping box, so a separator that lands at the start of a wrapped line
 * falls outside the box and disappears instead of opening the line with
 * a stray dot.
 */
.home-gate__meta {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-ink-500);
  overflow: hidden;
}

.home-gate__meta-row {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.1rem;
  margin-left: -1.35em;
}

.home-gate__meta-row > * {
  position: relative;
  margin-left: 1.35em;
  white-space: nowrap;
}

.home-gate__meta-row > *::before {
  content: "·";
  position: absolute;
  left: -0.9em;
}

.home-gate__meta strong {
  font-weight: 500;
  color: var(--color-ink-700);
}

/* ── The seat: the main leader's card at the foot of the photograph ─────── */

.home-seat {
  position: absolute;
  left: 1rem;
  bottom: calc(-1 * var(--home-seat-overlap));
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100% - 2rem);
  padding: 0.625rem 1rem 0.625rem 0.625rem;
  background: var(--color-surface);
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 0 0 1px var(--color-line);
  color: var(--color-ink-900);
}

.home-seat--inline {
  position: static;
  margin-bottom: 1.25rem;
  max-width: 100%;
  width: fit-content;
}

.home-seat__portrait {
  flex: none;
  width: var(--home-seat-size);
  height: var(--home-seat-size);
  border-radius: 0.75rem;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--color-surface-hover);
  color: var(--color-ink-700);
  font-size: 1.25rem;
  font-weight: 500;
}

.home-seat__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.home-seat__name {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.home-seat__title {
  margin-top: 0.1rem;
  font-size: 0.8125rem;
  color: var(--color-ink-500);
}

@media (max-width: 639px) {
  .home-seat {
    left: 0.75rem;
    padding-right: 0.875rem;
    --home-seat-size: 3.25rem;
  }

  .home-seat__name {
    font-size: 0.875rem;
  }
}

/* ── The others: a stack of small portraits and the count ───────────────── */

.home-gate__others {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--color-ink-700);
}

.home-gate__others:hover {
  text-decoration: underline;
}

.home-gate__stack {
  display: flex;
}

.home-gate__stack > * {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--color-surface-hover);
  color: var(--color-ink-700);
  font-size: 0.7rem;
  font-weight: 500;
  box-shadow: 0 0 0 2px var(--color-surface);
}

.home-gate__stack > * + * {
  margin-left: -0.5rem;
}

/* ── The walk: the gallery as one wide strip ────────────────────────────── */

.home-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1rem;
  padding: 0 1rem 0.25rem;
  scrollbar-width: none;
}

.home-strip::-webkit-scrollbar {
  display: none;
}

.home-strip__item {
  flex: 0 0 78%;
  scroll-snap-align: start;
  aspect-ratio: 4 / 3;
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--color-surface-hover);
}

.home-strip__item:only-child {
  flex-basis: 100%;
}

.home-strip__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Leadership page portraits ──────────────────────────────────────────── */

.leader-portrait {
  flex: none;
  border-radius: 0.75rem;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--color-surface-hover);
  color: var(--color-ink-700);
  font-weight: 500;
}
