/* ============================================================
   Norvicus Spellenmaker - stijl van de webapplicatie
   (Dit bestand stuurt de webinterface aan; shared/print.css
   stuurt het document/de PDF zelf aan.)
   ============================================================ */

:root {
  --norvicus-primary: #2f6e51;
  --norvicus-primary-dark: #1f4d38;
  --norvicus-primary-soft: #e6f0e9;
  --norvicus-accent: #d6484a;
  --norvicus-accent-dark: #b93638;
  --achtergrond: #faf7f0;
  --kaart-bg: #ffffff;
  --tekst: #262624;
  --tekst-zacht: #6b6b66;
  --lijn: #e6e2d8;
  --gevaar: #d6484a;
  --gevaar-zacht: #fbe9e9;
  --radius-groot: 20px;
  --radius-klein: 12px;
  --schaduw: 0 6px 20px rgba(47, 110, 81, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--achtergrond);
  color: var(--tekst);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0;
}

button {
  font-family: inherit;
}

/* Zorgt dat het [hidden]-attribuut altijd wint, ook op elementen waarvan de
   eigen klasse (zoals .knop of .overlay) een eigen "display" instelt. */
[hidden] {
  display: none !important;
}

/* --- Topbalk --- */
.topbalk {
  background: var(--kaart-bg);
  border-bottom: 1px solid var(--lijn);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbalk-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.merk {
  display: flex;
  align-items: center;
  gap: 12px;
}

.merk-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--norvicus-primary), var(--norvicus-primary-dark));
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.merk-titel {
  font-weight: 800;
  font-size: 18px;
  color: var(--norvicus-primary-dark);
}

.merk-subtitel {
  font-size: 12.5px;
  color: var(--tekst-zacht);
}

/* --- Foutmeldingen --- */
.foutmeldingen-balk {
  max-width: 1320px;
  margin: 16px auto 0 auto;
  padding: 14px 18px;
  background: var(--gevaar-zacht);
  border: 1px solid #f3c3c3;
  color: #8a2b2d;
  border-radius: var(--radius-klein);
}

.foutmeldingen-balk ul {
  margin: 6px 0 0 0;
  padding-left: 20px;
}

.succes-balk {
  max-width: 1320px;
  margin: 16px auto 0 auto;
  padding: 14px 18px;
  background: var(--norvicus-primary-soft);
  border: 1px solid #cfe3d6;
  color: var(--norvicus-primary-dark);
  border-radius: var(--radius-klein);
  font-weight: 600;
}

/* --- Layout --- */
.layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: minmax(360px, 480px) 1fr;
    align-items: start;
  }
  .kolom-voorbeeld {
    position: sticky;
    top: 86px;
  }
}

.kolom {
  min-width: 0;
}

/* --- Kaarten --- */
.kaart {
  background: var(--kaart-bg);
  border: 1px solid var(--lijn);
  border-radius: var(--radius-groot);
  box-shadow: var(--schaduw);
  padding: 20px;
  margin-bottom: 18px;
}

.kaart-kop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.kaart-kop h2 {
  font-size: 17px;
  color: var(--norvicus-primary-dark);
}

.kaart-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--tekst-zacht);
}

.autogegevens {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  background: var(--norvicus-primary-soft);
  color: var(--norvicus-primary-dark);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.chip-zacht {
  background: #f1efe6;
  color: var(--tekst-zacht);
}

/* --- Velden --- */
.veld {
  margin-bottom: 14px;
}

.veld label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--tekst);
  margin-bottom: 5px;
}

.verplicht {
  color: var(--norvicus-accent-dark);
}

.veld input[type="text"],
.veld select,
.veld textarea {
  width: 100%;
  border: 1.5px solid var(--lijn);
  border-radius: var(--radius-klein);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--tekst);
  background: #fffefb;
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.veld input[type="text"]:focus,
.veld select:focus,
.veld textarea:focus {
  outline: none;
  border-color: var(--norvicus-primary);
  box-shadow: 0 0 0 3px rgba(47, 110, 81, 0.15);
}

.veld input.veld-fout,
.veld select.veld-fout,
.veld textarea.veld-fout {
  border-color: var(--gevaar);
  box-shadow: 0 0 0 3px rgba(214, 72, 74, 0.12);
}

.veldfout {
  margin: 5px 0 0 0;
  font-size: 12.5px;
  color: var(--gevaar);
  min-height: 0;
}

.veldrij {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

/* --- Materialen --- */
.materiaal-koppen {
  display: grid;
  grid-template-columns: 1fr 100px 40px;
  gap: 10px;
  padding: 0 2px 6px 2px;
  font-size: 12px;
  color: var(--tekst-zacht);
  font-weight: 600;
}

.materialen-lijst {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.materiaal-regel {
  display: grid;
  grid-template-columns: 1fr 100px 40px;
  gap: 10px;
  align-items: center;
}

.materiaal-regel input {
  width: 100%;
  border: 1.5px solid var(--lijn);
  border-radius: var(--radius-klein);
  padding: 9px 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fffefb;
}

.materiaal-regel input:focus {
  outline: none;
  border-color: var(--norvicus-primary);
  box-shadow: 0 0 0 3px rgba(47, 110, 81, 0.15);
}

/* --- Foto's --- */
.fotos-lijst {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.foto-regel {
  display: grid;
  grid-template-columns: 44px 1fr 40px;
  gap: 10px;
  align-items: center;
}

.foto-miniatuur {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1.5px solid var(--lijn);
  background: #f1efe6;
}

.foto-naam {
  font-size: 13px;
  color: var(--tekst);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fotos-leeg {
  font-size: 12.5px;
  color: var(--tekst-zacht);
  font-style: italic;
  margin: 0 0 10px 0;
}

/* --- Secties --- */
.secties-lijst {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.sectie-kaart {
  border: 1.5px solid var(--lijn);
  border-radius: var(--radius-klein);
  padding: 12px;
  background: #fffefb;
}

.sectie-kaart.sleep-actief {
  opacity: 0.5;
}

.sectie-kaart-kop {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sleepicoon {
  cursor: grab;
  color: var(--tekst-zacht);
  padding: 4px;
  flex: none;
  touch-action: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

.sleepicoon:active {
  cursor: grabbing;
}

.sleepicoon-inline {
  color: var(--norvicus-primary);
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0 1px;
}

.prullenbak-knop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sectie-titel-invoer {
  flex: 1;
  border: 1.5px solid var(--lijn);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  background: #fff;
}

.sectie-titel-invoer:focus {
  outline: none;
  border-color: var(--norvicus-primary);
  box-shadow: 0 0 0 3px rgba(47, 110, 81, 0.15);
}

.sectie-titel-vast {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--norvicus-primary-dark);
  padding: 7px 2px;
}

.sectie-tekst {
  width: 100%;
  border: 1.5px solid var(--lijn);
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  resize: vertical;
  min-height: 90px;
}

.sectie-tekst:focus {
  outline: none;
  border-color: var(--norvicus-primary);
  box-shadow: 0 0 0 3px rgba(47, 110, 81, 0.15);
}

.sectie-kaart[data-standaard="true"] {
  background: var(--norvicus-primary-soft);
  border-color: #cfe3d6;
}

/* --- Knoppen --- */
.knop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.knop:active {
  transform: translateY(1px);
}

.knop:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.knop-primair {
  background: var(--norvicus-primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 110, 81, 0.3);
}

.knop-primair:hover:not(:disabled) {
  background: var(--norvicus-primary-dark);
}

.knop-accent {
  background: var(--norvicus-accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(214, 72, 74, 0.35);
}

.knop-accent:hover {
  background: var(--norvicus-accent-dark);
}

.knop-secundair {
  background: var(--norvicus-primary-soft);
  color: var(--norvicus-primary-dark);
}

.knop-secundair:hover {
  background: #d9ebe0;
}

.knop-ghost {
  background: transparent;
  color: var(--tekst-zacht);
  border: 1.5px solid var(--lijn);
}

.knop-ghost:hover {
  background: #f1efe6;
}

.knop-volledig {
  width: 100%;
}

.prullenbak-knop {
  border: none;
  background: transparent;
  color: var(--tekst-zacht);
  cursor: pointer;
  font-size: 16px;
  padding: 6px;
  border-radius: 8px;
  line-height: 1;
}

.prullenbak-knop:hover {
  background: var(--gevaar-zacht);
  color: var(--gevaar);
}

.actiebalk {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

/* --- Voorbeeld --- */
.voorbeeld-kop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.voorbeeld-kop h2 {
  font-size: 17px;
  color: var(--norvicus-primary-dark);
}

.voorbeeld-scroll {
  background: #e9e5d8;
  border-radius: var(--radius-groot);
  padding: 24px;
  overflow-x: auto;
  border: 1px solid var(--lijn);
}

.voorbeeld-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.voorbeeld-container .pagedjs_pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.voorbeeld-container .pagedjs_page {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  background: #fff;
  flex: none;
}

.voorbeeld-leeg {
  color: var(--tekst-zacht);
  text-align: center;
  padding: 60px 20px;
  font-size: 14px;
}

/* --- Fotopagina's in het voorbeeld ---
   Los van de Paged.js-uitvoer: deze pagina's worden los toegevoegd zodat
   foto's nooit tussen de tekstpagina's belanden. De afmetingen bootsen een
   echte A4-pagina na (210x297mm) met hetzelfde afdrukbare gebied
   (178x259mm binnen dezelfde marges) als shared/print.css gebruikt voor de
   PDF, zodat slepen/vergroten hier overeenkomt met de uiteindelijke PDF. --- */
.foto-paginas-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.foto-pagina {
  position: relative;
  width: 210mm;
  height: 297mm;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  flex: none;
}

.foto-pagina-kop {
  position: absolute;
  top: 10mm;
  left: 16mm;
  font-size: 9pt;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--norvicus-primary);
  font-weight: 700;
}

.foto-werkgebied {
  position: absolute;
  top: 18mm;
  left: 16mm;
  width: 178mm;
  height: 259mm;
  overflow: hidden;
  outline: 1px dashed var(--lijn);
  outline-offset: -1px;
}

.foto-item {
  position: absolute;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  border: 2px solid #fff;
  border-radius: 4px;
  background: #f1efe6;
  cursor: grab;
  touch-action: none;
}

.foto-item:active {
  cursor: grabbing;
}

.foto-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.foto-resize-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--norvicus-primary);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: nwse-resize;
  touch-action: none;
}

.foto-paginas-hint {
  color: var(--tekst-zacht);
  font-size: 12.5px;
  text-align: center;
  max-width: 400px;
}

/* --- Overlay (bevestiging) --- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(38, 38, 36, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.overlay-kaart {
  background: #fff;
  border-radius: var(--radius-groot);
  padding: 24px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.overlay-kaart h3 {
  margin-bottom: 8px;
  color: var(--norvicus-primary-dark);
}

.overlay-kaart p {
  color: var(--tekst-zacht);
  font-size: 14px;
  margin: 0 0 18px 0;
}

.overlay-knoppen {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* --- Voettekst --- */
.voettekst {
  text-align: center;
  color: var(--tekst-zacht);
  font-size: 12px;
  padding: 20px;
}

/* Template-tags mogen nooit zichtbaar zijn */
template {
  display: none !important;
}
