/* Floating Ad Widget – same div as hero: column on large screen, row on small */

@keyframes ih-flyer-slide-in {
  from {
    transform: translateY(80px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Container for hero + widget (JS adds .ih-hero-with-ad to hero’s parent) */
.ih-hero-with-ad {
  display: flex;
  flex-direction: column
}

/* Large screen: flex-direction column – hero on top (80% width), widget below */
@media (min-width: 783px) {
  .ih-hero-with-ad {
    flex-direction: row;
  }
  .ih-hero-with-ad > *:first-child {
    width: 80%;
    max-width: 80%;
  }
  .ih-hero-with-ad .ih-floating-ad-widget-in-hero.ih-floating-ad-widget {
    /* position: static;
    width: 100%;
    max-width: 480px;
    align-self: flex-start; */
  }
}



/* Fallback when widget stays in footer (no hero found): fixed bottom-right */
.ih-floating-ad-widget:not(.ih-floating-ad-widget-in-hero) {
  position: fixed;
  bottom: 24px;
  right: 24px;
}

.ih-floating-ad-widget {
  width: 320px;
  max-width: calc(100vw - 32px);
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 10;
  overflow: hidden;
  font-family: inherit;
  animation: ih-flyer-slide-in 0.6s ease-out forwards;
}

.ih-floating-ad-widget-handle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: #281f15;
  border-bottom: 1px solid #e0e0e0;
  color: #fff;
}

.ih-floating-ad-widget-handle-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.ih-floating-ad-widget-handle-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.ih-floating-ad-widget-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.ih-floating-ad-widget-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

/* Skip buttons on top-right of each image wrap */
.ih-floating-ad-widget-internal-image-wrap,
.ih-floating-ad-widget-body .ih-floating-ad-widget-image-wrap {
  position: relative;
}

.ih-floating-ad-widget-internal-skip,
.ih-floating-ad-widget-body-skip {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.ih-floating-ad-widget-internal-skip:hover,
.ih-floating-ad-widget-body-skip:hover {
  background: rgba(0, 0, 0, 0.7);
}


.ih-floating-ad-widget-closed {
  display: none !important;
}

.ih-floating-ad-widget-content {
  padding: 14px;
}

/* Internal ad block – on top of body */
.ih-floating-ad-widget-internal {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.ih-floating-ad-widget-internal[aria-hidden="true"] {
  display: none !important;
}

.ih-floating-ad-widget-internal-image-wrap {
  width: 100%;
  max-height: 10rem;
  aspect-ratio: 16 / 10;
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
}

.ih-floating-ad-widget-internal-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ih-floating-ad-widget-internal-text {
  min-height: 0;
}

.ih-floating-ad-widget-internal-title {
  margin: 0 0 6px;
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 600;
}

.ih-floating-ad-widget-internal-description {
  margin: 0 0 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #555;
}

.ih-floating-ad-widget-internal-cta {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 6px;
  background-color: var(--wp--preset--color--accent-2, #e6a500);
  color: #fff;
  border: none;
  cursor: pointer;
}

.ih-floating-ad-widget-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ih-floating-ad-widget-image-wrap {
  width: 100%;
  max-height: 10rem;
  aspect-ratio: 16 / 10;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
}

.ih-floating-ad-widget-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ih-floating-ad-widget-text {
  min-height: 0;
}

.ih-floating-ad-widget-title {
  margin: 0 0 6px;
  font-size: 1.1rem;
  line-height: 1.3;
  font-weight: 600;
}

.ih-floating-ad-widget-description {
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #555;
}

.ih-floating-ad-widget-cta {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 6px;
  background-color: var(--wp--preset--color--accent-2);
  color: #fff;
  border: none;
  cursor: pointer;
}

/* Small screen: flex-direction row – hero and widget side by side */
@media (max-width: 782px) {
  .ih-hero-with-ad {
    flex-direction: column;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .ih-hero-with-ad > *:first-child {
    flex: 1;
    min-width: 0;
  }
  .ih-hero-with-ad .ih-floating-ad-widget-in-hero.ih-floating-ad-widget {
    position: static;
    width: 100%;
    max-width: 100%;
    margin: 16px 0;
    flex-shrink: 0;
  }
  .ih-floating-ad-widget-content{
    display: flex;
    gap: 16px;
  }
  .ih-floating-ad-widget-internal{
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
  }
}