/* ===== Buhund image grid — replaces Elementor grid ===== */

.buhund-grid {
  display: grid;
  grid-template-columns: repeat(var(--buhund-columns, 4), 1fr);
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  background: #7bc47f;   /* the green from the original design — adjust if needed */
  padding: 12px;
  border-radius: 4px;
}

.buhund-card {
  position: relative;
  overflow: hidden;      /* clips the zoomed image */
  border-radius: 2px;
  aspect-ratio: 4 / 3;
  background: #ccc;
  cursor: pointer;
}

.buhund-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.buhund-card .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.2px;
  transform: translateY(0);
  transition: transform 0.35s ease;
}

/* Hover behaviour */
.buhund-card:hover img {
  transform: scale(1.08);
}

.buhund-card:hover .caption {
  transform: translateY(-50%);
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .buhund-card img,
  .buhund-card .caption {
    transition: none;
  }
}

/* Responsive breakpoints */
@media (max-width: 900px) {
  .buhund-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .buhund-grid {
    grid-template-columns: 1fr;
  }
}

/* No hover on touch devices — skip the zoom, caption already visible */
@media (hover: none) {
  .buhund-card img {
    transform: none !important;
  }
}

/* ===== CTA buttons ===== */

.buhund-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
}

.buhund-cta .cta-btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 4px;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 1px;
  text-align: center;
  border: 2px solid transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
}

.buhund-cta .cta-primary {
  background-color: #d97862;
  color: #ffffff;
}

.buhund-cta .cta-primary:hover {
  background-color: #c4664f;
}

.buhund-cta .cta-secondary {
  background-color: #1a2b4c;
  color: #ffffff;
}

.buhund-cta .cta-secondary:hover {
  background-color: #101a30;
}

.buhund-cta .cta-btn:hover {
  transform: translateY(-2px);
}

.buhund-cta .cta-btn:focus-visible {
  outline: 3px solid #1a2b4c;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .buhund-cta .cta-btn {
    transition: none;
  }
  .buhund-cta .cta-btn:hover {
    transform: none;
  }
}

/* Stack buttons full-width on small screens */
@media (max-width: 480px) {
  .buhund-cta {
    flex-direction: column;
  }
  .buhund-cta .cta-btn {
    width: 100%;
  }
}

/* ===== CTA section (image + heading/text/buttons, two-column) ===== */

.buhund-cta-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  max-width: 1100px;
  margin: 48px auto;
  padding: 0 12px;
}

.buhund-cta-section .buhund-cta-media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.buhund-cta-section .buhund-cta-content h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.2;
}

.buhund-cta-section .buhund-cta-content p {
  margin: 0 0 20px;
  font-size: 17px;
  color: #4a5568;
}

.buhund-cta-section .buhund-cta-content .buhund-cta {
  margin-top: 0;
}

/* Reversed variant — content left, image right (e.g. "Join The Club") */
.buhund-cta-section.buhund-cta-section--reverse .buhund-cta-media {
  order: 2;
}
.buhund-cta-section.buhund-cta-section--reverse .buhund-cta-content {
  order: 1;
}

/* Two rows on small screens — image always on top, content below,
   regardless of the reverse variant */
@media (max-width: 700px) {
  .buhund-cta-section {
    grid-template-columns: 1fr;
  }
  .buhund-cta-section .buhund-cta-media,
  .buhund-cta-section.buhund-cta-section--reverse .buhund-cta-media {
    order: 1;
  }
  .buhund-cta-section .buhund-cta-content,
  .buhund-cta-section.buhund-cta-section--reverse .buhund-cta-content {
    order: 2;
  }
}

/* ===== Content width wrapper (fallback for pages where the theme's own
   content wrapper isn't constraining width — e.g. this Elementor-originated page) ===== */

.buhund-content-wrap {
  max-width: 1100px !important;
  margin: 0 auto;
  padding: 0 20px;
}

/* WordPress's "constrained" layout re-caps each CHILD of the group at
   its own narrower width (740px) — override that too, not just the parent */
.buhund-content-wrap.is-layout-constrained > * {
  max-width: 1100px !important;
}
