/* Local photo and woonkeuze controls; existing page and model dialogs stay separate. */
:is([data-heida-save], [data-heida-photo-save]),
.heida-favorites-launcher,
.heida-favorites-footer,
dialog.heida-choice-dialog button,
dialog.heida-choice-dialog textarea {
  font: inherit;
}

/* JavaScript alone reveals controls. Author display rules must not defeat hidden. */
[data-heida-save][hidden],
[data-heida-photo-save][hidden],
[data-heida-zoom][hidden],
.heida-favorites-launcher[hidden],
.heida-favorites-footer[hidden],
dialog.heida-choice-dialog[hidden],
dialog.heida-choice-dialog:not([open]),
dialog.heida-choice-dialog [hidden] {
  display: none !important;
}

:is([data-heida-save], [data-heida-photo-save]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 15px;
  border: 1px solid #a79b85;
  border-radius: 6px;
  background: var(--cream-soft, #fdfbf7);
  color: var(--green, #173f34);
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transform: none;
}
:is([data-heida-save], [data-heida-photo-save]) svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
:is([data-heida-save], [data-heida-photo-save])[aria-pressed="true"] {
  border-color: var(--green, #173f34);
  background: var(--green, #173f34);
  color: var(--cream-soft, #fdfbf7);
}
:is([data-heida-save], [data-heida-photo-save])[aria-pressed="true"] svg,
:is([data-heida-save], [data-heida-photo-save])[aria-pressed="true"] svg path { fill: currentColor; }
:is([data-heida-save], [data-heida-photo-save])[aria-pressed="false"] svg path { fill: none; }
[data-heida-save-label] { min-width: 0; overflow-wrap: anywhere; }
.heida-choice-actions,
dialog.heida-choice-dialog .heida-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  min-height: 44px;
  margin-top: 12px;
}
.heida-choice-actions:not(:has(> :not([hidden]))) { display: none; }
.heida-choice-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

a[data-heida-zoom] {
  display: block;
  min-width: 0;
  color: var(--green, #173f34);
  text-decoration: none;
  cursor: zoom-in;
}
a[data-heida-zoom] img { object-fit: contain; }
a[data-heida-zoom]::after,
.heida-photo-open-label {
  display: block;
  padding-top: 8px;
  font-family: var(--font-body, Arial, sans-serif);
  font-size: .8125rem;
  line-height: 1.5;
  text-align: right;
  text-decoration: underline;
  text-underline-offset: 3px;
}
a[data-heida-zoom]::after { content: "Vergroot foto"; }
a.heida-photo-open[data-heida-zoom]::after { content: none; }

html.heida-choice-modal-open { overflow: hidden; overscroll-behavior: none; }
dialog.heida-choice-dialog:is([data-heida-photo-dialog], [data-heida-favorites-dialog]) {
  position: fixed;
  inset: 0;
  z-index: 12000;
  width: min(960px, calc(100% - 24px));
  max-width: none;
  max-height: 94vh;
  max-height: 94dvh;
  margin: auto;
  padding: clamp(16px, 3vw, 28px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid #ded7cc;
  border-radius: 12px;
  background: var(--cream-soft, #fdfbf7);
  color: var(--green, #173f34);
  font-family: var(--font-body, Arial, sans-serif);
  line-height: 1.6;
  box-shadow: 0 24px 80px rgba(12, 35, 27, .3);
}
dialog.heida-choice-dialog:is([data-heida-photo-dialog], [data-heida-favorites-dialog])::backdrop {
  background: rgba(12, 35, 27, .78);
}
dialog.heida-choice-dialog[open] { display: block; }
dialog.heida-choice-dialog > header,
dialog.heida-choice-dialog .heida-dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
dialog.heida-choice-dialog h2 {
  margin: 0 0 16px;
  font-family: var(--font-heading, Georgia, serif);
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
dialog.heida-choice-dialog > header h2,
dialog.heida-choice-dialog .heida-dialog-header h2 { margin: 0; }
dialog.heida-choice-dialog .heida-dialog-header .eyebrow { margin: 0 0 5px; }
dialog.heida-choice-dialog .heida-dialog-header > div { min-width: 0; }
dialog.heida-choice-dialog .heida-dialog-figure { min-width: 0; margin: 0; }
dialog.heida-choice-dialog :is([data-heida-photo-close], [data-heida-favorites-close]) {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #a79b85;
  border-radius: 6px;
  background: transparent;
  color: var(--green, #173f34);
  line-height: 1.4;
  cursor: pointer;
}
dialog.heida-choice-dialog img[data-heida-photo-image] {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(65vh, 760px);
  max-height: min(65dvh, 760px);
  margin-inline: auto;
  object-fit: contain;
  background: #f4f0e9;
}
dialog.heida-choice-dialog [data-heida-photo-credit],
.heida-choice-card-credit {
  margin: 10px 0 14px;
  color: var(--muted, #59615c);
  font-size: .8125rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
dialog.heida-choice-dialog [data-heida-favorites-list] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-block: 20px;
}
.heida-choice-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  padding: 16px;
  border: 1px solid #ded7cc;
  border-radius: 8px;
  background: var(--cream, #faf7f2);
}
.heida-choice-card-image {
  align-self: start;
  display: block;
  width: 100%;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #f0ebe2;
  cursor: zoom-in;
}
.heida-choice-card-image img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
  border-radius: 4px;
}
.heida-choice-card-copy { min-width: 0; overflow-wrap: anywhere; }
.heida-choice-card-copy h3 { margin: 0 0 8px; font-size: 1.4rem; line-height: 1.2; }
.heida-choice-card-copy p { margin: 0 0 10px; }
.heida-choice-card-kind,
dialog.heida-choice-dialog .heida-choice-note {
  color: var(--muted, #59615c);
  font-size: .875rem;
  line-height: 1.6;
}
dialog.heida-choice-dialog .heida-choice-feedback { margin: 12px 0 0; }
dialog.heida-choice-dialog .heida-choice-feedback:empty { margin: 0; }
.heida-choice-card-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.heida-choice-card-actions :is(button, a) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #a79b85;
  border-radius: 5px;
  background: transparent;
  color: var(--green, #173f34);
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
dialog.heida-choice-dialog [data-heida-favorites-copy] {
  min-height: 44px;
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--green, #173f34);
  border-radius: 6px;
  background: var(--green, #173f34);
  color: var(--cream-soft, #fdfbf7);
  line-height: 1.5;
  cursor: pointer;
}
dialog.heida-choice-dialog :is([data-heida-favorites-empty], [data-heida-favorites-status], [data-heida-storage-note], [data-heida-favorites-storage-note], [role="status"]) {
  margin-block: 12px;
  overflow-wrap: anywhere;
}
.heida-choice-copy-fallback {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 150px;
  margin-block: 14px;
  padding: 12px;
  border: 1px solid #a79b85;
  border-radius: 5px;
  background: #fff;
  color: var(--green, #173f34);
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
}
.heida-favorites-launcher {
  position: fixed;
  z-index: 45;
  left: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  max-width: calc(100% - 48px);
  padding: 11px 16px;
  border: 1px solid var(--cream-soft, #fdfbf7);
  border-radius: 8px;
  background: var(--green, #173f34);
  color: var(--cream-soft, #fdfbf7);
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(12, 35, 27, .18);
}
.heida-favorites-footer {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: inherit;
  line-height: 1.5;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
:is([data-heida-save], [data-heida-photo-save], a[data-heida-zoom], .heida-favorites-launcher, .heida-favorites-footer):focus-visible,
dialog.heida-choice-dialog :is(button, a, textarea):focus-visible {
  outline: 3px solid #967849;
  outline-offset: 3px;
}
[data-heida-save]:disabled,
[data-heida-photo-save]:disabled,
dialog.heida-choice-dialog button:disabled { opacity: .6; cursor: default; }

@media (max-width: 900px) {
  .heida-favorites-launcher { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 650px) {
  dialog.heida-choice-dialog [data-heida-favorites-list] { grid-template-columns: minmax(0, 1fr); }
  .heida-choice-card { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .heida-choice-card-image img { height: 132px; }
  .heida-choice-card-actions { gap: 6px; }
  .heida-choice-card-actions :is(button, a) { padding-inline: 8px; }
}
