/* ==========================================================================
   Management (template-about-management.php) — Oct 2026
   Loaded only on that template. Colours from main.css tokens.
   ========================================================================== */
.mg { background: var(--background); }
.mg-noscroll, .mg-noscroll body { overflow: hidden; }

/* Portrait frame shared by every size: full-colour photo on a brand backdrop
   (background-removed PNGs sit on the gradient; JPGs simply cover it). */
.mg-faces__img, .mg-lead__photo, .mg-card__photo, .mg-profile__photo {
  position: relative; display: block; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 100%, color-mix(in oklab, var(--brand) 32%, transparent), transparent 70%),
    linear-gradient(160deg, oklch(0.975 0.012 40), oklch(0.93 0.035 32));
}
.mg-faces__img img, .mg-lead__photo img, .mg-card__photo img, .mg-profile__photo img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center;
}
.mg-initials { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; color: var(--brand); font-size: 2rem; }

/* ---------- Hero (compact) ---------- */
.mg-hero { position: relative; overflow: hidden; background: var(--ink); border-bottom: 1px solid var(--border); }
.mg-hero::before { content: ""; position: absolute; right: -10%; top: -60%; width: 55%; height: 200%; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--brand) 9%, transparent), transparent); }
.mg-hero__inner { position: relative; padding-block: 2rem 2.5rem; }
.mg-hero__grid { margin-top: 1.25rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2.5rem; align-items: end; }
.mg-hero__title { margin: .9rem 0 0; font-size: clamp(2.2rem, 4.6vw, 3.5rem); line-height: 1.04; letter-spacing: -.03em; font-weight: 800; color: var(--ink-foreground); max-width: 40rem; text-wrap: balance; }
.mg-hero__intro { margin: 1rem 0 0; max-width: 36rem; font-size: 1.125rem; line-height: 1.6; color: color-mix(in oklab, var(--ink-foreground) 72%, transparent); }

.mg-faces { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.mg-faces li { margin-left: -14px; opacity: 0; animation: mg-pop .5s cubic-bezier(.2,.8,.3,1.2) forwards; animation-delay: calc(.08s * var(--i, 0)); }
.mg-faces li:first-child { margin-left: 0; }
.mg-faces a { display: block; border-radius: 50%; transition: transform .2s; }
.mg-faces a:hover, .mg-faces a:focus-visible { transform: translateY(-4px); z-index: 1; position: relative; }
.mg-faces__img { width: 4.25rem; height: 4.25rem; border-radius: 50%; border: 3px solid var(--background); box-shadow: 0 8px 18px -10px var(--shadow-color); }
.mg-faces__count { margin-left: 1rem !important; animation-delay: .6s !important; font-size: .95rem; color: var(--muted-foreground); white-space: nowrap; }
.mg-faces__count strong { display: block; font-size: 1.6rem; line-height: 1; color: var(--ink-foreground); font-weight: 800; }
@keyframes mg-pop { from { opacity: 0; transform: translateY(8px) scale(.9); } to { opacity: 1; transform: none; } }

.mg-head { margin: 0 0 1.75rem; position: relative; padding-left: 1rem; font-size: clamp(1.75rem, 3vw, 2.35rem); font-weight: 800; letter-spacing: -.02em; color: var(--ink-foreground); }
.mg-head::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 2px; background: var(--brand); }

/* ---------- Founders (compact feature cards) ---------- */
.mg-leads { position: relative; padding-block: 2.5rem 2.75rem; overflow: hidden; }
.mg-leads__bg { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 80% at 20% 30%, color-mix(in oklab, var(--brand) 6%, transparent), transparent 70%); }
.mg-leads .kg-container { position: relative; }
.mg-leads__grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); }
.mg-lead { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); border-radius: 20px; overflow: hidden; background: var(--background); border: 1px solid color-mix(in oklab, var(--brand) 14%, var(--border)); box-shadow: 0 24px 50px -40px var(--shadow-color); }
.mg-lead__photo { min-height: 14.5rem; }
.mg-lead__photo img, .mg-profile__photo img { position: absolute; inset: 0; } /* photo never sets the card height */
.mg-lead__photo img { transition: transform .5s ease; }
.mg-lead:hover .mg-lead__photo img { transform: scale(1.04); }
.mg-lead__body { padding: 1.5rem 1.6rem; display: flex; flex-direction: column; justify-content: center; }
.mg-badge { align-self: flex-start; padding: .25rem .65rem; border-radius: 999px; background: var(--brand-tint); color: var(--brand); font-size: .76rem; font-weight: 700; letter-spacing: .03em; }
.mg-lead__name { margin: .6rem 0 0; font-size: 1.5rem; line-height: 1.15; letter-spacing: -.015em; font-weight: 800; color: var(--ink-foreground); }
.mg-lead__role { margin: .25rem 0 0; font-size: .95rem; font-weight: 700; color: var(--brand); }
.mg-lead__short { margin: .7rem 0 0; font-size: .98rem; line-height: 1.55; color: color-mix(in oklab, var(--ink-foreground) 72%, transparent); }
.mg-lead__actions { margin-top: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; }
.mg-lead__more { appearance: none; border: 1.5px solid var(--brand); background: var(--background); color: var(--brand); border-radius: 9px; padding: .5rem .9rem; font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; transition: background .15s, color .15s; }
.mg-lead__more:hover { background: var(--brand); color: #fff; }
.mg-in { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; font-weight: 700; color: var(--brand); text-decoration: none; }
.mg-in svg { width: 17px; height: 17px; }
.mg-in:hover { text-decoration: underline; text-underline-offset: 3px; }
.mg-profile__body .mg-in { margin-top: auto; padding-top: 1.25rem; align-self: flex-start; }
.mg-profile__body .mg-badge { margin-bottom: .6rem; }

/* ---------- Team cards (one row of five on desktop) ---------- */
.mg-team { padding-block: 2.5rem 4rem; background: var(--neutral-soft); border-top: 1px solid var(--border); }
.mg-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; }
.mg-card { flex: 0 1 calc((100% - 5rem) / 5); min-width: 0; scroll-margin-top: 8rem; }
@media (max-width: 1100px) { .mg-card { flex-basis: calc((100% - 2.5rem) / 3); } }
@media (max-width: 700px) { .mg-card { flex-basis: calc((100% - 1.25rem) / 2); } }
.mg-card__btn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; width: 100%; height: 100%; border-radius: 16px; overflow: hidden; background: var(--background); border: 1px solid var(--border); transition: transform .25s, box-shadow .25s, border-color .25s; }
.mg-card__btn:hover, .mg-card__btn:focus-visible { transform: translateY(-4px); border-color: color-mix(in oklab, var(--brand) 30%, var(--border)); box-shadow: 0 22px 40px -30px var(--shadow-color); }
.mg-card__btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.mg-card__photo { aspect-ratio: 1 / 1; }
.mg-card__photo img { position: absolute; inset: 0; }
.mg-card__photo img { transition: transform .5s ease; }
.mg-card__btn:hover .mg-card__photo img { transform: scale(1.05); }
.mg-card__body { padding: .95rem 1rem 1.1rem; display: flex; flex-direction: column; flex: 1; }
.mg-card__name { font-size: 1.05rem; font-weight: 800; color: var(--ink-foreground); }
.mg-card__role { margin-top: .2rem; font-size: .84rem; font-weight: 700; line-height: 1.35; color: var(--brand); }
.mg-card__short { display: none; }
.mg-card__more { margin-top: auto; padding-top: .7rem; font-size: .84rem; font-weight: 700; color: var(--brand); }
.mg-card__more span { display: inline-block; transition: transform .2s; }
.mg-card__btn:hover .mg-card__more span { transform: translateX(4px); }

/* ---------- Profile panel ---------- */
.mg-profile { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1.5rem; background: oklch(0.2 0.01 40 / 0); transition: background .25s; }
.mg-profile[hidden] { display: none; }
.mg-profile.is-open { background: oklch(0.2 0.01 40 / .6); }
.mg-profile__panel { position: relative; width: min(100%, 50rem); max-height: calc(100vh - 3rem); overflow: auto; display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); border-radius: 24px; background: var(--background); box-shadow: 0 40px 90px -30px rgba(0,0,0,.5); opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .25s, transform .25s; }
.mg-profile.is-open .mg-profile__panel { opacity: 1; transform: none; }
.mg-profile__photo { min-height: 18rem; }
.mg-profile__body { padding: 2.25rem 2rem 2rem; display: flex; flex-direction: column; }
.mg-profile__name { margin: 0; font-size: 1.9rem; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; color: var(--ink-foreground); }
.mg-profile__role { margin: .4rem 0 0; font-size: 1rem; font-weight: 700; color: var(--brand); }
.mg-profile__bio { margin-top: 1.1rem; font-size: 1rem; line-height: 1.7; color: color-mix(in oklab, var(--ink-foreground) 78%, transparent); }
.mg-profile__bio p + p { margin-top: .8rem; }
.mg-profile__close { position: absolute; top: .75rem; right: .75rem; z-index: 2; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 0; background: var(--neutral-soft); color: var(--ink-foreground); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.mg-profile__close:hover { background: var(--brand-tint); color: var(--brand); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .mg-hero__grid { grid-template-columns: 1fr; gap: 1.5rem; align-items: start; }
  .mg-faces__img { width: 3.4rem; height: 3.4rem; }
}
@media (max-width: 640px) {
  .mg-lead { grid-template-columns: 7.5rem minmax(0, 1fr); }
  .mg-lead__photo { min-height: 0; }
  .mg-lead__body { padding: 1.1rem 1.1rem 1.2rem; }
  .mg-lead__name { font-size: 1.25rem; }
  .mg-lead__short { display: none; }
  .mg-profile { padding: 0; align-items: end; }
  .mg-profile__panel { grid-template-columns: 1fr; border-radius: 22px 22px 0 0; max-height: 92vh; }
  .mg-profile__photo { min-height: 0; aspect-ratio: 4 / 3; }
  .mg-lead__photo { min-height: 9rem; }
  .mg-faces li { margin-left: -12px; }
  .mg-faces__img { width: 2.9rem; height: 2.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mg-faces li { animation: none; opacity: 1; }
  .mg-card__btn, .mg-card__photo img, .mg-lead__photo img, .mg-lead__more, .mg-profile, .mg-profile__panel { transition: none; }
}
.mg-lead__photo img, .mg-faces__img img { object-position: 50% 22%; }

/* Three featured leaders: one row of three, compact side-by-side cards. */
@media (min-width: 1100px) {
  .mg-leads__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mg-leads__grid--3 .mg-lead { grid-template-columns: 11.5rem minmax(0, 1fr); }
  .mg-leads__grid--3 .mg-lead__photo { min-height: 15rem; }
  .mg-leads__grid--3 .mg-lead__body { padding: 1.2rem 1.1rem; }
  .mg-leads__grid--3 .mg-lead__name { font-size: 1.3rem; }
  .mg-leads__grid--3 .mg-lead__short { font-size: .92rem; }
}

/* Featured portraits: wide enough column that the photo is barely trimmed
   at the sides; anchored to the top so heads are never cut. */
.mg-lead__photo { background: #d4d4d4; }
.mg-lead__photo img { object-position: 50% 0; }
