/* Shared Directory profile treatment. The server marks individual profiles only. */
html[data-mf-directory-profile] {
  --mf-profile-base: #0b1029;
  --mf-profile-surface: #131c39;
  --mf-profile-line: #39466c;
  --mf-profile-ink: #f7f9ff;
  --mf-profile-muted: #c9d4e9;
  --mf-profile-mint: #b1fff1;
  --mf-profile-gold: #f3d580;
  --mf-profile-gutter: clamp(14px, 3.5vw, 48px);
}

/* Recovered site templates have both a registration banner and a status strip.
   Keep the ordinary navigation, editorial links, event details and language choice. */
html[data-mf-directory-profile] body > aside[role="status"][style*="border-bottom:2px solid #b99b53"]:has(> strong:only-child[style*="#f4d98b"]):has(~ header.wgl-theme-header a[href$="/registration-status/"]),
html[data-mf-directory-profile] .wgl-theme-header :is(.elementor-widget-wgl-button, .header_button .button-wrapper):has(a[href$="/registration-status/"]),
html[data-mf-directory-profile] .wgl-theme-header a.wgl-button[href$="/registration-status/"],
html[data-mf-directory-profile] .mf-event-update:has(.mf-event-update__link--tickets[href$="/registration-status/"]) :is(.mf-event-update__eyebrow, .mf-event-update__link--tickets, .mf-event-update__link--sponsor) {
  display: none !important;
}

html[data-mf-directory-profile] .mf-event-update {
  border: 0;
  border-bottom: 1px solid var(--mf-profile-line);
  background: #111832;
}

html[data-mf-directory-profile] .mf-event-update__inner {
  width: min(1180px, calc(100% - 2 * var(--mf-profile-gutter)));
  min-height: 44px;
  justify-content: flex-start;
  gap: 0 16px;
  padding: 0;
  text-align: start;
}

html[data-mf-directory-profile] .mf-event-update__inner :is(.mf-event-update__location, .mf-event-update__month, .mf-event-update__detail) {
  flex-basis: auto;
  color: var(--mf-profile-muted);
  font-size: .8rem;
  line-height: 1.4;
}

html[data-mf-directory-profile] .mf-event-update__inner a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  color: var(--mf-profile-mint) !important;
  font-size: .85rem;
  text-decoration: underline;
  text-underline-offset: .2em;
}

html[data-mf-directory-profile] .mf-event-update__inner .mf-language-switcher {
  min-width: 44px;
  width: auto;
  margin-inline-start: auto;
  padding-inline: 12px;
  border: 0;
}

html[data-mf-directory-profile] .mf-event-update__inner .mf-language-switcher:is(:hover, :focus-visible) {
  color: #10243b !important;
  background: var(--mf-profile-mint);
}

html[data-mf-directory-profile] #main.mf-directory-main {
  padding: 0;
  background: var(--mf-profile-base);
}

html[data-mf-directory-profile] :is(article.mf-person-profile, article.mf-organization-profile) {
  padding: 0 0 clamp(50px, 6vw, 90px);
  color: var(--mf-profile-ink);
  font-family: var(--e-global-typography-text-font-family, "DM Sans"), sans-serif;
}

html[data-mf-directory-profile] :is(article.mf-person-profile, article.mf-organization-profile) > :is(.mf-directory-container, .mf-profile-shell, section) {
  width: min(1180px, calc(100% - 2 * var(--mf-profile-gutter)));
  margin-inline: auto;
}

html[data-mf-directory-profile] .mf-directory-breadcrumbs {
  gap: 0 .5rem;
  margin: 0;
  padding: clamp(3px, .7vw, 10px) 0;
  color: var(--mf-profile-muted);
  font-size: .85rem;
}

html[data-mf-directory-profile] .mf-directory-breadcrumbs a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--mf-profile-mint) !important;
  text-decoration: underline;
  text-underline-offset: .18em;
}

html[data-mf-directory-profile] :is(.mf-person-profile__hero, .mf-organization-profile__hero) {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template: "identity media" auto / minmax(0, 1fr) minmax(0, 28%);
  align-items: center;
  gap: clamp(20px, 4vw, 62px);
  padding: clamp(24px, 4.4vw, 60px);
  border: 1px solid #49588d;
  border-radius: clamp(16px, 2vw, 24px);
  background: radial-gradient(ellipse at 100% 0%, #34386c 0, transparent 62%), linear-gradient(118deg, #101931, #1b2150);
}

html[data-mf-directory-profile] :is(.mf-person-profile__hero, .mf-organization-profile__hero)::before {
  position: absolute;
  inset: 0 5% auto 2%;
  height: 2px;
  background: linear-gradient(90deg, #a18cff, #565fc0 52%, transparent);
  content: "";
  pointer-events: none;
}

html[data-mf-directory-profile] :is(.mf-person-profile__hero, .mf-organization-profile__hero) > :has(> h1) {
  grid-area: identity;
  min-width: 0;
}

html[data-mf-directory-profile] :is(.mf-person-profile__hero, .mf-organization-profile__hero):not(:has(.mf-person-profile__media, .mf-organization-profile__logo-frame)) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "identity";
}

html[data-mf-directory-profile] .mf-person-profile__eyebrow {
  margin: 0 0 .75rem;
  color: var(--mf-profile-mint);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .105em;
}

html[data-mf-directory-profile] :is(article.mf-person-profile, article.mf-organization-profile) h1 {
  margin: 0;
  color: var(--mf-profile-ink);
  font-family: var(--e-global-typography-primary-font-family, Raleway), sans-serif;
  font-size: clamp(2.4rem, 5.35vw, 4.75rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}

html[data-mf-directory-profile] :is(.mf-person-profile__headline, .mf-organization-profile__headline) {
  max-width: 43ch;
  margin: .85rem 0 0;
  color: #e8eeff;
  font-size: clamp(1.05rem, 1.55vw, 1.35rem);
  line-height: 1.5;
}

html[data-mf-directory-profile] .mf-person-profile__hero p:has(> .mf-person-profile__organization-link) {
  margin: .15rem 0 0;
}

html[data-mf-directory-profile] .mf-person-profile__hero .mf-person-profile__organization-link,
html[data-mf-directory-profile] .mf-profile-aside a,
html[data-mf-directory-profile] .mf-profile-content p a {
  color: var(--mf-profile-mint);
  text-decoration: underline;
  text-underline-offset: .2em;
}

html[data-mf-directory-profile] .mf-person-profile__hero .mf-person-profile__organization-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

html[data-mf-directory-profile] .mf-person-profile__media,
html[data-mf-directory-profile] .mf-organization-profile__logo-frame {
  grid-area: media;
  width: 100%;
  justify-self: end;
}

html[data-mf-directory-profile] .mf-person-profile__media {
  display: grid;
  justify-items: center;
  gap: .75rem;
}

html[data-mf-directory-profile] img.mf-person-profile__portrait {
  /* auto uses the decoded intrinsic size and shrinks to the available track. */
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 19rem);
  max-height: 19rem;
  aspect-ratio: auto;
  object-fit: contain;
  border: 0;
  outline: 1px solid #66719b;
  outline-offset: -1px;
  border-radius: 14px;
  margin: 0;
  background: #20284c;
}

html[data-mf-directory-profile] .mf-person-profile__links {
  gap: 7px;
  margin: 0;
}

html[data-mf-directory-profile] .mf-organization-profile__logo-frame {
  max-width: 19rem;
  height: auto;
  min-height: 0;
  aspect-ratio: 1.35;
  padding: clamp(14px, 2.2vw, 34px);
  border-radius: 14px;
  /* Retain the approved dark/light background from the logo's own modifier. */
}

html[data-mf-directory-profile] img.mf-organization-profile__logo {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

html[data-mf-directory-profile] .mf-person-profile__tags {
  margin: 1rem 0 0;
  gap: 5px 8px;
}

html[data-mf-directory-profile] .mf-person-profile__tags .mf-directory-tag {
  flex: 0 1 auto;
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 0;
  padding: 3px 8px !important;
  text-align: start;
  white-space: normal;
}

html[data-mf-directory-profile] .mf-person-profile__tags .mf-directory-tag--verified-role {
  border-color: #927a48;
  color: var(--mf-profile-gold);
}

html[data-mf-directory-profile] :is(.mf-profile-actions, .mf-person-profile__actions) {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 1.25rem 0 0;
}

html[data-mf-directory-profile] :is(.mf-profile-primary, .mf-profile-secondary, .mf-profile-server-action, .mf-profile-watch-button, .mf-person-profile__action) {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  padding: 9px 16px;
  border: 1px solid #7380a4;
  border-radius: 7px;
  background: #1b2444;
  color: var(--mf-profile-ink) !important;
  font: 700 .94rem/1.35 var(--e-global-typography-text-font-family, "DM Sans"), sans-serif;
  text-align: start;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}

html[data-mf-directory-profile] :is(.mf-profile-primary, .mf-profile-server-action, .mf-profile-watch-button),
html[data-mf-directory-profile] .mf-person-profile__actions:not(:has(.mf-profile-primary)) > .mf-person-profile__action:first-child {
  border-color: var(--mf-profile-mint);
  background: var(--mf-profile-mint);
  color: #10243b !important;
}

html[data-mf-directory-profile] .mf-person-profile__action--gdx {
  background: #fff;
  color: #171329 !important;
}

html[data-mf-directory-profile] :is(.mf-profile-primary, .mf-profile-secondary, .mf-profile-server-action, .mf-profile-watch-button, .mf-person-profile__action):hover {
  border-color: white;
  background: white;
  color: #10243b !important;
}

html[data-mf-directory-profile] .mf-profile-server-action {
  width: fit-content;
  margin-top: .85rem;
}

html[data-mf-directory-profile] .mf-profile-enhanced .mf-profile-server-action {
  display: none;
}

html[data-mf-directory-profile] button.mf-profile-primary::before,
html[data-mf-directory-profile] .mf-profile-watch-button::before {
  content: "";
  width: 0;
  height: 0;
  border-block: .35em solid transparent;
  border-inline-start: .55em solid currentColor;
}

html[data-mf-directory-profile] .mf-profile-jumps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 clamp(14px, 2.1vw, 28px);
  margin: .6rem 0 0;
  border-bottom: 1px solid var(--mf-profile-line);
}

html[data-mf-directory-profile] .mf-profile-jumps a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--mf-profile-muted);
  font-size: .94rem;
  font-weight: 700;
  text-decoration: none;
}

html[data-mf-directory-profile] .mf-profile-jumps a:hover {
  color: var(--mf-profile-mint);
  text-decoration: underline;
  text-underline-offset: .2em;
}

html[data-mf-directory-profile] .mf-profile-content {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 3vw, 44px);
  margin-top: clamp(26px, 3vw, 44px);
}

html[data-mf-directory-profile] .mf-profile-content:has(> .mf-profile-aside) {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 26%);
}

html[data-mf-directory-profile] :is(.mf-person-profile__body, .mf-organization-profile__body):has(> aside):not(:has(> aside :is(dd, p, li, img, a))) {
  grid-template-columns: minmax(0, 1fr);
}

html[data-mf-directory-profile] :is(article.mf-person-profile, article.mf-organization-profile) > section {
  margin-top: 2.5rem;
}

html[data-mf-directory-profile] .mf-profile-main,
html[data-mf-directory-profile] .mf-profile-aside {
  min-width: 0;
}

html[data-mf-directory-profile] .mf-profile-main > [data-mf-profile-section] {
  margin: 0;
  padding: 0;
  border: 0;
}

html[data-mf-directory-profile] .mf-profile-main > [data-mf-profile-section] + [data-mf-profile-section] {
  margin-top: clamp(30px, 4vw, 52px);
  padding-top: clamp(22px, 2.5vw, 34px);
  border-top: 1px solid var(--mf-profile-line);
}

html[data-mf-directory-profile] :is(article.mf-person-profile, article.mf-organization-profile) h2 {
  margin: 0 0 1rem;
  color: var(--mf-profile-ink);
  font: 800 clamp(1.45rem, 2.2vw, 1.95rem)/1.18 var(--e-global-typography-primary-font-family, Raleway), sans-serif;
  letter-spacing: -.028em;
  overflow-wrap: anywhere;
}

html[data-mf-directory-profile] :is(.mf-person-profile__section, .mf-organization-profile__section) p {
  max-width: 68ch;
  color: var(--mf-profile-muted);
  font-size: 1.03rem;
  line-height: 1.7;
}

html[data-mf-directory-profile] :is(.mf-person-profile__facts, .mf-organization-profile__facts) {
  position: static;
  padding: clamp(18px, 2vw, 26px);
  border: 1px solid var(--mf-profile-line);
  border-radius: 14px;
  background: var(--mf-profile-surface);
}

html[data-mf-directory-profile] :is(.mf-person-profile__facts, .mf-organization-profile__facts):has(> dl):not(:has(dl dd, p, li, img, a)) {
  display: none;
}

html[data-mf-directory-profile] :is(.mf-person-profile__facts, .mf-organization-profile__facts) h2 {
  font-size: 1.18rem;
}

html[data-mf-directory-profile] :is(.mf-person-profile__facts, .mf-organization-profile__facts) dt {
  color: var(--mf-profile-muted);
  letter-spacing: .055em;
}

html[data-mf-directory-profile] :is(.mf-person-profile__updates, .mf-person-profile__appearances, .mf-person-profile__related) > li > a {
  padding: 13px 16px;
  border: 1px solid var(--mf-profile-line);
  border-inline-start: 3px solid #988bde;
  border-radius: 8px;
  background: var(--mf-profile-surface);
  color: var(--mf-profile-ink) !important;
  line-height: 1.5;
}

html[data-mf-directory-profile] .mf-profile-source {
  display: block;
  margin-bottom: .25rem;
  color: var(--mf-profile-mint);
  font-size: .8rem;
  font-weight: 700;
}

html[data-mf-directory-profile] .mf-profile-aside > section {
  margin-top: 1.4rem;
}

html[data-mf-directory-profile] .mf-profile-aside .mf-person-profile__actions {
  margin-top: 0;
}

html[data-mf-directory-profile] .mf-profile-aside > section h2 {
  font-size: 1.18rem;
}

html[data-mf-directory-profile] .mf-profile-media {
  --profile-media-card: var(--mf-profile-surface);
  --profile-media-visual: #0e1630;
  --profile-media-text: var(--mf-profile-ink);
  --profile-media-muted: var(--mf-profile-muted);
  --profile-media-border: var(--mf-profile-line);
  --profile-media-accent: var(--mf-profile-mint);
  --profile-media-edition: var(--mf-profile-gold);
}

html[data-mf-directory-profile] .mf-profile-media__cards {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, max(21rem, 34%)), 1fr));
  align-items: start;
}

html[data-mf-directory-profile] .mf-profile-media__cards:has(> :only-child) {
  grid-template-columns: minmax(0, 54rem);
}

/* Expanding one player gives it the reading width of the whole media group. */
html[data-mf-directory-profile] .mf-profile-media__card--video:has(.mf-profile-player:not([hidden])) {
  grid-column: 1 / -1;
}

html[data-mf-directory-profile] .mf-profile-media__card--video .mf-profile-media__primary:has(.mf-profile-media__visual) {
  grid-template-columns: clamp(86px, 18%, 155px) minmax(0, 1fr);
}

html[data-mf-directory-profile] .mf-profile-media__details p {
  color: var(--mf-profile-muted);
  font-size: .95rem;
  line-height: 1.55;
}

html[data-mf-directory-profile] .mf-profile-media__heading {
  background: var(--mf-profile-surface);
}

html[data-mf-directory-profile] .mf-profile-media__card:not(.mf-profile-media__card--video) .mf-profile-media__visual {
  width: 100%;
  max-height: 24rem;
}

html[data-mf-directory-profile] .mf-profile-context-photos .mf-profile-media__credit {
  margin: .45rem 0 0;
  color: var(--mf-profile-muted);
  font-size: .85rem;
  line-height: 1.5;
}

html[data-mf-directory-profile] .mf-profile-context-photos .mf-profile-media__card > .mf-profile-media__credit {
  padding: 0 .85rem .7rem;
}


html[data-mf-directory-profile] .mf-profile-player {
  min-width: 0;
  margin: .75rem 0;
}

html[data-mf-directory-profile] .mf-profile-player iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--mf-profile-line);
  border-radius: 10px;
  background: #0a1025;
}

html[data-mf-directory-profile] .mf-profile-media__card:has(.mf-profile-player) .mf-profile-media__primary {
  color: var(--mf-profile-mint);
  row-gap: 0;
}

html[data-mf-directory-profile] .mf-profile-media__card:has(.mf-profile-player) .mf-profile-media__visual::after,
html[data-mf-directory-profile] .mf-profile-media__card:has(.mf-profile-player) .mf-profile-media__heading::before {
  content: none !important;
}

html[data-mf-directory-profile] .mf-profile-gallery-label {
  display: block;
  margin-top: .2rem;
  font-size: .83rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: .2em;
}

html[data-mf-directory-profile] .mf-profile-youtube-fallback {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  color: var(--mf-profile-mint);
  text-decoration: underline;
  text-underline-offset: .2em;
}

html[data-mf-directory-profile] .mf-profile-watch-button {
  justify-self: start;
  cursor: pointer;
}

html[data-mf-directory-profile] :is(.mf-person-profile, .mf-organization-profile) [id] {
  scroll-margin-top: 6rem;
}

html[data-mf-directory-profile] :is(a, button, [tabindex]):focus-visible {
  outline: 3px solid #9cf9f0 !important;
  outline-offset: 3px;
}

html[data-mf-directory-profile] :is(a, button):focus-visible:has(img) {
  outline-offset: -3px;
}

html[data-mf-directory-profile] :is(.mf-profile-skip, .mf-profile-skip-link) {
  position: absolute;
  z-index: 10050;
  inset: 8px auto auto 8px;
  min-height: 44px;
  padding: 10px 16px;
  transform: translateY(calc(-100% - 16px));
  border-radius: 6px;
  background: var(--mf-profile-mint);
  color: #10243b;
  font-weight: 700;
}

html[data-mf-directory-profile] :is(.mf-profile-skip, .mf-profile-skip-link):focus {
  transform: none;
}

@media (max-width: 760px) {
  html[data-mf-directory-profile] .mf-profile-content:has(> .mf-profile-aside) {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-mf-directory-profile] .mf-event-update__inner {
    gap: 0 12px;
    padding-block: 4px;
  }
}

@media (max-width: 570px) {
  html[data-mf-directory-profile] .mf-directory-breadcrumbs {
    gap: 0 .35rem;
    font-size: .78rem;
  }

  /* Name and role remain in the first screen. Full-width rows below the photo
     preserve the source reading order of longer headlines, links and actions. */
  html[data-mf-directory-profile] :is(.mf-person-profile__hero, .mf-organization-profile__hero):has(.mf-person-profile__media, .mf-organization-profile__logo-frame) {
    grid-template: none / minmax(0, 1fr) clamp(76px, 23vw, 112px);
    align-items: start;
    gap: 0 12px;
    padding: clamp(15px, 4vw, 23px);
  }

  html[data-mf-directory-profile] :is(.mf-person-profile__hero, .mf-organization-profile__hero):has(.mf-person-profile__media, .mf-organization-profile__logo-frame) > :has(> h1),
  html[data-mf-directory-profile] .mf-person-profile__media:has(> img.mf-person-profile__portrait) {
    display: contents;
  }

  html[data-mf-directory-profile] :is(.mf-person-profile__hero, .mf-organization-profile__hero) > :has(> h1) > *,
  html[data-mf-directory-profile] .mf-person-profile__links {
    grid-column: 1 / -1;
  }

  html[data-mf-directory-profile] :is(.mf-person-profile__hero, .mf-organization-profile__hero) > :has(> h1) > :is(.mf-person-profile__eyebrow, h1) {
    grid-column: 1;
  }

  html[data-mf-directory-profile] .mf-person-profile__eyebrow {
    grid-row: 1;
    align-self: end;
    margin: 0 0 6px;
    font-size: .69rem;
  }

  html[data-mf-directory-profile] :is(article.mf-person-profile, article.mf-organization-profile) h1 {
    grid-row: 2;
    align-self: start;
    font-size: clamp(1.85rem, 8.3vw, 2.8rem);
  }

  html[data-mf-directory-profile] img.mf-person-profile__portrait,
  html[data-mf-directory-profile] .mf-organization-profile__logo-frame,
  html[data-mf-directory-profile] .mf-person-profile__media:not(:has(> img.mf-person-profile__portrait)) {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: end;
    max-width: 100%;
    max-height: 7rem;
    border-radius: 8px;
  }

  html[data-mf-directory-profile] .mf-organization-profile__logo-frame {
    aspect-ratio: 1.12;
    padding: 8px;
  }

  html[data-mf-directory-profile] :is(.mf-profile-actions, .mf-profile-server-action) {
    order: 1;
    margin-top: .7rem;
  }

  html[data-mf-directory-profile] :is(.mf-person-profile__tags, .mf-forum-sponsorships) {
    order: 2;
    margin-top: .7rem;
  }

  html[data-mf-directory-profile] .mf-person-profile__links {
    order: 3;
    justify-content: flex-start;
    margin-top: .75rem;
  }

  html[data-mf-directory-profile] .mf-profile-jumps {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: #637399 transparent;
  }

  html[data-mf-directory-profile] .mf-profile-jumps a {
    flex: 0 0 auto;
    min-height: 44px;
    font-size: .86rem;
  }
}

@media (max-width: 365px) {
  html[data-mf-directory-profile] .mf-event-update__inner {
    column-gap: 6px;
  }

  html[data-mf-directory-profile] :is(.mf-person-profile__hero, .mf-organization-profile__hero):has(.mf-person-profile__media, .mf-organization-profile__logo-frame) {
    grid-template-columns: minmax(0, 1fr) 68px;
    column-gap: 8px;
  }

  html[data-mf-directory-profile] img.mf-person-profile__portrait {
    max-height: 85px;
  }
}

html[data-mf-directory-profile] .mf-profile-feature-title {
  color: var(--mf-profile-muted, #c9c6d8);
  font-size: .93rem;
  line-height: 1.4;
  max-width: 40ch;
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  html[data-mf-directory-profile] .mf-profile-jumps {
    flex-wrap: wrap;
    column-gap: .8rem;
    row-gap: 0;
    overflow: visible;
  }
}
