/* Bodin Popup — frontend
   Design tokens, overschrijfbaar via :root in het theme. */

:root {
  --bodin-bg:           #ffffff;
  --bodin-text:         #111111;
  --bodin-text-soft:    #555555;
  --bodin-text-mute:    #888888;
  --bodin-accent:       #111111;
  --bodin-accent-hover: #000000;
  --bodin-accent-text:  #ffffff;
  --bodin-divider:      #e8e8e8;
  --bodin-overlay:      rgba(0, 0, 0, 0.55);
  --bodin-shadow:       0 30px 80px rgba(0, 0, 0, 0.25);
  --bodin-radius:       4px;
  --bodin-font-display: 'Fraunces', Georgia, serif;
  --bodin-font-body:    'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Wrapper ─────────────────────────────────────────────────────────── */

.bodin-popup {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.bodin-popup.is-open,
.bodin-popup.is-closing {
  display: flex;
}

.bodin-popup__overlay {
  position: absolute;
  inset: 0;
  background: var(--bodin-overlay);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bodin-popup.is-open .bodin-popup__overlay {
  opacity: 1;
}

/* ── Panel (standaard layout) ────────────────────────────────────────── */

.bodin-popup__panel {
  position: relative;
  background: var(--bodin-bg);
  color: var(--bodin-text);
  font-family: var(--bodin-font-body);
  max-width: 480px;
  width: 100%;
  padding: 44px 40px 40px;
  border-radius: var(--bodin-radius);
  box-shadow: var(--bodin-shadow);
}

.bodin-popup__eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bodin-accent);
  margin-bottom: 14px;
}

.bodin-popup__title {
  font-family: var(--bodin-font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.15;
  margin: 0 0 14px;
  color: var(--bodin-text);
}

.bodin-popup__body {
  font-size: 15px;
  line-height: 1.65;
  color: var(--bodin-text-soft);
}

.bodin-popup__body p {
  margin: 0 0 12px;
}

.bodin-popup__body p:last-child {
  margin-bottom: 0;
}

.bodin-popup__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 13px 22px;
  background: var(--bodin-accent);
  color: var(--bodin-accent-text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--bodin-radius);
  transition: background 0.15s ease, transform 0.1s ease;
}

.bodin-popup__cta:hover {
  background: var(--bodin-accent-hover);
  color: var(--bodin-accent-text);
  transform: translateY(-1px);
  filter: brightness(1.12);
}

/* ── Sluitknop ───────────────────────────────────────────────────────── */

.bodin-popup__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--bodin-text-mute);
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
  z-index: 2;
}

.bodin-popup__close:hover,
.bodin-popup__close:focus-visible {
  color: var(--bodin-text);
  background: rgba(0, 0, 0, 0.06);
}

.bodin-popup__close--floating {
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* ── Custom layout ───────────────────────────────────────────────────── */

.bodin-popup__custom {
  position: relative;
  max-width: min(640px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

/* ── Positie: balk onderaan ──────────────────────────────────────────── */

.bodin-popup--pos-bar {
  align-items: flex-end;
  padding: 0;
}

.bodin-popup--pos-bar .bodin-popup__overlay {
  display: none;
}

.bodin-popup--pos-bar .bodin-popup__panel {
  max-width: none;
  border-radius: 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.15);
  padding: 24px clamp(20px, 6vw, 64px);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 32px;
  align-items: center;
}

.bodin-popup--pos-bar .bodin-popup__title {
  font-size: 20px;
  margin-bottom: 4px;
}

.bodin-popup--pos-bar .bodin-popup__eyebrow {
  margin-bottom: 6px;
}

.bodin-popup--pos-bar .bodin-popup__cta {
  margin-top: 0;
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: center;
}

@media (max-width: 640px) {
  .bodin-popup--pos-bar .bodin-popup__panel {
    grid-template-columns: 1fr;
  }
  .bodin-popup--pos-bar .bodin-popup__cta {
    grid-column: 1;
    grid-row: auto;
    margin-top: 14px;
    justify-self: start;
  }
}

/* ── Positie: toast rechtsonder ──────────────────────────────────────── */

.bodin-popup--pos-toast {
  align-items: flex-end;
  justify-content: flex-end;
}

.bodin-popup--pos-toast .bodin-popup__overlay {
  display: none;
}

.bodin-popup--pos-toast .bodin-popup__panel {
  max-width: 380px;
  padding: 28px 26px 26px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.22);
}

.bodin-popup--pos-toast .bodin-popup__title {
  font-size: 22px;
}

/* Zonder overlay moet de wrapper zelf klikken doorlaten. */
.bodin-popup--pos-bar,
.bodin-popup--pos-toast {
  pointer-events: none;
}

.bodin-popup--pos-bar .bodin-popup__panel,
.bodin-popup--pos-toast .bodin-popup__panel,
.bodin-popup--pos-bar .bodin-popup__custom,
.bodin-popup--pos-toast .bodin-popup__custom {
  pointer-events: auto;
}

/* ── Animaties ───────────────────────────────────────────────────────── */

.bodin-popup .bodin-popup__panel,
.bodin-popup .bodin-popup__custom {
  opacity: 0;
}

.bodin-popup.is-open .bodin-popup__panel,
.bodin-popup.is-open .bodin-popup__custom {
  opacity: 1;
}

.bodin-popup--anim-fade.is-open .bodin-popup__panel,
.bodin-popup--anim-fade.is-open .bodin-popup__custom {
  animation: bodin-fade 0.35s ease both;
}

.bodin-popup--anim-slide.is-open .bodin-popup__panel,
.bodin-popup--anim-slide.is-open .bodin-popup__custom {
  animation: bodin-slide 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bodin-popup--anim-zoom.is-open .bodin-popup__panel,
.bodin-popup--anim-zoom.is-open .bodin-popup__custom {
  animation: bodin-zoom 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.bodin-popup.is-closing .bodin-popup__panel,
.bodin-popup.is-closing .bodin-popup__custom {
  animation: bodin-fade 0.25s ease reverse both;
}

.bodin-popup.is-closing .bodin-popup__overlay {
  opacity: 0;
}

@keyframes bodin-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes bodin-slide {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bodin-zoom {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .bodin-popup.is-open .bodin-popup__panel,
  .bodin-popup.is-open .bodin-popup__custom {
    animation: bodin-fade 0.2s ease both !important;
  }
  .bodin-popup__overlay,
  .bodin-popup__cta {
    transition: none !important;
  }
}

/* ── Mobiel ──────────────────────────────────────────────────────────── */

@media (max-width: 520px) {
  .bodin-popup {
    padding: 16px;
  }
  .bodin-popup__panel {
    padding: 36px 24px 28px;
  }
  .bodin-popup__title {
    font-size: 24px;
  }
}

/* ── Screen reader helper (fallback als theme hem mist) ─────────────── */

.bodin-popup .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Instagram layout ────────────────────────────────────────────────── */

.bodin-ig {
  --ig-burgundy: #7a2d3f;
  --ig-cream:    #fdfbf6;
  --ig-ink:      #2c2320;
  --ig-muted:    #a08d84;
  --ig-sage:     #8a9a6f;
  --ig-gold:     #b0742f;

  position: relative;
  width: 396px;
  max-width: 100%;
  background: var(--ig-cream);
  border-radius: 16px;
  overflow: hidden;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-shadow: 0 24px 70px rgba(60, 25, 35, 0.38);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.bodin-ig__header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
}

.bodin-ig__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 210deg, #7a2d3f, #a8b58f, #efd9d9, #7a2d3f);
  flex: none;
}

.bodin-ig__avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--ig-cream);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--ig-burgundy);
}

.bodin-ig__avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bodin-ig__id {
  line-height: 1.25;
  min-width: 0;
}

.bodin-ig__handle {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ig-ink);
}

.bodin-ig__meta {
  display: block;
  font-size: 11px;
  color: var(--ig-muted);
}

.bodin-ig__media {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* Foto blijft strak vierkant, zoals een echte Instagram-post. */
.bodin-ig__media--image {
  aspect-ratio: 1 / 1;
}

.bodin-ig__media--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Tekstontwerp is minstens vierkant, maar groeit mee zodat er nooit
   een scrollbalk nodig is bij langere inhoud of een logo. */
.bodin-ig__media--design {
  min-height: 340px;
  background: radial-gradient(120% 120% at 50% 18%, #f7f1e5 0%, #ece2cc 78%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 32px;
}

.bodin-ig__laurel {
  position: absolute;
  top: 14px;
  width: 52px;
  color: var(--ig-sage);
  opacity: 0.5;
  pointer-events: none;
}

.bodin-ig__laurel--l { left: 12px; }
.bodin-ig__laurel--r { right: 12px; transform: scaleX(-1); }

.bodin-ig__eyebrow {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ig-gold);
  margin-bottom: 16px;
}

.bodin-ig__headline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 500;
  font-size: 44px;
  line-height: 0.98;
  color: var(--ig-burgundy);
  letter-spacing: -0.01em;
}

.bodin-ig__headline span {
  display: block;
  font-style: italic;
  font-weight: 400;
}

.bodin-ig__divider {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 18px 0;
  color: #c9a96a;
}

.bodin-ig__divider span {
  width: 26px;
  height: 1px;
  background: currentColor;
}

.bodin-ig__text {
  font-size: 13px;
  line-height: 1.65;
  color: #5c534d;
  max-width: 230px;
}

.bodin-ig__actions {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 13px 15px 7px;
  color: var(--ig-ink);
}

.bodin-ig__actions svg {
  width: 23px;
  height: 23px;
}

.bodin-ig__bookmark {
  margin-left: auto;
}

.bodin-ig__caption {
  padding: 7px 15px 17px;
}

.bodin-ig__likes {
  font-size: 13px;
  font-weight: 600;
  color: var(--ig-ink);
  margin-bottom: 6px;
}

.bodin-ig__text-caption {
  font-size: 13px;
  line-height: 1.55;
  color: #3a322e;
}

.bodin-ig__text-caption strong {
  font-weight: 600;
}

.bodin-ig__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 13px 20px;
  background: var(--ig-burgundy);
  color: var(--ig-cream);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: 10px;
  transition: filter 0.15s ease;
}

.bodin-ig__cta:hover {
  color: var(--ig-cream);
  filter: brightness(1.1);
}

/* Instagram post volgt de gekozen positie (modal/bar/toast) niet: altijd gecentreerd. */
.bodin-popup--instagram {
  align-items: center;
  justify-content: center;
}

/* Instagram beeldvlak met popup-inhoud als tekstbron */

.bodin-ig__text--content {
  max-width: 300px;
  font-size: 13px;
  line-height: 1.6;
  color: #5c534d;
}

.bodin-ig__text--content p {
  margin: 0 0 8px;
}

.bodin-ig__text--content p:last-child {
  margin-bottom: 0;
}

.bodin-ig__text--content img {
  max-width: 130px;
  height: auto;
  margin: 10px auto 0;
  display: block;
}

.bodin-ig__text--content figure {
  margin: 10px 0 0;
}

.bodin-ig__text--content a {
  color: var(--ig-burgundy);
}
