/**
 * CTA Block Styles
 */

.wp-block-cta {
  overflow: hidden;
  border-radius: 1rem;
}

.cta-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0;
}

.cta-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  border-radius: 1rem;
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .cta-inner {
    flex-direction: row;
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  .cta-inner {
    gap: 2rem;
    padding: 2.5rem;
  }
}

/* Reverse layout */
.wp-block-cta[data-reverse="true"] .cta-inner {
  flex-direction: column;
}

@media (min-width: 768px) {
  .wp-block-cta[data-reverse="true"] .cta-inner {
    flex-direction: row-reverse;
  }
}

/* Text content */
.cta-text-content {
  text-align: center;
}

@media (min-width: 768px) {
  .cta-text-content {
    text-align: left;
  }
}

.wp-block-cta[data-reverse="true"] .cta-text-content {
  text-align: center;
}

@media (min-width: 768px) {
  .wp-block-cta[data-reverse="true"] .cta-text-content {
    text-align: right;
  }
}

.cta-headline {
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem 0;
}

/* Responsive headline sizes - scale down on mobile */
@media (max-width: 639px) {
  .cta-headline {
    font-size: clamp(1.25rem, 5vw, 2rem) !important;
  }
}

.cta-subtext {
  font-size: 1rem;
  line-height: 1.75;
  margin: 0 0 2rem 0;
  opacity: 0.9;
}

@media (min-width: 640px) {
  .cta-subtext {
    font-size: 1.125rem;
  }
}

/* Buttons */
.cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

@media (min-width: 640px) {
  .cta-buttons {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (min-width: 768px) {
  .cta-buttons {
    justify-content: flex-start;
  }

  .wp-block-cta[data-reverse="true"] .cta-buttons {
    justify-content: flex-end;
  }
}

.cta-primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: all 0.2s ease;
  min-width: 140px;
}

.cta-primary-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.cta-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  background-color: transparent;
  border: 2px solid currentColor;
  transition: all 0.2s ease;
  min-width: 140px;
}

.cta-secondary-button:hover {
  opacity: 0.8;
}

.cta-secondary-button .arrow {
  margin-left: 0.5rem;
  transition: transform 0.2s ease;
}

.cta-secondary-button:hover .arrow {
  transform: translateX(4px);
}

/* Image wrapper */
.cta-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.cta-image {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

/* Edge-to-edge image positions - Image bleeds to edges */
/* Edge Top - Image aligns to top edge */
.wp-block-cta[data-image-position="edge-top"] .cta-inner {
  padding-top: 0;
}

.wp-block-cta[data-image-position="edge-top"] .cta-image-wrapper {
  align-self: flex-start;
  margin-top: 0;
}

.wp-block-cta[data-image-position="edge-top"] .cta-image {
  border-radius: 0;
}

/* Edge Bottom - Image aligns to bottom edge */
.wp-block-cta[data-image-position="edge-bottom"] .cta-inner {
  padding-bottom: 0;
}

.wp-block-cta[data-image-position="edge-bottom"] .cta-image-wrapper {
  align-self: flex-end;
  margin-bottom: 0;
}

.wp-block-cta[data-image-position="edge-bottom"] .cta-image {
  border-radius: 0;
}

/* Edge Full - Image stretches full height */
.wp-block-cta[data-image-position="edge-full"] .cta-inner {
  padding-top: 0;
  padding-bottom: 0;
}

@media (min-width: 768px) {
  .wp-block-cta[data-image-position="edge-full"] .cta-inner {
    padding-right: 0;
  }

  .wp-block-cta[data-reverse="true"][data-image-position="edge-full"] .cta-inner {
    padding-right: 1.5rem;
    padding-left: 0;
  }
}

@media (min-width: 1024px) {
  .wp-block-cta[data-image-position="edge-full"] .cta-inner {
    padding-right: 0;
  }

  .wp-block-cta[data-reverse="true"][data-image-position="edge-full"] .cta-inner {
    padding-right: 2rem;
    padding-left: 0;
  }
}

.wp-block-cta[data-image-position="edge-full"] .cta-image-wrapper {
  align-self: stretch;
  margin: 0;
}

.wp-block-cta[data-image-position="edge-full"] .cta-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* Alignment support */
.wp-block-cta.alignwide .cta-container {
  max-width: 100%;
}

.wp-block-cta.alignfull .cta-container {
  max-width: 100%;
}

/* Mobile: Stack vertically and make image full width for edge positions */
@media (max-width: 767px) {
  .wp-block-cta[data-image-position="edge-top"] .cta-image-wrapper,
  .wp-block-cta[data-image-position="edge-bottom"] .cta-image-wrapper,
  .wp-block-cta[data-image-position="edge-full"] .cta-image-wrapper {
    width: calc(100% + 3rem);
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }

  .wp-block-cta[data-image-position="edge-top"] .cta-image,
  .wp-block-cta[data-image-position="edge-bottom"] .cta-image,
  .wp-block-cta[data-image-position="edge-full"] .cta-image {
    width: 100%;
    border-radius: 0;
  }
}
