
.bonus-post-element-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

/* Grid container - Mobile: up to 2 columns.
   Column count comes from the shortcode `column` attribute via the inline
   --bpe-cols-* custom properties; the repeat() fallbacks preserve the original
   2 / 3 / 4 layout when the property is absent. */
.bonus-post-element-wrapper .bonus-post-element-grid {
  display: grid;
  grid-template-columns: var(--bpe-cols-mobile, repeat(2, 1fr));
  gap: var(--spacing-3);
  margin-bottom: var(--spacing-8);
  justify-items: center;
}

/* Individual card - Mobile: smaller cards */
.bonus-post-element-wrapper .bonus-post-element-card {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  border-radius: var(--radius-xl);
  overflow: visible;
  background: transparent;
  transition: transform 0.3s ease;
}

.bonus-post-element-wrapper .bonus-post-element-card:hover {
  transform: translateY(calc(var(--spacing-1) * -1.25));
}

/* Casino name header - reserves a 2-line name so logos, offers and
   buttons align across the row (single-line names bottom-align to the logo) */
.bonus-post-element-wrapper .bonus-post-element-head {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  margin: 0 0 var(--spacing-1) 0;
  min-height: calc(2 * var(--line-height-h7));
}

/* Casino name - Mobile: smaller font */
.bonus-post-element-wrapper .bonus-post-element-casino-name {
  font-family: var(--font-family-header);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-h7);
  line-height: var(--line-height-h7);
  color: var(--color-deep-dark);
  text-align: center;
  margin: 0;
  padding: 0;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Logo area - Mobile: 192px height */
.bonus-post-element-wrapper .bonus-post-element-logo {
  width: 100%;
  height: 192px;
  /* Now rendered as an <img>; object-fit replaces the old background-size */
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  flex-shrink: 0;
}

/* Logo placeholder when no image */
.bonus-post-element-wrapper .bonus-post-element-logo-placeholder {
  background: var(--gradient-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-base-white);
  font-family: var(--font-family-header);
  font-size: var(--font-size-h4);
  font-weight: var(--font-weight-semibold);
}

/* Bonus Info Section - Mobile: smaller padding */
.bonus-post-element-wrapper .bonus-post-element-info-section {
  background: var(--color-primary-light);
  padding: var(--spacing-3) var(--spacing-2) var(--spacing-5) var(--spacing-2);
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: var(--spacing-1);
  position: relative;
}

/* Bonus offer text - Mobile: smaller font */
.bonus-post-element-wrapper .bonus-post-element-bonus-offer {
  font-family: var(--font-family-header);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-p2-base);
  line-height: var(--line-height-p2-base);
  color: var(--color-primary-dark);
  text-align: center;
  margin: 0;
  padding: 0;
  width: 100%;
  flex: 0 0 auto;
}

/* Free spins text - Mobile: smaller font */
.bonus-post-element-wrapper .bonus-post-element-free-spins {
  font-family: var(--font-family-header);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-button);
  line-height: var(--line-height-button);
  color: var(--color-primary-dark);
  text-align: center;
  margin: auto 0 var(--spacing-2) 0;
}

/* CTA Button - Mobile: smaller size */
.bonus-post-element-wrapper .bonus-post-element-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--gradient-button-default);
  border-radius: var(--radius-lg);
  padding: var(--spacing-2) var(--spacing-3);
  color: var(--color-base-white);
  font-family: var(--font-family-header);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-button);
  line-height: var(--line-height-button);
  text-transform: uppercase;
  text-decoration: none;
  transition: opacity 0.3s ease, transform 0.2s ease;
  width: calc(100% - var(--spacing-4));
  height: var(--spacing-10);
  box-sizing: border-box;
  white-space: nowrap;
  margin-bottom: 0;
}

.bonus-post-element-wrapper .bonus-post-element-button:hover {
  opacity: 0.9;
  transform: translateY(calc(var(--spacing-1) * -0.5));
}

/* Arrow icon in button - Mobile: increased size */
.bonus-post-element-wrapper .bonus-post-element-arrow {
  width: var(--spacing-6);
  height: var(--spacing-6);
  flex-shrink: 0;
  display: inline-block;
  margin-left: 0;
}

.bonus-post-element-wrapper .bonus-post-element-arrow path {
  stroke: currentColor;
}

/* Ensure button text stays on one line */
.bonus-post-element-wrapper .bonus-post-element-button span {
  display: inline-block;
  white-space: nowrap;
}

/* T&C Accordion Section */
.bonus-post-element-wrapper .bonus-post-element-tc-accordion {
  width: 100%;
  position: relative;
  z-index: 1;
}

.bonus-post-element-wrapper .bonus-post-element-tc-toggle {
  width: 100%;
  height: var(--spacing-10);
  background: var(--color-base-light-gray);
  border: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-4);
  box-sizing: border-box;
  cursor: pointer;
}

.bonus-post-element-wrapper
  .bonus-post-element-tc-toggle[aria-expanded="true"] {
  border-radius: 0;
  background: var(--color-base-light-gray);
}

.bonus-post-element-wrapper .bonus-post-element-tc-text {
  font-family: var(--font-family-header);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-p3-caption);
  line-height: var(--line-height-p3-caption);
  color: var(--color-default-text);
}

.bonus-post-element-wrapper .bonus-post-element-tc-icon {
  flex-shrink: 0;
  opacity: 1;
  transition: transform 0.3s ease;
}

.bonus-post-element-wrapper
  .bonus-post-element-tc-toggle[aria-expanded="true"]
  .bonus-post-element-tc-icon {
  transform: rotate(180deg);
}

/* T&C Content */
.bonus-post-element-wrapper .bonus-post-element-tc-content {
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--color-base-ghost-white);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.bonus-post-element-wrapper .bonus-post-element-tc-body {
  padding: var(--spacing-4);
  font-family: var(--font-family-header);
  font-weight: var(--font-weight-regular);
  font-size: var(--font-size-p3-caption);
  line-height: 1.6;
  color: var(--color-default-text);
  background: var(--color-base-light-gray);
}

.bonus-post-element-wrapper .bonus-post-element-tc-body p {
  margin: 0 0 var(--spacing-3) 0;
}

.bonus-post-element-wrapper .bonus-post-element-tc-body p:last-child {
  margin-bottom: 0;
}

.bonus-post-element-wrapper .bonus-post-element-tc-body ul,
.bonus-post-element-wrapper .bonus-post-element-tc-body ol {
  margin: 0 0 var(--spacing-3) var(--spacing-5);
  padding: 0;
}

.bonus-post-element-wrapper .bonus-post-element-tc-body li {
  margin-bottom: var(--spacing-1);
}

/* Pagination styles */
.bonus-post-element-wrapper .bonus-post-element-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-3);
  margin-top: var(--spacing-8);
  flex-wrap: nowrap; /* B2: condensed pagination stays on one line */
}

.bonus-post-element-wrapper .bonus-post-element-page-numbers {
  display: flex;
  align-items: center;
  gap: var(--spacing-1); /* 4px per Figma */
  flex-wrap: nowrap;
  justify-content: center;
}

.bonus-post-element-wrapper .bonus-post-element-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-1);
  height: var(--spacing-10); /* 40px per Figma */
  min-width: var(--spacing-10);
  padding: 0 var(--spacing-2);
  box-sizing: border-box;
  background: var(--color-base-white);
  border: var(--border-width-thin) solid var(--color-base-light-gray);
  border-radius: var(--radius-sm); /* 4px per Figma */
  font-family: var(--font-family-header);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-p3-caption); /* 12px per Figma (was p2-base 16px) */
  line-height: 1;
  color: var(--color-primary-dark);
  cursor: pointer;
  transition: all 0.3s ease;
}

/* Page-number cells: fixed 40x40 squares per Figma */
.bonus-post-element-wrapper .bonus-post-element-page-num {
  width: var(--spacing-10);
  padding: 0;
}

.bonus-post-element-wrapper .bonus-post-element-pagination-btn:hover {
  background: var(--color-base-ghost-white);
  border-color: var(--color-primary);
}

.bonus-post-element-wrapper .bonus-post-element-pagination-btn.active {
  background: var(--gradient-button-default);
  color: var(--color-base-white);
  border-color: transparent;
}

/* Ellipsis gap marker (non-interactive span) */
.bonus-post-element-wrapper .bonus-post-element-pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--spacing-5); /* 20px */
  height: var(--spacing-10);
  font-family: var(--font-family-header);
  font-size: var(--font-size-p3-caption);
  color: var(--color-deep-dark);
  user-select: none;
}

/* Prev/Next chevron glyph (shown on mobile) */
.bonus-post-element-wrapper .bonus-post-element-pagination-arrow {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size-p2-base);
  line-height: 1;
}

/* Mobile-first: Prev/Next are 40px squares showing the chevron only */
.bonus-post-element-wrapper .bonus-post-element-pagination-label {
  display: none;
}

.bonus-post-element-wrapper .bonus-post-element-prev,
.bonus-post-element-wrapper .bonus-post-element-next {
  width: var(--spacing-10);
  padding: 0;
}

/* Tablet+ : Prev/Next show their text label instead of the chevron */
@media (min-width: 768px) {
  .bonus-post-element-wrapper .bonus-post-element-pagination-label {
    display: inline;
  }
  .bonus-post-element-wrapper .bonus-post-element-pagination-arrow {
    display: none;
  }
  .bonus-post-element-wrapper .bonus-post-element-prev,
  .bonus-post-element-wrapper .bonus-post-element-next {
    width: auto;
    padding: 0 var(--spacing-4);
  }
}

/* No results message */
.bonus-post-element-wrapper .bonus-post-element-no-results {
  text-align: center;
  padding: var(--spacing-10);
  font-family: var(--font-family-header);
  font-size: var(--font-size-h6);
  color: var(--color-default-text);
}

/* ============================================================
   TABLET STYLES (@media min-width: 768px)
   ============================================================ */

@media (min-width: 768px) {
  .bonus-post-element-wrapper {
    max-width: 698px; /* 3 cards (219px each) + 2 gaps (20px each) ≈ 697px */
  }

  /* Tablet: up to 3 columns. Fluid tracks (1fr) inside the 698px wrapper resolve
     to ~219px per card at the default 3-up, while letting `column` change the count. */
  .bonus-post-element-wrapper .bonus-post-element-grid {
    grid-template-columns: var(--bpe-cols-tablet, repeat(3, 1fr));
    gap: var(--spacing-5); /* 20px gap */
  }

  .bonus-post-element-wrapper .bonus-post-element-card {
    width: 100%;
    max-width: 100%;
  }

  .bonus-post-element-wrapper .bonus-post-element-head {
    margin: 0 0 var(--spacing-2) 0;
    min-height: calc(2 * var(--line-height-h6));
  }

  .bonus-post-element-wrapper .bonus-post-element-casino-name {
    font-size: var(--font-size-h6);
    line-height: var(--line-height-h6);
  }

  .bonus-post-element-wrapper .bonus-post-element-logo {
    height: 180px; /* cropped via object-fit: cover within the 219px card */
  }

  .bonus-post-element-wrapper .bonus-post-element-info-section {
    padding: var(--spacing-5) var(--spacing-4) var(--spacing-5) var(--spacing-4);
    gap: var(--spacing-2);
  }

  .bonus-post-element-wrapper .bonus-post-element-bonus-offer {
    font-size: var(--font-size-p1-large);
    line-height: var(--line-height-h6);
  }

  .bonus-post-element-wrapper .bonus-post-element-free-spins {
    font-size: var(--font-size-p3-caption);
    line-height: var(--line-height-h7);
    margin: 0 0 var(--spacing-3) 0;
  }

  .bonus-post-element-wrapper .bonus-post-element-button {
    height: calc(var(--spacing-12) + var(--spacing-2));
    font-size: var(--font-size-p2-base);
    padding: var(--spacing-3) var(--spacing-5);
    gap: 0;
    border-radius: var(--radius-xl);
  }

  .bonus-post-element-wrapper .bonus-post-element-arrow {
    width: var(--spacing-7);
    height: var(--spacing-7);
  }
}

/* ============================================================
   DESKTOP STYLES (@media min-width: 1440px)
   ============================================================ */

@media (min-width: 1440px) {
  .bonus-post-element-wrapper {
    max-width: 1023px; /* 4 cards (237px each) + 3 gaps (25px each) */
  }

  /* Desktop: up to 4 columns with 25px gap. Fluid tracks (1fr) inside the 1023px
     wrapper resolve to ~237px per card at the default 4-up, while letting `column`
     change the count. */
  .bonus-post-element-wrapper .bonus-post-element-grid {
    grid-template-columns: var(--bpe-cols-desktop, repeat(4, 1fr));
    gap: 25px;
  }

  .bonus-post-element-wrapper .bonus-post-element-card {
    width: 100%;
    max-width: 100%;
  }

  .bonus-post-element-wrapper .bonus-post-element-logo {
    height: 180px;
  }
}
