/* ===========================================================================
   ABOUT PAGE
   Figma node 4032:921 — aligned with B Bailey design system
=========================================================================== */

/* Transparent header over dark hero (not page-solid) */
.page-about .ap-hero {
  padding-bottom: var(--space-12);
}

/* ---------------------------------------------------------------------------
   Intro card + stack layers (overlaps hero)
--------------------------------------------------------------------------- */
.ap-intro {
  position: relative;
  z-index: 2;
  padding-top: calc(var(--space-10) * -1);
  padding-bottom: var(--space-8);
}

.ap-intro::after {
	content: "";
	position: absolute;
	inset: var(--space-5) 0 0;
	z-index: -1;
	opacity: 0.3;
	background: linear-gradient(180deg, var(--color-white) 20%, #7f90e9 50%, var(--color-white) 100%);
	pointer-events: none;
}

.ap-stack {
  position: absolute;
  left: 50%;
  top: -36px;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(1320px, calc(100% - 48px));
  transform: translateX(-50%);
  pointer-events: none;
}

.ap-stack-layer {
  display: block;
  height: 12px;
  border-radius: 12px 12px 0 0;
}

.ap-stack-layer--1 {
  width: calc(100% - 120px);
  background: rgba(255, 255, 255, 0.28);
}

.ap-stack-layer--2 {
  width: calc(100% - 80px);
  background: rgba(255, 255, 255, 0.5);
}

.ap-stack-layer--3 {
  width: calc(100% - 40px);
  background: rgba(255, 255, 255, 0.72);
}

.ap-intro-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-8) var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  box-shadow: 0 24px 64px rgba(11, 11, 11, 0.08);
}

.ap-intro-top {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr);
  gap: var(--space-6) var(--space-8);
  align-items: start;
}

.ap-intro-title-wrap {
  position: relative;
  min-width: 0;
}

.ap-intro-title {
  position: relative;
  z-index: 1;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-36);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
  text-wrap: pretty;
}

.ap-intro-mark {
  position: absolute;
  left: 0;
  top: 70%;
  width: min(140px, 40%);
  height: auto;
  opacity: 0.07;
  pointer-events: none;
  object-fit: contain;
}

.ap-intro-copy {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.ap-intro-copy .ap-expand-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ap-intro-copy p {
  margin: 0;
  font-size: var(--text-md);
  line-height: 1.65;
  color: #475569;
  text-wrap: pretty;
}

/* Expandable long copy */
.ap-expand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.ap-expand-body {
  position: relative;
  width: 100%;
}

.ap-expand.is-collapsed .ap-expand-body {
  overflow: hidden;
  max-height: var(--ap-collapse-h, 168px);
}

/* Avoid full-text flash before JS applies collapse */
.js-anim .js-ap-expand:not(.is-ready) .ap-expand-body {
  overflow: hidden;
  max-height: var(--ap-collapse-h, 168px);
}

.js-anim .js-ap-expand:not(.is-ready) .ap-expand-body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--space-9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--color-white) 88%);
  pointer-events: none;
}

.ap-expand.is-collapsed .ap-expand-body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--space-9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--color-white) 88%);
  pointer-events: none;
}

.ap-heritage-story-wrap.is-collapsed .ap-expand-body::after {
  background: linear-gradient(180deg, rgba(246, 248, 253, 0) 0%, rgb(246 248 253) 85%)
}

.ap-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-navy);
  cursor: pointer;
  transition: color 0.2s ease, gap 0.2s ease;
}

.ap-expand-btn:hover {
  gap: var(--space-1);
  color: #142060;
}

.ap-expand-btn i {
  font-size: var(--text-lg);
  transition: transform 0.25s ease;
}

.ap-expand:not(.is-collapsed) .ap-expand-btn i {
  transform: rotate(180deg);
}

.ap-expand-less,
.ap-expand:not(.is-collapsed) .ap-expand-more {
  display: none;
}

.ap-expand:not(.is-collapsed) .ap-expand-less {
  display: inline;
}

.ap-expand:not(.is-collapsed) .ap-expand-btn {
  margin-top: var(--space-0-5);
}

/* Focus cards — what sets us apart */
.ap-focus {
  padding: 0 0 var(--space-6);
  background: var(--color-white);
}

.ap-focus .section-head {
  margin-bottom: var(--space-5);
}

.ap-focus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

.ap-focus-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--space-4);
  border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  background: #f4f8fc;
  border: 1px solid rgba(27, 41, 120, 0.06);
}

.ap-focus-num {
	font-family: var(--font-ui);
	font-size: var(--text-64);
	line-height: normal;
	font-weight: 700;
	letter-spacing: var(--tracking-wider);
	color: var(--color-navy);
	opacity: 0.1;
}

.ap-focus-card h3 {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-lg);
  line-height: 1.3;
  letter-spacing: var(--tracking-snug);
  color: var(--color-navy);
}

.ap-focus-card p {
  margin: 0;
  font-size: var(--text-15);
  line-height: 1.55;
  color: #64748b;
  text-wrap: pretty;
}

/* Stats row */
.ap-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.ap-stat {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-height: 240px;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-light-blue);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

.ap-stat:hover {
  transform: translateY(-4px);
}

.ap-stat-ico {
  width: var(--space-4);
  height: auto;
  margin-bottom: auto;
  opacity: 0.9;
}

.ap-stat-value {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-display);
  line-height: 1.05;
  letter-spacing: var(--tracking-tighter);
  color: var(--color-navy);
}

.ap-stat-label {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.35;
  color: #334155;
}

.ap-stat--media {
  position: relative;
  padding: 0;
  overflow: hidden;
  background: var(--color-ink);
}

.ap-stat--media:hover {
  transform: translateY(-4px);
}

.ap-stat--media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
}

.ap-stat--media:hover img {
  transform: translate3d(0, var(--py, 0px), 0) scale(1.06);
  filter: grayscale(0.35);
}

.ap-stat-media-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(11, 11, 11, 0.75) 100%);
  pointer-events: none;
}

.ap-stat-media-label {
  position: absolute;
  left: var(--space-2);
  bottom: var(--space-2);
  z-index: 1;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--text-13);
  color: var(--color-white);
  letter-spacing: var(--tracking-slight);
}

/* ---------------------------------------------------------------------------
   Heritage — editorial band + era cards
--------------------------------------------------------------------------- */
.ap-heritage {
  padding: var(--section-y) 0;
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(255, 255, 255, 0.55) 0%, transparent 55%),
    linear-gradient(165deg, var(--color-light-blue) 0%, #edf2ff 45%, #e8eef8 100%);
  overflow: hidden;
}

.ap-heritage-band {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--space-6) var(--space-8);
  align-items: end;
  margin-bottom: var(--space-6);
}

.ap-heritage-intro {
  position: relative;
  min-width: 0;
}

.ap-heritage-eyebrow {
  display: inline-block;
  margin-bottom: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-navy);
  opacity: 0.75;
}

.ap-heritage-year {
  position: absolute;
  left: -2px;
  top: 2px;
  z-index: 0;
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-160);
  line-height: 0.85;
  letter-spacing: var(--tracking-tightest);
  color: rgba(27, 41, 120, 0.07);
  pointer-events: none;
  user-select: none;
}

.ap-heritage-title {
  position: relative;
  z-index: 1;
  margin: 0 0 var(--space-3);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-42);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-navy);
  text-wrap: balance;
}

.ap-heritage-lead {
  position: relative;
  z-index: 1;
  max-width: 608px;
  margin: 0;
  font-size: var(--text-lg);
  line-height: 1.55;
  color: #334155;
  text-wrap: pretty;
}

.ap-heritage-figure {
  margin: 0;
  min-width: 0;
}

.ap-heritage-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg);
  box-shadow: 0 20px 48px rgba(27, 41, 120, 0.12);
}

.ap-heritage-figure figcaption {
  margin-top: 10px;
  font-family: var(--font-ui);
  font-size: var(--text-13);
  color: #64748b;
}

.ap-heritage-story-wrap {
  margin: 0 0 var(--space-6);
  padding: var(--space-3);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(27, 41, 120, 0.06);
}

.ap-heritage-story-head {
  margin-bottom: 14px;
}

.ap-heritage-story-title {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-20);
  letter-spacing: var(--tracking-tight);
  color: var(--color-navy);
}

.ap-heritage-story-hint {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: #64748b;
}

.ap-heritage-story {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
}

.ap-heritage-story p {
  margin: 0;
  font-size: var(--text-md);
  line-height: 1.7;
  color: #334155;
}

.ap-eras {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-0-5);
  margin: 0 0 2px;
  padding: 0;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  overflow: hidden;
}

.ap-era {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
  padding: var(--space-3);
  background: rgba(255, 255, 255, 0.72);
  transition: background 0.25s ease;
}

.ap-era:hover {
  background: var(--color-white);
}

.ap-era-year {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: var(--text-13);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-navy);
}

.ap-era-title {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-lg);
  line-height: 1.3;
  color: #0f172a;
}

.ap-era p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: #475569;
  text-wrap: pretty;
}

.ap-heritage-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.ap-heritage-quote {
  flex: 1 1 280px;
  max-width: 768px;
  margin: 0;
  padding: 0 0 0 18px;
  border-left: 3px solid var(--color-navy);
}

.ap-heritage-quote p {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-17);
  font-weight: 500;
  line-height: 1.5;
  color: #1e293b;
  font-style: italic;
  text-wrap: pretty;
}

/* ---------------------------------------------------------------------------
   Team
--------------------------------------------------------------------------- */
.ap-team {
  padding: var(--section-y) 0 calc(var(--section-y) + var(--space-2));
  background: var(--color-white);
  scroll-margin-top: calc(var(--header-h) + var(--space-2));
}

.ap-team .section-head-title {
  color: var(--color-navy);
}

.ap-team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-6) var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ap-person {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.ap-person:focus-visible {
  outline: none;
}

.ap-person:focus-visible .ap-person-photo {
  box-shadow: 0 0 0 3px rgba(27, 41, 120, 0.35);
}

.ap-person-photo {
  position: relative;
  display: block;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  border-radius: 0 50% 50%;
  overflow: hidden;
  background: #e8eef5;
  transition: border-radius 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.ap-person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.ap-person:hover .ap-person-photo {
  border-radius: 0 var(--radius-md) var(--radius-md);
}

.ap-person:hover .ap-person-photo img {
  transform: translate3d(0, var(--py, 0px), 0) scale(1.07);
}

.ap-person-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-0-5);
}

.ap-person-name {
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-md);
  line-height: 1.3;
  color: var(--color-navy);
}

.ap-person-role {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  line-height: 1.35;
  color: #64748b;
}

/* Team tray — slides in from right + blur backdrop */
.team-tray[hidden] {
  display: none !important;
}

.team-tray {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: block;
  /* Wheel/touch on empty area must not scroll the page behind */
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.team-tray-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 16, 40, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.team-tray-panel {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: min(740px, 100%);
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  background: var(--color-white);
  box-shadow: -16px 0 56px rgba(11, 11, 11, 0.16);
  transform: translate3d(100%, 0, 0);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: auto;
}

.team-tray.is-open .team-tray-backdrop {
  opacity: 1;
}

.team-tray.is-open .team-tray-panel {
  transform: translate3d(0, 0, 0);
}

.team-tray-close {
  position: absolute;
  top: 14px;
  right: var(--space-4);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 0 50% 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-ink);
  font-size: var(--text-xl);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.team-tray-close:hover {
  background: var(--color-white);
  color: var(--color-navy);
}

/* Inner scroller — long bios scroll here, not the page */
.team-tray-scroll {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
}

.team-tray-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 240px;
  background: #e8eef5;
  overflow: hidden;
}

.team-tray-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.team-tray-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.team-tray-dept {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--text-11);
  font-weight: 700;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-navy);
  opacity: 0.7;
}

.team-tray-name {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--text-26);
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
  color: #0f172a;
}

.team-tray-role {
  margin: 0 0 var(--space-0-5);
  font-size: var(--text-md);
  color: #64748b;
}

.team-tray-bio {
  margin: 0 0 var(--space-0-5);
  font-size: var(--text-15);
  line-height: 1.65;
  color: #475569;
  flex: 0 0 auto;
}

.team-tray-bio p {
  margin: 0 0 12px;
}

.team-tray-bio p:last-child {
  margin-bottom: 0;
}

.team-tray-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding-bottom: var(--space-3);
}

.team-tray-actions .btn-pill {
  flex: 1 1 120px;
  justify-content: center;
}

/* Prevent document scroll while tray is open — keep scroll position (no body fixed) */
html.team-tray-open,
html.team-tray-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

@media (prefers-reduced-motion: reduce) {
  .ap-stat,
  .ap-stat--media img,
  .ap-person-photo img,
  .team-tray-backdrop,
  .team-tray-panel {
    transition: none;
  }

  .ap-stat:hover,
  .ap-stat--media:hover,
  .ap-person:hover .ap-person-photo img {
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .ap-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ap-stat {
    min-height: 200px;
  }

  .ap-eras {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ap-team-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  .page-about .ap-hero {
    padding-bottom: var(--space-10);
  }

  .ap-intro {
    margin-top: calc(var(--space-8) * -1);
  }

  .ap-intro-card {
    padding: var(--space-5) var(--space-4);
    gap: var(--space-5);
  }

  .ap-intro-top {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .ap-intro-title {
    max-width: none;
  }

  .ap-focus-grid {
    grid-template-columns: 1fr;
  }

  .ap-heritage-band {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .ap-heritage-figure {
    order: -1;
    max-width: 480px;
  }

  .ap-team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5) var(--space-3);
  }
}

@media (max-width: 768px) {
  .ap-stack {
    top: -28px;
    width: calc(100% - 32px);
  }

  .ap-stack-layer {
    height: 10px;
  }

  .ap-stack-layer--1 {
    width: calc(100% - 48px);
  }

  .ap-stack-layer--2 {
    width: calc(100% - 28px);
  }

  .ap-stack-layer--3 {
    width: calc(100% - 12px);
  }

  .ap-intro-card {
    padding: var(--space-4) var(--space-3);
    border-radius: 20px;
  }

  .ap-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .ap-stat {
    min-height: var(--space-20);
    padding: var(--space-2);
  }

  .ap-stat-value {
    font-size: var(--text-2xl);
  }

  .ap-stat--media {
    grid-column: 1 / -1;
    min-height: 180px;
  }

  .ap-eras {
    grid-template-columns: 1fr;
  }

  .ap-heritage-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .ap-team {
    padding-bottom: var(--space-10);
  }

  .ap-team-grid {
    gap: var(--space-4) var(--space-2);
  }

  .ap-person-name {
    font-size: var(--text-sm);
  }

  .ap-person-role {
    font-size: var(--text-xs);
  }

  .team-tray-panel {
    width: 100%;
  }

  .team-tray-body {
    padding: 22px 20px var(--space-4);
  }

  .team-tray-name {
    font-size: var(--text-xl);
  }

  .team-tray-media {
    aspect-ratio: 16 / 11;
    max-height: 180px;
  }
}

@media (max-width: 480px) {
  .ap-stats {
    grid-template-columns: 1fr;
  }

  .ap-stat--media {
    grid-column: auto;
  }

  .ap-team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
