/**
 * QSE Policies page — sections below the hero.
 * Philosophy, Commitment, Objectives, Policies with verification blocks.
 */

/* =========================================================================
 * Shared: section header
 *   - default: title left, intro right
 *   - --full:  title takes the full container width (no intro, no split)
 * ====================================================================== */

.bes-qse__section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

@media (min-width: 900px) {
  .bes-qse__section-head {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 64px;
    align-items: end;
  }
}

/* Full-width variant — title spans the entire container */
.bes-qse__section-head--full {
  grid-template-columns: 1fr !important;
  gap: 0;
}

.bes-qse__section-head--full > div,
.bes-qse__section-head--full h2 {
  width: 100%;
  max-width: none;
}

.bes-qse__section-head--full .bes-eyebrow {
  width: auto;
}

/* Keep the gold bar compact even on the full-width variant */
.bes-qse__section-head--full .bes-section__bar {
  width: 56px;
  max-width: 56px;
  margin-inline: 0;
}

/* Slightly larger title on the full-width variant since it has room */
@media (min-width: 1024px) {
  .bes-qse__section-head--full h2 {
    font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  }
}

/* Intro paragraph (used only by the Objectives section) */
.bes-qse__section-intro {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--bes-text-muted);
  margin: 0;
  max-width: 56ch;
}

@media (min-width: 900px) {
  .bes-qse__section-intro {
    padding-bottom: 6px;
  }
}

/* =========================================================================
 * Philosophy quote
 * ====================================================================== */

.bes-qse__philosophy {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(
    180deg,
    var(--bes-black) 0%,
    var(--bes-black-900) 100%
  );
  color: var(--bes-text-on-dark);
  padding-block: clamp(72px, 9vw, 128px);
  text-align: center;
}

/* Giant background quote glyph */
.bes-qse__philosophy-glyph {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%);
  font-family: var(--bes-font-head);
  font-size: clamp(18rem, 34vw, 34rem);
  line-height: 0.6;
  color: transparent;
  -webkit-text-stroke: 2px rgba(234, 193, 23, 0.09);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.bes-qse__philosophy-inner {
  position: relative;
  z-index: 2;
  max-width: 960px;
}

.bes-qse__philosophy-title {
  font-family: var(--bes-font-head);
  font-size: clamp(1.75rem, 3.6vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--bes-white);
  margin: 22px auto 28px;
  letter-spacing: -0.008em;
  max-width: 22ch;
  opacity: 0;
  animation: bes-fade-up 800ms var(--bes-ease-out) 200ms forwards;
}

.bes-qse__philosophy-attr {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--bes-font-head);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bes-gold);
  opacity: 0;
  animation: bes-fade-up 800ms var(--bes-ease-out) 500ms forwards;
}

.bes-qse__philosophy-rule {
  display: inline-block;
  width: 0;
  height: 2px;
  background: var(--bes-gold);
  animation: bes-qse-rule 1000ms var(--bes-ease-out) 800ms forwards;
}

@keyframes bes-qse-rule {
  to {
    width: 40px;
  }
}

/* =========================================================================
 * Commitment
 * ====================================================================== */

.bes-qse__commit {
  position: relative;
}

.bes-qse__commitment {
  position: relative;
  margin-top: -60px;
  z-index: 2;
}

.bes-qse__commitment-card {
  position: relative;
  background: var(--bes-white);
  padding: clamp(32px, 5vw, 56px);
  border-top: 6px solid var(--bes-gold);
  box-shadow: var(--bes-shadow-lg);
  max-width: 900px;
  margin-inline: auto;
  overflow: hidden;
  isolation: isolate;
}

/* Index number */
.bes-qse__commitment-index {
  position: absolute;
  top: 22px;
  right: 26px;
  font-family: var(--bes-font-head);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(109, 105, 104, 0.42);
  z-index: 2;
}

/* Head */
.bes-qse__commitment-head {
  margin-bottom: 24px;
}

.bes-qse__commitment-head h2 {
  margin-bottom: 0;
}

/* Body */
.bes-qse__commitment-body p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--bes-text);
  margin-bottom: 1.2em;
}

.bes-qse__commitment-body p:last-child {
  margin-bottom: 0;
}

/* Principles strip */
.bes-qse__principles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  list-style: none;
  margin: 32px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--bes-border);
}

@media (min-width: 640px) {
  .bes-qse__principles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
}

.bes-qse__principle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bes-silver-50);
  border-left: 3px solid var(--bes-gold);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bes-text);
  transition:
    background var(--bes-dur-fast) var(--bes-ease),
    transform var(--bes-dur-fast) var(--bes-ease),
    box-shadow var(--bes-dur-fast) var(--bes-ease);
}

.bes-qse__principle:hover {
  background: var(--bes-white);
  transform: translateY(-2px);
  box-shadow: var(--bes-shadow-sm);
}

.bes-qse__principle svg {
  width: 14px;
  height: 14px;
  color: var(--bes-gold);
  flex-shrink: 0;
}

/* =========================================================================
 * Objectives — numbered cards
 * ====================================================================== */

.bes-qse__objectives {
  background: var(--bes-silver-50);
}

.bes-qse__objectives-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .bes-qse__objectives-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .bes-qse__objectives-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
  }
}

/* Card */
.bes-qse__objective-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px 26px 30px;
  min-height: 220px;
  background: var(--bes-white);
  border: 1px solid var(--bes-border);
  border-top: 4px solid var(--bes-gold);
  overflow: hidden;
  isolation: isolate;
  translate: 0 0;
  transition:
    translate 380ms var(--bes-ease-out),
    border-color 380ms var(--bes-ease-out),
    box-shadow 380ms var(--bes-ease-out);
}

/* Diagonal gold sweep */
.bes-qse__objective-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(234, 193, 23, 0.11) 50%,
    transparent 100%
  );
  transform: skewX(-16deg);
  transition: left 900ms var(--bes-ease-out);
  pointer-events: none;
  z-index: 0;
}

.bes-qse__objective-card:hover::before {
  left: 140%;
}

.bes-qse__objective-card:hover {
  translate: 0 -6px;
  border-color: var(--bes-gold);
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.1),
    var(--bes-glow-sm);
}

.bes-qse__objective-card > * {
  position: relative;
  z-index: 1;
}

/* Number */
.bes-qse__objective-num {
  font-family: var(--bes-font-head);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(109, 105, 104, 0.55);
  transition: color var(--bes-dur) var(--bes-ease);
}

.bes-qse__objective-card:hover .bes-qse__objective-num {
  color: var(--bes-gold-600);
}

/* Icon tile */
.bes-qse__objective-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--bes-gold), var(--bes-gold-600));
  color: var(--bes-black);
  box-shadow: 0 8px 18px rgba(234, 193, 23, 0.25);
  transition: transform var(--bes-dur) var(--bes-ease);
}

.bes-qse__objective-icon svg {
  width: 18px;
  height: 18px;
}

.bes-qse__objective-card:hover .bes-qse__objective-icon {
  transform: scale(1.08) rotate(-4deg);
}

/* Text */
.bes-qse__objective-text {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--bes-text);
  margin: 0;
}

.bes-qse__objective-text strong {
  font-weight: 600;
  color: var(--bes-text);
}

/* Stagger */
@keyframes bes-qse-obj-in {
  from {
    opacity: 0;
    transform: translateY(28px) rotate(2deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bes-qse__objectives-grid[data-stagger] > .bes-qse__objective-card {
  opacity: 0;
}

.bes-qse__objectives-grid[data-stagger].is-visible > .bes-qse__objective-card {
  animation: bes-qse-obj-in 700ms var(--bes-ease-out) both;
  animation-delay: calc(var(--bes-stagger-i, 0) * 100ms + 60ms);
}

/* =========================================================================
 * Policies — circular ISO marks + verification blocks
 * ====================================================================== */

.bes-qse__policies-wrap {
  background: var(--bes-white);
}

.bes-qse__policies {
  margin-top: 0;
  display: grid;
  gap: 28px;
}

/* Each policy — horizontal split at desktop */
.bes-policy {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  background: var(--bes-white);
  border: 1px solid var(--bes-border);
  border-top: 4px solid var(--bes-gold);
  padding: 40px 32px;
  overflow: hidden;
  isolation: isolate;
  translate: 0 0;
  transition:
    translate 400ms var(--bes-ease-out),
    border-color 400ms var(--bes-ease-out),
    box-shadow 400ms var(--bes-ease-out);
}

@media (min-width: 1024px) {
  .bes-policy {
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 48px;
    padding: 48px 44px;
    align-items: start;
  }
}

/* Hover lift */
.bes-policy:hover {
  translate: 0 -4px;
  border-top-color: var(--bes-gold-600);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.1),
    var(--bes-glow-sm);
}

/* Diagonal gold sweep on hover */
.bes-policy::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(234, 193, 23, 0.08) 50%,
    transparent 100%
  );
  transform: skewX(-16deg);
  transition: left 1000ms var(--bes-ease-out);
  pointer-events: none;
  z-index: 0;
}

.bes-policy:hover::before {
  left: 150%;
}

.bes-policy > * {
  position: relative;
  z-index: 1;
}

/* === Head column === */

.bes-policy__head {
  display: flex;
  flex-direction: column;
  gap: 0;
}

@media (min-width: 1024px) {
  .bes-policy__head {
    padding-right: 32px;
    border-right: 1px solid var(--bes-border);
  }
}

@media (max-width: 1023px) {
  .bes-policy__head {
    padding-bottom: 28px;
    border-bottom: 1px solid var(--bes-border);
  }
}

/* --- Circular ISO mark --- */

.bes-policy__mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: var(--bes-white);
  color: var(--bes-black);
  font-family: var(--bes-font-head);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  margin-bottom: 26px;
  overflow: visible;
  transition:
    transform var(--bes-dur-slow) var(--bes-ease-out),
    box-shadow var(--bes-dur) var(--bes-ease);
  box-shadow:
    0 0 0 1px rgba(234, 193, 23, 0.35),
    0 12px 30px rgba(0, 0, 0, 0.08);
  z-index: 1;
}

.bes-policy__mark-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bes-black);
  color: var(--bes-gold);
  font-size: 0.9375rem;
  text-align: center;
  padding: 0 12px;
  line-height: 1.1;
}

.bes-policy__mark--image {
  background: var(--bes-white);
}

.bes-policy__mark--image img {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
  object-position: center;
  border-radius: 50%;
  display: block;
  z-index: 2;
  transition: transform var(--bes-dur-slow) var(--bes-ease-out);
  image-rendering: -webkit-optimize-contrast;
}

/* Soft gold inner ring */
.bes-policy__mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(234, 193, 23, 0.5);
  pointer-events: none;
  z-index: 3;
  opacity: 0.55;
  transition: opacity var(--bes-dur) var(--bes-ease);
}

/* Rotating orbit ring */
.bes-policy__orbit {
  position: absolute;
  inset: -14px;
  border: 1px dashed rgba(234, 193, 23, 0.65);
  border-radius: 50%;
  animation: bes-policy-orbit 16s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.bes-policy__orbit::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--bes-gold);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(234, 193, 23, 0.85);
  transform: translateX(-50%);
}

@keyframes bes-policy-orbit {
  to {
    transform: rotate(360deg);
  }
}

/* Offset each card's orbit so they don't look synchronised */
.bes-qse__policies > .bes-policy:nth-child(2) .bes-policy__orbit {
  animation-delay: -5.3s;
}
.bes-qse__policies > .bes-policy:nth-child(3) .bes-policy__orbit {
  animation-delay: -10.6s;
}

.bes-policy:hover .bes-policy__mark {
  transform: scale(1.05);
  box-shadow:
    0 0 0 1px rgba(234, 193, 23, 0.75),
    0 16px 42px rgba(234, 193, 23, 0.2);
}

.bes-policy:hover .bes-policy__mark::after {
  opacity: 1;
}
.bes-policy:hover .bes-policy__mark--image img {
  transform: scale(1.04);
}

/* Title + subtitle */
.bes-policy__title {
  font-family: var(--bes-font-head);
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0 0 6px;
  color: var(--bes-text);
}

.bes-policy__sub {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bes-gold-600);
  margin: 0 0 24px;
}

/* --- Verification block (QR + direct link) --- */

.bes-policy__verify {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px dashed rgba(234, 193, 23, 0.4);
}

.bes-policy__qr {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  transition: transform var(--bes-dur) var(--bes-ease);
}

.bes-policy__qr img {
  display: block;
  width: 120px;
  height: 120px;
  background: var(--bes-white);
  padding: 6px;
  border: 1px solid var(--bes-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: box-shadow var(--bes-dur) var(--bes-ease);
}

.bes-policy__qr:hover {
  transform: scale(1.03);
}

.bes-policy__qr:hover img {
  box-shadow:
    0 8px 24px rgba(234, 193, 23, 0.28),
    var(--bes-glow-sm);
}

.bes-policy__qr-hint {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bes-text-muted);
}

/* Direct link button */
.bes-policy__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 12px 16px;
  background: var(--bes-black);
  color: var(--bes-white);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  overflow: hidden;
  isolation: isolate;
  align-self: flex-start;
  transition:
    background var(--bes-dur-fast) var(--bes-ease),
    color var(--bes-dur-fast) var(--bes-ease),
    transform var(--bes-dur-fast) var(--bes-ease),
    box-shadow var(--bes-dur-fast) var(--bes-ease);
}

.bes-policy__link span {
  position: relative;
  z-index: 2;
}

.bes-policy__link svg {
  position: relative;
  z-index: 2;
  width: 14px;
  height: 14px;
  transition: transform var(--bes-dur) var(--bes-ease);
}

.bes-policy__link:hover {
  background: var(--bes-gold);
  color: var(--bes-black);
  transform: translateY(-2px);
  box-shadow: var(--bes-glow-md);
}

.bes-policy__link:hover svg {
  transform: translateX(4px);
}

.bes-policy__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--bes-gold);
  z-index: 3;
  transition: background var(--bes-dur-fast) var(--bes-ease);
}

.bes-policy__link:hover::before {
  background: var(--bes-black);
}

/* === Body column === */

.bes-policy__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.bes-policy__desc {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--bes-text);
  margin: 0;
}

.bes-policy__desc:first-letter {
  font-family: var(--bes-font-head);
  font-size: 3rem;
  font-weight: 700;
  line-height: 0.9;
  float: left;
  margin: 0 10px 0 0;
  color: var(--bes-gold-600);
}

.bes-policy__list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.bes-policy__list li {
  position: relative;
  padding-left: 26px;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--bes-text);
  transition: color var(--bes-dur-fast) var(--bes-ease);
}

.bes-policy__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 12px;
  height: 2px;
  background: var(--bes-gold);
  transition: width var(--bes-dur) var(--bes-ease);
}

.bes-policy__list li:hover::before {
  width: 18px;
}

/* === Stagger reveal === */

@keyframes bes-policy-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bes-qse__policies[data-stagger] > .bes-policy {
  opacity: 0;
}

.bes-qse__policies[data-stagger].is-visible > .bes-policy {
  animation: bes-policy-in 780ms var(--bes-ease-out) both;
  animation-delay: calc(var(--bes-stagger-i, 0) * 120ms + 60ms);
}

/* =========================================================================
 * Reduced motion
 * ====================================================================== */

@media (prefers-reduced-motion: reduce) {
  .bes-qse__philosophy-glyph,
  .bes-qse__philosophy-title,
  .bes-qse__philosophy-attr,
  .bes-qse__philosophy-rule {
    animation: none !important;
    opacity: 1 !important;
  }
  .bes-qse__philosophy-rule {
    width: 40px !important;
  }

  .bes-policy__orbit {
    animation: none;
  }
  .bes-qse__objectives-grid[data-stagger] > .bes-qse__objective-card,
  .bes-qse__policies[data-stagger] > .bes-policy {
    opacity: 1 !important;
    animation: none !important;
  }

  .bes-policy,
  .bes-qse__objective-card,
  .bes-qse__principle {
    transition: none;
  }
}

/* =========================================================================
 * Mobile tuning
 * ====================================================================== */

@media (max-width: 639px) {
  .bes-qse__philosophy-glyph {
    font-size: 12rem;
    -webkit-text-stroke-width: 1px;
  }

  .bes-qse__commitment-card {
    padding: 28px 22px;
  }
  .bes-qse__commitment-index {
    top: 16px;
    right: 18px;
  }

  .bes-policy {
    padding: 32px 22px;
  }

  .bes-policy__mark {
    width: 108px;
    height: 108px;
    margin-bottom: 20px;
  }
  .bes-policy__orbit {
    inset: -10px;
  }
  .bes-policy__orbit::after {
    width: 6px;
    height: 6px;
  }

  .bes-policy__title {
    font-size: 1.25rem;
  }
  .bes-policy__qr img {
    width: 96px;
    height: 96px;
  }
  .bes-policy__link {
    width: 100%;
    justify-content: space-between;
  }
}

/* =========================================================================
 * In-Progress Certification State
 * ====================================================================== */

.bes-policy--in-progress {
  background: #fafafa;
  border-color: #e2e2e2;
  border-top-color: #d1d1d1;
  opacity: 0.9;
}

/* Disable the hover lift and gold sweep for the in-progress card */
.bes-policy--in-progress::before {
  display: none !important;
}

.bes-policy--in-progress:hover {
  translate: 0 0;
  border-top-color: #d1d1d1;
  box-shadow: none;
}

/* Gray out the ISO orbit and mark */
.bes-policy--in-progress .bes-policy__orbit {
  animation: none;
  border-color: rgba(0, 0, 0, 0.08);
}

.bes-policy--in-progress .bes-policy__orbit::after {
  background: #ccc;
  box-shadow: none;
}

.bes-policy--in-progress .bes-policy__mark {
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  filter: grayscale(100%);
}

.bes-policy--in-progress .bes-policy__mark-text {
  background: #eee;
  color: #888;
}

/* Mute text colors */
.bes-policy--in-progress .bes-policy__title {
  color: #666;
}

.bes-policy--in-progress .bes-policy__sub {
  color: #999;
}

.bes-policy--in-progress .bes-policy__list li {
  color: #888;
}

.bes-policy--in-progress .bes-policy__list li::before {
  background: #ccc;
}

/* "In Progress" Badge */
.bes-policy__badge-progress {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #eac117; /* Gold */
  color: #000;
  padding: 6px 14px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 4px;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(234, 193, 23, 0.3);
}
