/* gallery.html ONLY — affidavit body glass (affidavit.css 3588–3698, 4556–4587)
   Scoped: main#gallery-page-body — stats band uses gallery-page-stats-glass.css
   Body: open-roles, perks, hiring split, section-heading--split, media-frame
   Grenier purple tokens: rgba(72, 27, 130, …) */

/* --- Grid (affidavit 514–525) — stats band only; photo grid stays in gallery.css --- */
html[data-gallery-page] main#gallery-page-body .gallery-stats-band .grid,
html[data-gallery-page] main#gallery-page-body .gallery-apply-cta .grid {
  display: grid !important;
  gap: 22px;
  width: 100%;
}

html[data-gallery-page] main#gallery-page-body .gallery-stats-band .grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* --- glass-caption (affidavit 4556–4558) --- */
html[data-gallery-page] main#gallery-page-body .glass-caption {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12.6px;
  width: 100%;
  height: 100%;
  padding: clamp(18px, 2.6vw, 28px);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(72, 27, 130, 0.14), transparent 34%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.9), rgba(250, 248, 255, 0.72) 52%, rgba(245, 240, 252, 0.62)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    0 34px 70px rgba(72, 27, 130, 0.2),
    0 14px 30px rgba(72, 27, 130, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -2px 0 rgba(72, 27, 130, 0.1);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease;
}

html[data-gallery-page] main#gallery-page-body .job-card .glass-caption {
  display: flex;
  flex-direction: column;
}

html[data-gallery-page] main#gallery-page-body .glass-caption::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0.16));
  pointer-events: none;
}

html[data-gallery-page] main#gallery-page-body .glass-caption > * {
  position: relative;
  z-index: 2;
}

/* --- Shell nullify: article-card + job-card + content-card (affidavit 4559) --- */
html[data-gallery-page] main#gallery-page-body .article-card,
html[data-gallery-page] main#gallery-page-body .job-card,
html[data-gallery-page] main#gallery-page-body .content-card {
  position: relative;
  isolation: isolate;
  overflow: visible;
  transform: translateY(0);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 !important;
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-gallery-page] main#gallery-page-body .article-card::before,
html[data-gallery-page] main#gallery-page-body .job-card::before,
html[data-gallery-page] main#gallery-page-body .content-card::before {
  display: none;
}

html[data-gallery-page] main#gallery-page-body .article-card:hover .glass-caption,
html[data-gallery-page] main#gallery-page-body .job-card:hover .glass-caption,
html[data-gallery-page] main#gallery-page-body .content-card:hover .glass-caption {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.76);
  box-shadow:
    0 44px 86px rgba(72, 27, 130, 0.24),
    0 18px 34px rgba(72, 27, 130, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    inset 0 -2px 0 rgba(72, 27, 130, 0.12);
}

/* --- Inner caption panel (affidavit 3639) --- */
html[data-gallery-page] main#gallery-page-body .article-card__caption,
html[data-gallery-page] main#gallery-page-body .job-card__caption {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  text-align: left;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.88) 0%, rgba(250, 248, 255, 0.8) 52%, rgba(245, 240, 252, 0.74) 100%),
    rgba(255, 255, 255, 0.38);
  box-shadow:
    0 18px 36px rgba(72, 27, 130, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(72, 27, 130, 0.08);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

html[data-gallery-page] main#gallery-page-body .career-perk-card .article-card__caption,
html[data-gallery-page] main#gallery-page-body .career-hiring-step .article-card__caption {
  align-items: center;
  text-align: center;
}

/* --- M4: caption double-stack (affidavit 3639 + 4564) — non-stats cards --- */
html[data-gallery-page] main#gallery-page-body .career-perk-card .article-card__caption,
html[data-gallery-page] main#gallery-page-body .career-hiring-step .article-card__caption,
html[data-gallery-page] main#gallery-page-body .job-card__caption {
  transform: translateY(0);
  box-shadow:
    0 24px 48px rgba(72, 27, 130, 0.16),
    0 12px 24px rgba(72, 27, 130, 0.08),
    0 18px 36px rgba(72, 27, 130, 0.12),
    0 8px 18px rgba(72, 27, 130, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(72, 27, 130, 0.08);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease,
    filter 0.28s ease;
}

html[data-gallery-page] main#gallery-page-body .career-perk-card .article-card__caption::before,
html[data-gallery-page] main#gallery-page-body .career-hiring-step .article-card__caption::before,
html[data-gallery-page] main#gallery-page-body .job-card__caption::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 54%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0));
  pointer-events: none;
}

html[data-gallery-page] main#gallery-page-body .career-perk-card:hover .article-card__caption,
html[data-gallery-page] main#gallery-page-body .career-hiring-step:hover .article-card__caption,
html[data-gallery-page] main#gallery-page-body .job-card:hover .job-card__caption {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.74);
  filter: brightness(1.02);
}

/* --- M1: button-row (affidavit §6.3) --- */
html[data-gallery-page] main#gallery-page-body .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10.8px;
  align-items: center;
}

html[data-gallery-page] main#gallery-page-body .gallery-narrative-card .content-card h2,
html[data-gallery-page] main#gallery-page-body .gallery-narrative-card h2 {
  width: fit-content;
  max-width: 100%;
}

/* --- section-heading (affidavit 4561–4563) --- */
html[data-gallery-page] main#gallery-page-body .section-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-bottom: 36px;
}

html[data-gallery-page] main#gallery-page-body .section-heading > div {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(72, 27, 130, 0.14), transparent 34%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.9), rgba(250, 248, 255, 0.72) 52%, rgba(245, 240, 252, 0.62)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    0 30px 62px rgba(72, 27, 130, 0.18),
    0 12px 26px rgba(72, 27, 130, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -2px 0 rgba(72, 27, 130, 0.1);
  backdrop-filter: blur(26px) saturate(154%);
  -webkit-backdrop-filter: blur(26px) saturate(154%);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

html[data-gallery-page] main#gallery-page-body .section-heading > div::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0.16));
  pointer-events: none;
}

html[data-gallery-page] main#gallery-page-body .section-heading > div > * {
  position: relative;
  z-index: 2;
}

html[data-gallery-page] main#gallery-page-body .section-heading > div:hover {
  transform: translateY(-8px);
}

/* --- Raised pills: text elements only (NOT list items, NOT buttons) --- */
html[data-gallery-page] main#gallery-page-body .eyebrow,
html[data-gallery-page] main#gallery-page-body .gallery-stats-band .article-card h3,
html[data-gallery-page] main#gallery-page-body .gallery-stats-band .article-card p,
html[data-gallery-page] main#gallery-page-body .job-card__label,
html[data-gallery-page] main#gallery-page-body .job-card__caption > p,
html[data-gallery-page] main#gallery-page-body .content-card h2,
html[data-gallery-page] main#gallery-page-body .content-card p,
html[data-gallery-page] main#gallery-page-body .detail-list li,
html[data-gallery-page] main#gallery-page-body .section-heading h2,
html[data-gallery-page] main#gallery-page-body .section-heading > p,
html[data-gallery-page] main#gallery-page-body .section-heading__text p,
html[data-gallery-page] main#gallery-page-body .image-story__eyebrow,
html[data-gallery-page] main#gallery-page-body .image-story__title,
html[data-gallery-page] main#gallery-page-body .image-story__copy {
  position: relative;
  overflow: hidden;
  transform: translateY(0);
  margin: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(245, 240, 252, 0.46)),
    rgba(255, 255, 255, 0.38);
  box-shadow:
    0 18px 36px rgba(72, 27, 130, 0.12),
    0 8px 18px rgba(72, 27, 130, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(72, 27, 130, 0.08);
  backdrop-filter: blur(18px) saturate(142%);
  -webkit-backdrop-filter: blur(18px) saturate(142%);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease,
    filter 0.28s ease;
}

html[data-gallery-page] main#gallery-page-body .eyebrow::before,
html[data-gallery-page] main#gallery-page-body .article-card h3::before,
html[data-gallery-page] main#gallery-page-body .job-card__label::before,
html[data-gallery-page] main#gallery-page-body .article-card p::before,
html[data-gallery-page] main#gallery-page-body .job-card__caption > p::before,
html[data-gallery-page] main#gallery-page-body .content-card h2::before,
html[data-gallery-page] main#gallery-page-body .content-card p::before,
html[data-gallery-page] main#gallery-page-body .detail-list li::before,
html[data-gallery-page] main#gallery-page-body .section-heading h2::before,
html[data-gallery-page] main#gallery-page-body .section-heading > p::before,
html[data-gallery-page] main#gallery-page-body .section-heading__text p::before,
html[data-gallery-page] main#gallery-page-body .image-story__eyebrow::before,
html[data-gallery-page] main#gallery-page-body .image-story__title::before,
html[data-gallery-page] main#gallery-page-body .image-story__copy::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto;
  height: 54%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0));
  pointer-events: none;
}

html[data-gallery-page] main#gallery-page-body .eyebrow {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 9px 16px !important;
  font-family: "DM Sans", sans-serif !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase !important;
  color: #275c53 !important;
}

html[data-gallery-page] main#gallery-page-body .article-card h3,
html[data-gallery-page] main#gallery-page-body .job-card__label {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  border-radius: 24px;
  padding: 12px 16px !important;
  font-family: "DM Sans", sans-serif !important;
  font-size: clamp(1rem, 1.8vw, 1.2rem) !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  color: #2e0c5e !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

html[data-gallery-page] main#gallery-page-body .content-card h2 {
  width: fit-content;
  max-width: 100%;
  border-radius: 24px;
  padding: 12px 16px !important;
  font-size: clamp(1.45rem, 2.2vw, 2rem) !important;
  font-weight: 700 !important;
  line-height: 1.08 !important;
  color: #222222 !important;
}

html[data-gallery-page] main#gallery-page-body .article-card p,
html[data-gallery-page] main#gallery-page-body .job-card__caption > p,
html[data-gallery-page] main#gallery-page-body .content-card p,
html[data-gallery-page] main#gallery-page-body .section-heading__text p,
html[data-gallery-page] main#gallery-page-body .image-story__copy {
  width: 100%;
  max-width: 100%;
  border-radius: 18px;
  padding: 14px 16px !important;
  font-family: "DM Sans", sans-serif !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  color: #444444 !important;
  line-height: 1.55 !important;
}

html[data-gallery-page] main#gallery-page-body .section-heading h2 {
  width: fit-content;
  max-width: 100%;
  border-radius: 24px;
  padding: 12px 16px !important;
  font-size: clamp(1.65rem, 2.35vw, 2.35rem) !important;
  line-height: 1.05 !important;
  font-weight: 700 !important;
  color: #222222 !important;
}

html[data-gallery-page] main#gallery-page-body .section-heading > p {
  flex: 1 1 360px;
  width: auto;
  max-width: 60ch;
  align-self: center;
  border-radius: 24px;
  padding: 14px 16px !important;
  font-size: 1.02rem !important;
  line-height: 1.6 !important;
  color: #555555 !important;
}

/* --- Lists: affidavit per-li raised pills (affidavit 4564 / 4571) --- */
html[data-gallery-page] main#gallery-page-body .detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}

html[data-gallery-page] main#gallery-page-body .detail-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 12px 14px !important;
  border-radius: 18px;
  font-size: 0.82rem !important;
  line-height: 1.45 !important;
  color: #555555 !important;
}

/* Hiring intro + content-card lists: full-width rounded pills (affidavit 4566–4571) */
html[data-gallery-page] main#gallery-page-body .content-card .detail-list li,
html[data-gallery-page] main#gallery-page-body .career-hiring-intro .detail-list li {
  border-radius: 18px;
  padding: 14px 16px !important;
}

html[data-gallery-page] main#gallery-page-body .career-job-meta {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

html[data-gallery-page] main#gallery-page-body .career-job-meta li {
  flex: 1 1 auto;
  min-width: min(100%, 200px);
  width: auto;
  padding: 8px 12px !important;
  border-radius: 14px;
  font-size: 0.76rem !important;
}

html[data-gallery-page] main#gallery-page-body .career-job-meta i {
  color: #275c53;
  margin-right: 5px;
}

/* --- Actions row --- */
html[data-gallery-page] main#gallery-page-body .service-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  margin-top: auto !important;
  padding-top: 6px;
}

html[data-gallery-page] main#gallery-page-body .article-card__caption .service-card__links {
  margin-top: 14px !important;
}

html[data-gallery-page] main#gallery-page-body .service-card__links a:not(.cmn--btn):not(.cmn--btn3) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 4px;
  padding: 10px 14px !important;
  border-radius: 18px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  color: #2e0c5e !important;
  text-decoration: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(245, 240, 252, 0.68)),
    rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 18px 34px rgba(72, 27, 130, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease;
}

html[data-gallery-page] main#gallery-page-body .service-card__links a:not(.cmn--btn):not(.cmn--btn3):hover {
  transform: translateY(-4px);
  box-shadow:
    0 24px 46px rgba(72, 27, 130, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-gallery-page] main#gallery-page-body .service-card__links .cmn--btn,
html[data-gallery-page] main#gallery-page-body .service-card__links .cmn--btn3 {
  flex: 1 1 0;
  min-width: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  margin: 0 !important;
  padding: 10px 12px !important;
  font-size: 0.74rem !important;
  letter-spacing: 0.03em;
  border-radius: 18px !important;
  position: relative;
  overflow: visible;
  background: unset;
  box-shadow: unset;
  backdrop-filter: none;
}

html[data-gallery-page] main#gallery-page-body .service-card__links .cmn--btn::before,
html[data-gallery-page] main#gallery-page-body .service-card__links .cmn--btn3::before {
  display: none !important;
}

/* --- job-card image (affidavit 4577, 4582–4583) --- */
html[data-gallery-page] main#gallery-page-body .job-card__img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  flex-shrink: 0;
}

html[data-gallery-page] main#gallery-page-body .job-card__img-wrap a {
  display: block;
  width: 100%;
}

html[data-gallery-page] main#gallery-page-body .job-card__img-wrap img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center center;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), filter 0.32s ease;
}

html[data-gallery-page] main#gallery-page-body .job-card:hover .job-card__img-wrap img {
  transform: scale(1.035);
  filter: saturate(1.05) contrast(1.03);
}

/* --- Section padding --- */
html[data-gallery-page] main#gallery-page-body .gallery-open-work,
html[data-gallery-page] main#gallery-page-body section.perks,
html[data-gallery-page] main#gallery-page-body section.hiring {
  padding-top: clamp(64px, 8vw, 100px);
  padding-bottom: clamp(56px, 7vw, 90px);
}

/* --- M3: Pass A unified glass on section-heading wrapper (affidavit 3470–3517) --- */
html[data-gallery-page] main#gallery-page-body .section-heading--split {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(72, 27, 130, 0.1), transparent 36%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.82), rgba(250, 248, 255, 0.68) 52%, rgba(245, 240, 252, 0.58)),
    rgba(255, 255, 255, 0.36);
  box-shadow:
    0 28px 58px rgba(72, 27, 130, 0.14),
    0 10px 22px rgba(72, 27, 130, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -2px 0 rgba(72, 27, 130, 0.08);
  backdrop-filter: blur(24px) saturate(152%);
  -webkit-backdrop-filter: blur(24px) saturate(152%);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

html[data-gallery-page] main#gallery-page-body .section-heading--split::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.04) 42%, rgba(255, 255, 255, 0.14));
  pointer-events: none;
}

html[data-gallery-page] main#gallery-page-body .section-heading--split > * {
  position: relative;
  z-index: 1;
}

/* --- section-heading--split grid (affidavit 3543–3585) --- */
html[data-gallery-page] main#gallery-page-body .section-heading--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 18px;
  margin-bottom: 36px;
}

html[data-gallery-page] main#gallery-page-body .section-heading--split .section-heading__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

html[data-gallery-page] main#gallery-page-body .section-heading--split .section-heading__text {
  padding: 22px 24px;
  border-radius: 20px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.88) 0%, rgba(250, 248, 255, 0.8) 52%, rgba(245, 240, 252, 0.74) 100%);
  border: 1px solid rgba(255, 255, 255, 0.64);
  box-shadow:
    0 24px 48px rgba(72, 27, 130, 0.16),
    0 12px 24px rgba(72, 27, 130, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -1px 0 rgba(72, 27, 130, 0.08);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
}

html[data-gallery-page] main#gallery-page-body .section-heading--split .section-heading__text p {
  margin: 0 !important;
}

html[data-gallery-page] main#gallery-page-body .section-heading--split .section-heading__media {
  display: flex;
  height: 100%;
}

html[data-gallery-page] main#gallery-page-body .section-heading__img-wrap {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.64);
  box-shadow:
    0 24px 48px rgba(72, 27, 130, 0.16),
    0 12px 24px rgba(72, 27, 130, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

html[data-gallery-page] main#gallery-page-body .section-heading__img-wrap img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
  display: block;
}

html[data-gallery-page] main#gallery-page-body .section-heading--split > .section-heading__content,
html[data-gallery-page] main#gallery-page-body .section-heading--split > .section-heading__media {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(72, 27, 130, 0.14), transparent 34%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.9), rgba(250, 248, 255, 0.72) 52%, rgba(245, 240, 252, 0.62)),
    rgba(255, 255, 255, 0.44);
  box-shadow:
    0 30px 62px rgba(72, 27, 130, 0.18),
    0 12px 26px rgba(72, 27, 130, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -2px 0 rgba(72, 27, 130, 0.1);
  backdrop-filter: blur(26px) saturate(154%);
  -webkit-backdrop-filter: blur(26px) saturate(154%);
}

/* --- split + content-card + media-frame (affidavit 584–589, 4215–4287) --- */
html[data-gallery-page] main#gallery-page-body .split {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 28px;
  align-items: center;
}

html[data-gallery-page] main#gallery-page-body .media-frame {
  position: relative;
  isolation: isolate;
  transform: translateY(0);
  display: grid;
  gap: 18px;
  padding: 18px;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background:
    radial-gradient(circle at top right, rgba(72, 27, 130, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 248, 255, 0.86)),
    rgba(255, 255, 255, 0.9);
  box-shadow:
    0 56px 112px rgba(72, 27, 130, 0.22),
    0 24px 48px rgba(72, 27, 130, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.94),
    inset 0 -2px 0 rgba(72, 27, 130, 0.08);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease;
}

html[data-gallery-page] main#gallery-page-body .media-frame::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08) 40%, rgba(255, 255, 255, 0.18) 100%);
  pointer-events: none;
  z-index: 1;
}

html[data-gallery-page] main#gallery-page-body .media-frame:hover {
  transform: translateY(-10px);
}

html[data-gallery-page] main#gallery-page-body .media-frame__visual {
  position: relative;
  z-index: 2;
  overflow: hidden;
  border-radius: 20px;
  background: #ffffff;
  box-shadow:
    0 34px 64px rgba(72, 27, 130, 0.18),
    0 0 0 1px rgba(245, 240, 252, 0.86);
}

html[data-gallery-page] main#gallery-page-body .media-frame__visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), filter 0.32s ease;
}

html[data-gallery-page] main#gallery-page-body .media-frame:hover .media-frame__visual img {
  transform: scale(1.035);
  filter: saturate(1.05) contrast(1.03);
}

html[data-gallery-page] main#gallery-page-body .image-story {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background:
    radial-gradient(circle at top right, rgba(72, 27, 130, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(250, 248, 255, 0.82)),
    rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(142%);
  -webkit-backdrop-filter: blur(20px) saturate(142%);
}

html[data-gallery-page] main#gallery-page-body .image-story__eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 9px 16px !important;
  border-radius: 999px;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: #275c53 !important;
}

html[data-gallery-page] main#gallery-page-body .image-story__title {
  display: block;
  width: fit-content;
  max-width: 100%;
  border-radius: 24px;
  padding: 12px 16px !important;
  font-size: clamp(1rem, 1.45vw, 1.2rem) !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  color: #2e0c5e !important;
}

@media (max-width: 1199px) {
  html[data-gallery-page] main#gallery-page-body .gallery-stats-band .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  html[data-gallery-page] main#gallery-page-body .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  html[data-gallery-page] main#gallery-page-body .glass-caption {
    padding: 16px;
    gap: 12px;
  }

  html[data-gallery-page] main#gallery-page-body .article-card h3,
  html[data-gallery-page] main#gallery-page-body .job-card__label,
  html[data-gallery-page] main#gallery-page-body .section-heading h2,
  html[data-gallery-page] main#gallery-page-body .content-card h2,
  html[data-gallery-page] main#gallery-page-body .image-story__title {
    width: 100%;
  }

  html[data-gallery-page] main#gallery-page-body .section-heading {
    align-items: stretch;
  }

  html[data-gallery-page] main#gallery-page-body .section-heading > div,
  html[data-gallery-page] main#gallery-page-body .section-heading > p {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }

  html[data-gallery-page] main#gallery-page-body .section-heading--split {
    grid-template-columns: 1fr;
  }

  html[data-gallery-page] main#gallery-page-body .section-heading--split .section-heading__media {
    min-height: 280px;
  }

  html[data-gallery-page] main#gallery-page-body .image-story {
    padding: 16px;
  }
}

@media (max-width: 768px) {
  html[data-gallery-page] main#gallery-page-body .section-heading--split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  html[data-gallery-page] main#gallery-page-body .gallery-stats-band .grid--4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  html[data-gallery-page] main#gallery-page-body .article-card:hover .glass-caption,
  html[data-gallery-page] main#gallery-page-body .job-card:hover .glass-caption {
    transform: translateY(-6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html[data-gallery-page] main#gallery-page-body .glass-caption,
  html[data-gallery-page] main#gallery-page-body .article-card,
  html[data-gallery-page] main#gallery-page-body .job-card {
    transition: none !important;
  }

  html[data-gallery-page] main#gallery-page-body .article-card:hover .glass-caption,
  html[data-gallery-page] main#gallery-page-body .job-card:hover .glass-caption {
    transform: none !important;
  }
}

/* --- Gallery triple-stack completion + page text reader --- */
html[data-gallery-page] main#gallery-page-body .article-card::after,
html[data-gallery-page] main#gallery-page-body .job-card::after,
html[data-gallery-page] main#gallery-page-body .content-card::after,
html[data-gallery-page] main#gallery-page-body .media-frame::after,
html[data-gallery-page] main#gallery-page-body .section-heading--split::after {
  content: "";
  position: absolute;
  inset: auto 18px -12px 18px;
  z-index: -1;
  height: 34px;
  border-radius: 0 0 26px 26px;
  background: linear-gradient(180deg, rgba(72, 27, 130, 0.18), rgba(72, 27, 130, 0.04));
  filter: blur(4px);
  opacity: 0.76;
  pointer-events: none;
}

html[data-gallery-page] [data-gallery-text-reader="true"] { cursor: zoom-in; }
html[data-gallery-page] [data-gallery-text-reader="true"]:hover,
html[data-gallery-page] [data-gallery-text-reader="true"]:focus-visible {
  outline: 2px solid rgba(250, 204, 21, 0.58);
  outline-offset: 4px;
  filter: brightness(1.03);
}

.gallery-text-reader-tip {
  position: fixed;
  z-index: 9998;
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(245, 240, 252, 0.58)), rgba(255, 255, 255, 0.46);
  box-shadow: 0 18px 34px rgba(46, 12, 94, 0.2), 0 0 22px rgba(250, 204, 21, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  color: #2e0c5e;
  font: 800 12px/1.1 Manrope, Arial, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}
.gallery-text-reader-tip.is-visible { display: inline-flex; }
.gallery-text-reader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 4vw, 44px);
  background: rgba(20, 8, 40, 0.1);
  pointer-events: none;
}
.gallery-text-reader.is-open { display: flex; }
.gallery-text-reader__panel {
  width: min(980px, 92vw);
  max-height: 86vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: radial-gradient(circle at 12% 0%, rgba(250, 204, 21, 0.12), transparent 34%), linear-gradient(165deg, rgba(46, 12, 94, 0.42), rgba(72, 27, 130, 0.22)), rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.22), 0 48px 96px rgba(46, 12, 94, 0.34), 0 18px 38px rgba(46, 12, 94, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(14px) saturate(142%);
  -webkit-backdrop-filter: blur(14px) saturate(142%);
  pointer-events: auto;
}
.gallery-text-reader__bar,
.gallery-text-reader__tools { display: flex; align-items: center; gap: 10px; }
.gallery-text-reader__bar { justify-content: space-between; }
.gallery-text-reader__label,
.gallery-text-reader__button {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(46, 12, 94, 0.38);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  font-weight: 900;
}
.gallery-text-reader__label { padding: 8px 12px; }
.gallery-text-reader__button { min-width: 44px; height: 42px; padding: 0 12px; cursor: pointer; }
.gallery-text-reader__button:hover,
.gallery-text-reader__button:focus-visible { transform: translateY(-2px); outline: 2px solid rgba(250, 204, 21, 0.58); outline-offset: 3px; }
.gallery-text-reader__content {
  overflow: auto;
  max-height: calc(86vh - 112px);
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 248, 255, 0.84)), rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 24px 48px rgba(46, 12, 94, 0.2);
  color: #1c1c1c;
  font-family: Manrope, Arial, sans-serif;
  font-size: var(--gallery-reader-size, 24px);
  line-height: 1.55;
  white-space: pre-wrap;
}
.gallery-text-reader__source { margin: 0 0 10px; color: #481b82; font-size: 0.72rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.gallery-text-reader__text { margin: 0; font: inherit; }
.gallery-text-reader-launch {
  position: fixed;
  right: clamp(14px, 2vw, 24px);
  bottom: clamp(14px, 2vw, 24px);
  z-index: 9997;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.96), rgba(245, 184, 0, 0.9));
  color: #2e0c5e;
  box-shadow: 0 18px 36px rgba(46, 12, 94, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font: 900 0.82rem/1 Manrope, Arial, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.gallery-text-reader-launch:hover,
.gallery-text-reader-launch:focus-visible {
  transform: translateY(-2px);
  outline: 2px solid rgba(46, 12, 94, 0.42);
  outline-offset: 3px;
}

html[data-gallery-page] main#gallery-page-body .gallery-text-reader-inline {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 2px solid #2c0e53;
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.98), rgba(245, 184, 0, 0.92));
  color: #2e0c5e;
  box-shadow: 0 18px 36px rgba(46, 12, 94, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  font: 900 0.82rem/1 Manrope, Arial, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

html[data-gallery-page] main#gallery-page-body .gallery-text-reader-inline:hover,
html[data-gallery-page] main#gallery-page-body .gallery-text-reader-inline:focus-visible {
  transform: translateY(-2px);
  outline: 2px solid rgba(46, 12, 94, 0.42);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .gallery-text-reader { padding: 12px; }
  .gallery-text-reader__panel { width: min(100%, 94vw); max-height: 88vh; padding: 12px; }
  .gallery-text-reader__bar { align-items: stretch; flex-direction: column; }
  .gallery-text-reader__tools { flex-wrap: wrap; }
  .gallery-text-reader__button { flex: 1 1 auto; }
  .gallery-text-reader__content { max-height: calc(88vh - 164px); font-size: var(--gallery-reader-size, 20px); }
}
