/* ---------------------------
   Default text position: bottom-left inset (pairs with contentPosition default)
--------------------------- */

.wp-block-cover.is-position-bottom-left .wp-block-cover__inner-container {
  padding-inline-start: clamp(1rem, 3vw, 1.75rem);
  padding-block-end: clamp(1rem, 2vw, 1.5rem);
  box-sizing: border-box;
}

/* Optional: title text centered (still using bottom-left content position by default) */
.wp-block-cover.ecb-cover-title-center.is-position-bottom-left .wp-block-cover__inner-container {
  width: 100%;
  max-width: 100%;
  text-align: center;
}

.wp-block-cover.ecb-cover-title-center .wp-block-cover__inner-container .wp-block-heading,
.wp-block-cover.ecb-cover-title-center .wp-block-cover__inner-container {
  text-align: center;
}

/* ---------------------------
   Full-cover link (anchor)
--------------------------- */

.wp-block-cover.ecb-has-cover-link {
  position: relative;
  padding: 0;
}

/* Let the anchor sit above media/overlay in the hit-testing stack */
.wp-block-cover.ecb-has-cover-link > .wp-block-cover__background,
.wp-block-cover.ecb-has-cover-link > .wp-block-cover__gradient-background,
.wp-block-cover.ecb-has-cover-link > .wp-block-cover__image-background,
.wp-block-cover.ecb-has-cover-link > video.wp-block-cover__video-background {
  pointer-events: none;
}

.wp-block-cover.ecb-has-cover-link .ecb-cover-block-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
  transition: background-color 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

.wp-block-cover.ecb-has-cover-link .ecb-cover-block-link:hover {
  background-color: rgba(255, 255, 255, 0.5);
}

.wp-block-cover.ecb-has-cover-link .wp-block-cover__inner-container {
  position: relative;
  z-index: 6;
  pointer-events: none;
  transition: color 0.35s ease;
  /* Full-width bar; core bottom-* positions set width:auto on inner (text-sized). */
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  overflow: visible;
  --ecb-cover-link-sweep-overhang: 1rem;
}

/* Keep overlay text above the bar */
.wp-block-cover.ecb-has-cover-link .wp-block-cover__inner-container > * {
  position: relative;
  z-index: 1;
  transition: color 0.35s ease;
}

/* Invert overlay copy on hover / keyboard focus */
.wp-block-cover.ecb-has-cover-link:has(.ecb-cover-block-link:hover) .wp-block-cover__inner-container,
.wp-block-cover.ecb-has-cover-link:has(.ecb-cover-block-link:hover) .wp-block-cover__inner-container :where(*) {
  color: #000 !important;
  text-decoration: none;
}

.wp-block-cover.ecb-has-cover-link:has(.ecb-cover-block-link:focus-visible) .wp-block-cover__inner-container,
.wp-block-cover.ecb-has-cover-link:has(.ecb-cover-block-link:focus-visible) .wp-block-cover__inner-container :where(*) {
  color: #000 !important;
}

/* Nested links/buttons inside the cover remain usable */
.wp-block-cover.ecb-has-cover-link .wp-block-cover__inner-container a,
.wp-block-cover.ecb-has-cover-link .wp-block-cover__inner-container button {
  pointer-events: auto;
  position: relative;
  z-index: 7;
  text-decoration: none;
}

.ecb-cover-block-link__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
