/* =========================================================
   GLOBAL
   ========================================================= */

.wp-block-cover {
  height: 100vh;
  width: 100vw;
}

/* Buttons */
.wp-block-button__link {
  background-color: #303eae;
  border-radius: 3px !important;
  transition: background-color 0.3s ease, color 0.3s ease, border-radius 0.2s ease;
}

.wp-block-button__link:hover {
  background-color: #4554cc;
  color: #ffffff;
}

/* Jetpack Subscribe button specifically */
button.wp-block-button__link.no-border-radius {
  border-radius: 3px !important;
}


/* =========================================================
   HEADER / NAV (iPad breakpoint: behave like mobile)
   ========================================================= */

@media (min-width: 768px) and (max-width: 1481px) {
  header.wp-block-group.alignwide.wp-block-group-is-layout-flex {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 12px !important;
  }

  header.wp-block-group.alignwide.wp-block-group-is-layout-flex > .wp-block-group {
    width: 100% !important;
    justify-content: center !important;
  }

  header .wp-block-navigation {
    width: 100% !important;
    justify-content: center !important;
  }

  header .is-nowrap {
    flex-wrap: wrap !important;
  }
}

/* Dropdown hover / focus highlight */
.wp-block-navigation__submenu-container .wp-block-navigation-item__content {
  padding: 8px 12px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus {
  background-color: rgba(69, 84, 204, 1);
  color: #ffffff;
  border-radius: 0;
}


/* =========================================================
   SPONSOR CARDS (logo sizing)
   ========================================================= */

.sponsor-grid .sponsor-card a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.sponsor-grid .sponsor-card img {
  height: 80px !important;     /* <-- change this number */
  width: auto !important;
  max-height: 100% !important;
  max-width: 90% !important;
  object-fit: contain;
  display: block;
}


/* =========================================================
   COBLOCKS FEATURE IMAGE (zoom hover)
   ========================================================= */

.wp-block-coblocks-feature .wp-block-image {
  overflow: hidden;
}

.wp-block-coblocks-feature .wp-block-image img {
  transform: scale(1);
  transition: transform 0.4s ease;
}

.wp-block-coblocks-feature .wp-block-image:hover img {
  transform: scale(1.08);
}


/* =========================================================
   JETPACK TILED GALLERY (consistent gutters)
   ========================================================= */

.wp-block-jetpack-tiled-gallery {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.wp-block-jetpack-tiled-gallery .tiled-gallery__gallery {
  padding: 0 24px;
  box-sizing: border-box;
}

.wp-block-jetpack-tiled-gallery .tiled-gallery__row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}


/* =========================================================
   SECTION: #bBlocksTestPurpose-3 (Fancy Cards / Grid)
   ========================================================= */

/* Height control */
#bBlocksTestPurpose-3 { --fancy-card-height: 600px; }

@media (max-width: 1024px) { #bBlocksTestPurpose-3 { --fancy-card-height: 360px; } }
@media (max-width: 640px)  { #bBlocksTestPurpose-3 { --fancy-card-height: 280px; } }

/* Grid layout */
#bBlocksTestPurpose-3 .fancy-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px !important;

  /* Contains layout/paint so updates don’t ripple up the page */
  contain: layout paint;
}

/* Tablet: 2 columns */
@media (max-width: 1024px) {
  #bBlocksTestPurpose-3 .fancy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phone: 1 column + shrink text */
@media (max-width: 640px) {
  #bBlocksTestPurpose-3 .fancy-grid {
    grid-template-columns: 1fr;
  }

  #bBlocksTestPurpose-3 .fancy-card-title {
    font-size: 20px !important;
    line-height: 1.15 !important;
  }

  #bBlocksTestPurpose-3 .fancy-card-tag {
    font-size: 12px !important;
  }
}

/* Card sizing + clipping + builder overrides */
#bBlocksTestPurpose-3 .fancy-card {
  height: var(--fancy-card-height);
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;

  position: relative;
  overflow: hidden;

  /* Paint isolation + compositor hints (helps scroll smoothness) */
  contain: paint;
  transform: translateZ(0);
  backface-visibility: hidden;

  /* Fallback (when view-timeline isn't supported): keep visible */
  opacity: 1;
  transform: none;
}

/* Image layers respect card height */
#bBlocksTestPurpose-3 .fancy-card-imgWrapper,
#bBlocksTestPurpose-3 .fancy-card-figure {
  height: 100%;
}

/* Background image scaling */
#bBlocksTestPurpose-3 .fancy-card-figure {
  background-size: cover;
  background-position: center;
}

/* Overlay locked to card bounds */
#bBlocksTestPurpose-3 .fancy-card-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;

  /* Prevent inherited transforms (and keep composited) */
  transform: translateZ(0) !important;
  backface-visibility: hidden;

  transition: opacity 0.3s ease;
}

#bBlocksTestPurpose-3 .fancy-card:hover .fancy-card-overlay {
  transform: translateZ(0) !important;
}

/* Content anchored to bottom */
#bBlocksTestPurpose-3 .fancy-card-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}


/* =========================================================
   SECTION: #bBlocksTestPurpose-3 ANIMATION (Viewport wave)
   ========================================================= */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #bBlocksTestPurpose-3 .fancy-card {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@supports (animation-timeline: view()) {

  #bBlocksTestPurpose-3 .fancy-card {
    /* Start the timeline EARLIER (prevents "hit bottom → hitch") */
    view-timeline-inset: 0 0 80vh 0;

    opacity: 0;
    transform: translate3d(var(--wave-x, 0px), 70px, 0);

    animation: bthWaveInClean 1s cubic-bezier(.22, 0, .3, .5) forwards;
    animation-timeline: view();

    /* Finish sooner to reduce scroll work */
    animation-range: entry 0% entry 60%;
  }

  /* Keep will-change only on desktop to avoid memory pressure jank */
  @media (min-width: 1025px) {
    #bBlocksTestPurpose-3 .fancy-card {
      will-change: transform, opacity;
    }
  }
  @media (max-width: 1024px) {
    #bBlocksTestPurpose-3 .fancy-card {
      will-change: auto;
    }
  }

  /* Stagger wave */
  #bBlocksTestPurpose-3 .fancy-card:nth-child(1) { --wave-x: -60px; animation-delay: 0.25s; }
  #bBlocksTestPurpose-3 .fancy-card:nth-child(2) { --wave-x: -36px; animation-delay: 0.50s; }
  #bBlocksTestPurpose-3 .fancy-card:nth-child(3) { --wave-x: -12px; animation-delay: 0.75s; }
  #bBlocksTestPurpose-3 .fancy-card:nth-child(4) { --wave-x:  12px; animation-delay: 1.00s; }
  #bBlocksTestPurpose-3 .fancy-card:nth-child(5) { --wave-x:  36px; animation-delay: 1.25s; }
  #bBlocksTestPurpose-3 .fancy-card:nth-child(6) { --wave-x:  60px; animation-delay: 1.50s; }

  @keyframes bthWaveInClean {
    from { opacity: 0; transform: translate3d(var(--wave-x, 0px), 80px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
  }
}


/* =========================================================
   IMPORTANT: KEEP THIS AT VERY BOTTOM
   Fix horizontal scroll caused by animations on mobile
   ========================================================= */

@media (max-width: 768px) {
  #bBlocksTestPurpose-3,
  #bBlocksTestPurpose-3 .container,
  #bBlocksTestPurpose-3 .fancy-grid {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  /* Kill horizontal drift on mobile */
  #bBlocksTestPurpose-3 .fancy-card {
    --wave-x: 0px !important;
  }

  /* Extra guard */
  #bBlocksTestPurpose-3 .fancy-card,
  #bBlocksTestPurpose-3 .fancy-card * {
    max-width: 100% !important;
  }
}
/* =========================================================
   GLOBAL
   ========================================================= */

.wp-block-cover {
  height: 100vh;
  width: 100vw;
}

/* Buttons */
.wp-block-button__link {
  background-color: #303eae;
  border-radius: 3px !important;
  transition: background-color 0.3s ease, color 0.3s ease, border-radius 0.2s ease;
}

.wp-block-button__link:hover {
  background-color: #4554cc;
  color: #ffffff;
}

/* Jetpack Subscribe button specifically */
button.wp-block-button__link.no-border-radius {
  border-radius: 3px !important;
}


/* =========================================================
   HEADER / NAV (iPad breakpoint: behave like mobile)
   ========================================================= */

@media (min-width: 768px) and (max-width: 1481px) {
  header.wp-block-group.alignwide.wp-block-group-is-layout-flex {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 12px !important;
  }

  header.wp-block-group.alignwide.wp-block-group-is-layout-flex > .wp-block-group {
    width: 100% !important;
    justify-content: center !important;
  }

  header .wp-block-navigation {
    width: 100% !important;
    justify-content: center !important;
  }

  header .is-nowrap {
    flex-wrap: wrap !important;
  }
}

/* Dropdown hover / focus highlight */
.wp-block-navigation__submenu-container .wp-block-navigation-item__content {
  padding: 8px 12px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.wp-block-navigation__submenu-container .wp-block-navigation-item__content:focus {
  background-color: rgba(69, 84, 204, 1);
  color: #ffffff;
  border-radius: 0;
}


/* =========================================================
   SPONSOR CARDS (logo sizing)
   ========================================================= */

.sponsor-grid .sponsor-card a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.sponsor-grid .sponsor-card img {
  height: 80px !important;     /* <-- change this number */
  width: auto !important;
  max-height: 100% !important;
  max-width: 90% !important;
  object-fit: contain;
  display: block;
}


/* =========================================================
   COBLOCKS FEATURE IMAGE (zoom hover)
   ========================================================= */

.wp-block-coblocks-feature .wp-block-image {
  overflow: hidden;
}

.wp-block-coblocks-feature .wp-block-image img {
  transform: scale(1);
  transition: transform 0.4s ease;
}

.wp-block-coblocks-feature .wp-block-image:hover img {
  transform: scale(1.08);
}


/* =========================================================
   JETPACK TILED GALLERY (consistent gutters)
   ========================================================= */

.wp-block-jetpack-tiled-gallery {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.wp-block-jetpack-tiled-gallery .tiled-gallery__gallery {
  padding: 0 24px;
  box-sizing: border-box;
}

.wp-block-jetpack-tiled-gallery .tiled-gallery__row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}


/* =========================================================
   SECTION: #bBlocksTestPurpose-3 (Fancy Cards / Grid)
   ========================================================= */

/* Height control */
#bBlocksTestPurpose-3 { --fancy-card-height: 600px; }

@media (max-width: 1024px) { #bBlocksTestPurpose-3 { --fancy-card-height: 360px; } }
@media (max-width: 640px)  { #bBlocksTestPurpose-3 { --fancy-card-height: 280px; } }

/* Grid layout */
#bBlocksTestPurpose-3 .fancy-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px !important;
}

/* Tablet: 2 columns */
@media (max-width: 1024px) {
  #bBlocksTestPurpose-3 .fancy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phone: 1 column + shrink text */
@media (max-width: 640px) {
  #bBlocksTestPurpose-3 .fancy-grid {
    grid-template-columns: 1fr;
  }

  #bBlocksTestPurpose-3 .fancy-card-title {
    font-size: 20px !important;
    line-height: 1.15 !important;
  }

  #bBlocksTestPurpose-3 .fancy-card-tag {
    font-size: 12px !important;
  }
}

/* Card sizing + clipping + builder overrides */
#bBlocksTestPurpose-3 .fancy-card {
  height: var(--fancy-card-height);
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;

  position: relative;
  overflow: hidden;

  /* Fallback (when view-timeline isn't supported): keep visible */
  opacity: 1;
  transform: none;
}

/* Image layers respect card height */
#bBlocksTestPurpose-3 .fancy-card-imgWrapper,
#bBlocksTestPurpose-3 .fancy-card-figure {
  height: 100%;
}

/* Background image scaling */
#bBlocksTestPurpose-3 .fancy-card-figure {
  background-size: cover;
  background-position: center;
}

/* Overlay locked to card bounds */
#bBlocksTestPurpose-3 .fancy-card-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: none !important; /* prevent inherited transforms */
  transition: opacity 0.3s ease;
}

#bBlocksTestPurpose-3 .fancy-card:hover .fancy-card-overlay {
  transform: none !important;
}

/* Content anchored to bottom */
#bBlocksTestPurpose-3 .fancy-card-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}


/* =========================================================
   #bBlocksTestPurpose-3: SCROLL-SMOOTH PATCH (keeps current motion)
   ========================================================= */

/* 1) Don’t fully render offscreen section until needed (big win) */
#bBlocksTestPurpose-3 {
  content-visibility: auto;
  contain-intrinsic-size: 900px; /* prevents jump while skipped */
}

/* 2) Contain layout/paint so updates don’t ripple up the page */
#bBlocksTestPurpose-3 .fancy-grid {
  contain: layout paint;
}

/* 3) Prevent hover/overlay paints from forcing big repaints */
#bBlocksTestPurpose-3 .fancy-card {
  contain: paint;                 /* isolates paint work */
  transform: translateZ(0);       /* compositor hint (no visual change) */
  backface-visibility: hidden;    /* avoids flicker on some GPUs */
}

/* 4) Overlay stays composited */
#bBlocksTestPurpose-3 .fancy-card-overlay {
  transform: translateZ(0) !important;
  backface-visibility: hidden;
}

/* 5) Only keep will-change on desktop (mobile can jank from memory pressure) */
@supports (animation-timeline: view()) {
  @media (min-width: 1025px) {
    #bBlocksTestPurpose-3 .fancy-card {
      will-change: transform, opacity;
    }
  }

  @media (max-width: 1024px) {
    #bBlocksTestPurpose-3 .fancy-card {
      will-change: auto;
    }
  }
}


/* =========================================================
   SECTION: #bBlocksTestPurpose-3 ANIMATION (Viewport wave)
   ========================================================= */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #bBlocksTestPurpose-3 .fancy-card {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

@supports (animation-timeline: view()) {

  #bBlocksTestPurpose-3 .fancy-card {
    /* Trigger threshold: top hits bottom-third line */
    view-timeline-inset: 0 0 50vh 0;

    opacity: 0;

    /* Same wave motion, smoother + GPU-friendly */
    transform: translate3d(var(--wave-x, 0px), 70px, 0);

    animation: bthWaveInClean 1s cubic-bezier(.22, 0, .3, .5) forwards;
    animation-timeline: view();

    /* Finish sooner to reduce scroll work (less jank) */
    animation-range: entry 0% entry 70%;
  }

  /* Stagger wave */
  #bBlocksTestPurpose-3 .fancy-card:nth-child(1) { --wave-x: -60px; animation-delay: 0.25s; }
  #bBlocksTestPurpose-3 .fancy-card:nth-child(2) { --wave-x: -36px; animation-delay: 0.50s; }
  #bBlocksTestPurpose-3 .fancy-card:nth-child(3) { --wave-x: -12px; animation-delay: 0.75s; }
  #bBlocksTestPurpose-3 .fancy-card:nth-child(4) { --wave-x:  12px; animation-delay: 1.00s; }
  #bBlocksTestPurpose-3 .fancy-card:nth-child(5) { --wave-x:  36px; animation-delay: 1.25s; }
  #bBlocksTestPurpose-3 .fancy-card:nth-child(6) { --wave-x:  60px; animation-delay: 1.50s; }

  @keyframes bthWaveInClean {
    from { opacity: 0; transform: translate3d(var(--wave-x, 0px), 80px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
  }
}


/* =========================================================
   IMPORTANT: KEEP THIS AT VERY BOTTOM
   Fix horizontal scroll caused by animations on mobile
   ========================================================= */

@media (max-width: 768px) {
  #bBlocksTestPurpose-3,
  #bBlocksTestPurpose-3 .container,
  #bBlocksTestPurpose-3 .fancy-grid {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  /* Kill horizontal drift on mobile */
  #bBlocksTestPurpose-3 .fancy-card {
    --wave-x: 0px !important;
  }

  /* Extra guard */
  #bBlocksTestPurpose-3 .fancy-card,
  #bBlocksTestPurpose-3 .fancy-card * {
    max-width: 100% !important;
  }
}
