/* [[ BLOCKS / COMPONENTS ]] 
   This file contains reusable BEM blocks that map to Sanity Schemas.
*/


/* ============================== */
/* [[[ BLOCK: STORY METADATA ]]] */
/* ============================== */

.story-metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--internal-space-md);
  margin-top: var(--internal-space-md);
  margin-bottom: var(--internal-space-lg);
  color: var(--color-primary-variant);
}

.story-metadata__author {
  display: flex;
  align-items: center;
  column-gap: var(--internal-space-xs);
}

.story-metadata__date {
  position: relative;
  padding-left: 1.25rem;
}

.story-metadata__date::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-accent);
}

@media (max-width: 800px) {
  .story-metadata {
    column-gap: 1rem;
    font-size: 0.85rem;
  }
}


/* ============================== */
/* [[[ BLOCK: PAGE HEADER ]]] */
/* ============================== */




/* ============================== */
/* [[[ BLOCK: TEXT BLOCK ]]] */
/* ============================== */

.text-block {
  /* grid-column: removed */
  padding: 0;
}


/* ============================== */
/* [[[ BLOCK: SECTION LIST ]]] */
/* ============================== */

/* Wraps sequential text blocks in sidebar pages */
.section-list {
  display: flex;
  flex-direction: column;
  grid-column: 1 / -1;
  row-gap: 3rem;
}

.section-list>*:last-child {
  margin-bottom: 0 !important;
}


/* ============================== */
/* [[[ BLOCK: TEXT WITH IMAGE ]]] */
/* ============================== */


.text-with-image {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  margin-top: var(--internal-space-md);
  margin-bottom: var(--internal-space-lg);
}

.text-with-image__text {
  grid-column: 7 / -1;
  padding-left: 2rem;
}

.text-with-image__image {
  grid-column: 1 / 7;
}

.text-with-image__image img {
  border-radius: 3px;
}


/* ============================== */
/* [[[ BLOCK: IMAGE GALLERY ]]] */
/* ============================== */

.image-gallery {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  gap: 2rem;
  /* Visual Content Spacing */
  margin-top: var(--internal-space-md);
  margin-bottom: var(--internal-space-lg);
}

.image-gallery__item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  grid-column: span 4;
}

.image-gallery__item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 3px;
}

.image-gallery__item figcaption {
  font-size: 0.9rem;
  color: #555;
}


/* ============================ */
/* [[[ BLOCK: CENTER WIDTH IMAGE ]]] */
/* ============================ */

.center-width-image {
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  align-items: center;
  border-radius: 3px;
  overflow: hidden;
  margin-top: var(--internal-space-xl);
  margin-bottom: var(--internal-space-lg);
}

.center-width-image__image {
  grid-row: 1;
  grid-column: 1 / -1;
  z-index: 1;
  width: 100%;
  height: auto;
  position: relative;
}

.center-width-image__image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
}


/* ============================ */
/* [[[ BLOCK: FULL WIDTH IMAGE ]]] */
/* ============================ */

.full-width-image {
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  align-items: center;
  border-radius: 3px;
  overflow: hidden;
  margin-top: var(--internal-space-md);
  margin-bottom: var(--internal-space-lg);
}

.full-width-image__image {
  grid-row: 1;
  grid-column: 1 / -1;
  z-index: 1;
  width: 100%;
  height: auto;
  position: relative;
}

.full-width-image__image video,
.full-width-image__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}


/* =================== */
/* [[[ BLOCK: TEAM LIST ]]] */
/* =================== */

.team-group {
  display: grid;
  grid-template-columns: subgrid;
}

.team-member-list {
  display: grid;
  grid-template-columns: subgrid;
  column-gap: 2rem;
  row-gap: 2rem;
  margin-top: var(--internal-space-md);
  margin-bottom: var(--internal-space-lg);
}

.team-member {
  grid-column: span 4;
  /* 2 items per row in 8-col layout-center */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.team-member p {
  border-bottom: 1px solid #2B3D50;
  padding-bottom: 2px;
  display: inline-block;
}

.team-member:hover .team-member-avatar {
  opacity: 0.9;
}

.team-member-avatar {
  width: 10rem;
  height: 10rem;
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
  border: 1px solid var(--color-accent);
  margin-bottom: 1rem;
}

/* Ensures that children span the full width of this subgrid */
.team-group>.text-block,
.team-group>.prose,
.team-group>.team-member-list {
  grid-column: 1 / -1;
}

.team-group>*:last-child {
  margin-bottom: 0 !important;
}


/* ====================== */
/* [[[ BLOCK: QUOTE BANNER ]]] */
/* ====================== */

.quote-banner {
  position: relative;
  padding: 3rem;
  background-color: #8ec4d1;
}

.quote-banner::before {
  content: '';
  /* Required for pseudo-element to render */
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  background-color: #a7d1db;
  z-index: var(--z-negative);
}

.quote-banner__text {
  font-size: 2.5rem;
  font-weight: 300;
  text-indent: -0.45em;
  color: #2B3D50;
}

.quote-banner__credit {
  font-size: 1.5rem;
  font-weight: 400;
  text-transform: uppercase;
  color: #2B3D50;
}

/* ============================ */
/* [[[ BLOCK: VISUAL BANNER ]]] */
/* ============================ */

.visual-banner {
  position: relative;
  min-height: 525px;
  max-height: 50vh;
  display: grid;
  grid-template-columns: subgrid;
  align-items: end;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--internal-space-lg);
  isolation: isolate;
  /* Fixes mix-blend-mode behavior on mobile/Safari */
}

.visual-banner__video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.visual-banner__video video,
.visual-banner__video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.visual-banner__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: linear-gradient(to right, #005B80, #12839F, #00D7A0);
  z-index: 1;
}

.visual-banner__caption-text {
  grid-column: 1 / -1;
  padding-left: 1rem;
  padding-bottom: 0.5rem;
  font-size: 1.2rem;
  font-weight: 400;
  color: #fff;
  position: relative;
  z-index: var(--z-overlay);
}

.visual-banner__control {
  position: absolute;
  bottom: 3.5rem;
  right: 1rem;
  width: 45px;
  height: 45px;
  pointer-events: none;
}

.visual-banner__control-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--color-primary-variant);
  /*mix-blend-mode: darken;*/
  opacity: 0.5;
  transition: background-color 0.3s ease;
}

.visual-banner__control-btn {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-color: transparent;
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  z-index: var(--z-overlay);
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}


/* Hover State (Mouse Only) */
@media (hover: hover) {
  .visual-banner__control-btn:hover {
    border-color: var(--color-accent-light);
    color: var(--color-accent-light);
  }
}

.visual-banner__control .visual-banner__control-btn:focus-visible,
.visual-banner__control .visual-banner__control-btn:active,
.visual-banner__control-btn.is-pressed {
  outline: none;
  border: 4px solid var(--color-highlight);
  color: var(--color-highlight);
}

.visual-banner__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  position: relative;
  pointer-events: none;
}

.visual-banner__icon svg {
  display: block;
}

.visual-banner__icon--play svg {
  transform: translateX(2px);
}


/* ======================= */
/* [[[ BLOCK: NAV CARDS ]]] */
/* ======================= */

.nav-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2rem;
}

.nav-cards__header {
  grid-column: 1 / -1;
  margin-bottom: 1rem;
}

.nav-cards__item {
  height: 100%;
}

.nav-cards__link {
  display: block;
  box-sizing: border-box;
  height: 100%;
  background-color: #EBFCF8;
  border: 1px solid #00D7A0;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: #2B3D50;
}

.nav-cards__link:hover,
.nav-cards__link:focus {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.nav-cards__link h3 {
  font-weight: 600;
  color: #2B3D50;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  display: inline-block;
}

.nav-cards__link:hover h3 {
  text-decoration: underline;
}

.nav-cards__link p {
  color: #2B3D50;
  line-height: 1.6;
}


/* ============================ */
/* [[[ BLOCK: FEATURE PREVIEW ]]] */
/* ============================ */

.feature-list {
  display: grid;
  grid-template-columns: subgrid;
  row-gap: inherit;
}

.feature-list>.feature-preview__label {
  grid-column: 1 / -1;
}

.feature-preview__label {
  width: fit-content;
  background-color: var(--color-accent-light);
  border-radius: 3px;
  padding: 0.2rem 0.5rem;
  margin-bottom: 0.8rem;
}

.feature-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  text-decoration: none;
  color: inherit;
  align-items: center;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-grey-light);
}

.feature-preview__image {
  grid-column: 6 / -1;
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  aspect-ratio: 16/9;
  background-color: #f0f0f0;
}

.feature-preview__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom;
  /* Anchor to bottom */
  transition: transform 0.5s ease;
}

.feature-preview__text {
  grid-column: 1 / 6;
  /* Text Left */
  display: flex;
  flex-direction: column;
  /* justify-content: center; REMOVED per user request for top alignment */
}

.feature-preview:hover .feature-preview__image img {
  transform: scale(1.03);
}

.feature-preview:hover h3 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}


/* =========================== */
/* [[[[ RESPONSIVE STYLES ]]]] */
/* =========================== */


/* ==== TABLET (Breakpoint: 1200px) ==== */

@media (max-width: 1200px) {

  .visual-banner__caption-text {
    grid-column: 2 / -1;
  }

  .image-gallery {
    grid-template-columns: subgrid;
  }

  .image-gallery__item {
    grid-column: span 6;
    /* 2 items per row on 12-col grid */
  }

  .text-with-image {
    display: flex;
    flex-direction: column;
    column-gap: 2rem;
  }

  .text-with-image__text,
  .text-with-image__image {
    width: 100%;
  }

  .nav-cards {
    /* Simply switch to single column or keep as is, do not mimic page grid */
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
  }

  .nav-cards__item {
    grid-column: auto;
  }

  /* Team Member Tablet: 2 per row in 6-col layout-center */
  .team-member {
    grid-column: span 3;
  }

  /* Tablet Spacing Updates (2.5rem) */
  .section-list {
    row-gap: 2.5rem;
  }

  .visual-banner {
    grid-column: 1 / -1;
    min-height: 500px;
    border-radius: 0;
    overflow: visible;
  }

  .visual-banner__video {
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
  }

  .visual-banner__overlay {
    width: 100vw;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
  }

  .visual-banner__caption-text {
    grid-column: 2 / -1;
    padding-left: 0;
  }
}


/* ==== MOBILE (Breakpoint: 800px) ==== */

@media (max-width: 800px) {

  .section-list {
    grid-column: 2 / -1;
    row-gap: 2rem;
  }

  .page-header {
    grid-column: 1 / -1;
  }

  .text-block {
    grid-column: 1 / -1;
  }

  .center-width-image__image {
    min-height: auto;
    height: auto;
  }

  .image-gallery__item {
    grid-column: 1 / -1;
  }

  .image-gallery__item img {
    height: auto;
  }

  .nav-cards {
    grid-column: 1 / -1;
    gap: 2rem;
  }

  .feature-preview {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 2rem;
  }

  .feature-preview__image,
  .feature-preview__text {
    width: 100%;
  }

  .nav-cards__item {
    grid-column: 1 / -1;
  }

  .team-member-list {
    grid-column: 1 / -1;
  }

  .team-member {
    grid-column: 1 / -1;
  }

  .visual-banner {
    min-height: 400px;
    margin-top: 0;
    padding-top: 0;
  }

  .visual-banner__caption-text {
    grid-column: 1 / -1;
  }

  .visual-banner__control {
    bottom: 3rem;
    right: -1rem;
    /* Negative value to breakout of grid padding */
    width: 36px;
    height: 36px;
  }

  .visual-banner__icon svg {
    height: 16px;
    width: auto;
  }
}