/*
 * Styles for content made with the page builder, on the public site and in the builder canvas.
 * Theme colors come from CSS variables set in the CMS (Thema en kleuren). :where() keeps these
 * defaults weaker than Tailwind classes, so existing hand-written pages look exactly as before.
 */
:where(.page-content) {
  color: var(--color-text);
}

:where(.page-content) :where(h1, h2, h3, h4, h5, h6),
.page-heading {
  color: var(--color-heading);
}

:where(.page-content) :where(.page-rich-text) a,
:where(.page-content) :where(p, li) > a:not([class]) {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

:where(.page-content) :where(.page-rich-text) a:hover,
:where(.page-content) :where(p, li) > a:not([class]):hover {
  color: var(--color-link-hover);
}

/* Colored sections set their own text color; their headings follow it. */
.page-hero .page-heading,
.page-hero :where(h1, h2, h3),
[data-block="call-to-action"] :where(h1, h2, h3) {
  color: inherit;
}

/* ----- Buttons ----- */
.page-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.page-button-small { padding: 0.5rem 1rem; font-size: 0.875rem; }
.page-button-large { padding: 1rem 2rem; font-size: 1.125rem; }

.page-button-primary { background: var(--color-primary); color: #fff; }
.page-button-primary:hover { background: var(--color-primary-dark); color: #fff; }

.page-button-secondary { background: #fff; color: var(--color-primary); }
.page-button-secondary:hover { background: #f8f8f8; color: var(--color-primary-dark); }

.page-button-outline { border-color: currentColor; background: transparent; color: inherit; }
.page-button-outline:hover { background: rgb(255 255 255 / 0.15); }

.page-button:focus-visible {
  outline: 3px solid var(--color-primary-light);
  outline-offset: 2px;
}

/* ----- Carousel ----- */
.page-carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.85);
  color: #111827;
  font-size: 1.75rem;
  line-height: 1;
  transform: translateY(-50%);
}

.page-carousel-arrow:hover { background: #fff; }

.page-carousel-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.55);
}

.page-carousel-dot[aria-current="true"] { background: #fff; }

/* ----- Gallery lightbox ----- */
.page-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgb(0 0 0 / 0.85);
}

.page-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 0.5rem;
}

.page-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.15);
  color: #fff;
  font-size: 1.5rem;
}

[data-block="gallery"][data-lightbox] img { cursor: zoom-in; }

@media (prefers-reduced-motion: reduce) {
  [data-carousel-track] { transition: none !important; }
}

/* Collapsible bar: hide the browser's own triangle, the component shows its own icon. */
.page-collapsible > summary::-webkit-details-marker {
  display: none;
}

/* Message shown above a builder form after it was sent. */
.page-form-message {
  grid-column: 1 / -1;
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  padding: 1rem;
}

.page-form-message-success {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.page-form-message-error {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
