
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;

  background: #1a1a1a;
  color: #e0e0e0;
  line-height: 1.6;
  font-family: sans-serif;
}

body.canvas {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1a1a;
  color: #e0e0e0;
  line-height: 1.6;
  font-family: sans-serif;
}

body.uitleg {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: auto !important;
  background: #1a1a1a;
  color: #e0e0e0;
  line-height: 1.6;
  font-family: sans-serif;
  scrollbar-width: thin;
  scrollbar-color: #555 #1a1a1a;
}

body.uitleg::-webkit-scrollbar {
  width: 8px;
}

body.uitleg::-webkit-scrollbar-track {
  background: #1a1a1a;
}

body.uitleg::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
  border: 2px solid #1a1a1a;
}

body.uitleg::-webkit-scrollbar-thumb:hover {
  background-color: #666;
}


body.sitemap {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: auto !important;
  background: #1a1a1a;
  color: #e0e0e0;
  line-height: 1.6;
  font-family: sans-serif;
  scrollbar-width: thin;
  scrollbar-color: #555 #1a1a1a;
}

body.sitemap::-webkit-scrollbar {
  width: 8px;
}

body.sitemap::-webkit-scrollbar-track {
  background: #1a1a1a;
}

body.sitemap::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
  border: 2px solid #1a1a1a;
}

body.sitemap::-webkit-scrollbar-thumb:hover {
  background-color: #666;
}


body.detail {
  margin: 2rem !important;
  padding: 0;
  max-width: 70%; 
  height: 100%;
  overflow: auto !important;
  background: #1a1a1a;
  color: #e0e0e0;
  line-height: 1.6;
  font-family: sans-serif;
  scrollbar-width: thin;
  scrollbar-color: #555 #1a1a1a;
}

body.detail::-webkit-scrollbar {
  width: 8px;
}

body.detail::-webkit-scrollbar-track {
  background: #1a1a1a;
}

body.detail::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
  border: 2px solid #1a1a1a;
}

body.detail::-webkit-scrollbar-thumb:hover {
  background-color: #666;
}




a {
  color: rgba(0, 135, 255, 0.9);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 2rem;
  color: #ffffff;
  margin-bottom: 1rem;
}

.back-link {
  position: fixed;
  bottom: 20px;
  left: 20px;
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #2a2a2a;
  border-radius: 4px;
  color: #ffffff;
  text-decoration: none;
  z-index: 1000;
}

.back-link:hover {
  background: #3a3a3a;
}

#paintingCanvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
  margin: auto;
  cursor: crosshair;
}

#magnifierCanvas {
  position: fixed;
  bottom: 10px;
  right: 10px;
  width: 200px;
  height: 200px;
  border: 2px solid #ffffff;
  display: none;
  z-index: 10;
  background: #1a1a1a;
}

#coords {
  position: absolute;
  width: 125px;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.8);
  padding: 4px 8px;
  font-family: monospace;
  font-size: 14px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 20;
  color: #000000;
}

.lang-switch {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 90;
}

.lang-switch a,
.lang-switch button {
  margin-left: 0.5rem;
  font-size: 1.5rem;
  border: none;
  background: none;
  cursor: pointer;
}

.link-switch {
  position: absolute;
  top: 100px;
  right: 10px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.link-switch .link-button {
  width: 125px;
  padding: 6px 8px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.85);
  color: #1a1a1a;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
}

.toggle-button {
  position: absolute;
  width: 125px;
  padding: 6px 10px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.85);
  color: #1a1a1a;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  z-index: 20;
}

.toggle-button.active {
  background: rgba(0, 135, 255, 0.85);
  color: #ffffff;
}

#toggleMagnifier {
  position: fixed;
  top: 50px;
  right: 10px;
  font-size: 1.2rem;
  padding: 6px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 4px;
}

#toggleMagnifier.active {
  background: rgba(0, 135, 255, 0.85);
  color: #ffffff;
}

#typeFilters {
  position: absolute;
  left: 10px;
  top: 390px;
  background: rgba(255, 255, 255, 0.85);
  padding: 8px;
  border-radius: 4px;
  z-index: 20;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
}

#typeFilters label {
  margin-bottom: 4px;
  font-size: 14px;
  color: #1a1a1a;
}

.link-button {
  display: block;
  margin: 6px 0;
  padding: 6px 10px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#link {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 14px;
  border-radius: 4px;
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 20;
}

#shareButton {
  margin-top: 6px;
  padding: 6px 10px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#sharePopup {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.85);
  padding: 10px;
  border-radius: 4px;
  display: none;
  flex-direction: column;
  align-items: center;
  z-index: 21;
}

#shareInput {
  width: 80%;
  padding: 6px;
  font-size: 16px;
  margin-bottom: 8px;
}

#shareClose {
  background: none;
  border: 1px solid #ffffff;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.data-table {
  border-collapse: collapse;
  float: left;
  width: 50%;
  margin: 20px auto;
  font-family: Arial, sans-serif;
  clear: both;
}
.data-table th,
.data-table td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
  white-space: nowrap; 
}

.data-table th {
  background-color: rgba(0, 135, 255, 0.85);
  color: #ffffff;
  position: relative;
  padding-right: 1.5em;
  cursor: pointer;
}

.data-table th.asc::after {
  content: "\25B2";     /* ▲ */
  position: absolute;
  right: 0.5em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75em;
  color: #ffffff;       /* forceren dat ie wit is */
  pointer-events: none;
}

.data-table th.desc::after {
  content: "\25BC";     /* ▼ */
  position: absolute;
  right: 0.5em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75em;
  color: #ffffff;
  pointer-events: none;
}



.clearfix::after {
  content: "";
  display: table;
  clear: both;
}
.clear {
  clear: both;
}

#mobileWarning {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 69, 0, 0.9);
  color: #ffffff;
  text-align: center;
  padding: 8px;
  font-size: 0.9rem;
  z-index: 1001;
  line-height: 1.3;
}

/* Shared content must fit narrow screens; wide tables scroll inside their region. */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
button, input { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, th:focus-visible {
  outline: 3px solid #ffd54f;
  outline-offset: 3px;
}
body:not(.canvas) { overflow-wrap: anywhere; }
body:not(.canvas) .lang-switch {
  position: static;
  text-align: right;
}
body:not(.canvas) .back-link {
  position: static;
  display: inline-block;
  margin: 1.5rem 0;
  color: yellow;
}
body.detail { max-width: 1100px; height: auto; }
.detail-image { display: block; max-width: 100%; height: auto; margin-top: 2rem; }
.data-table { float: none; width: auto; max-width: 100%; }
body.detail .data-table th, body.detail .data-table td { white-space: normal; overflow-wrap: anywhere; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.table-scroll .data-table { width: 100%; }
.portraits { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 1.5rem; margin-top: 2rem; }
.portraits > div { max-width: 100%; }
.portraits > div > div { max-width: 100%; }
.portraits p { white-space: normal; overflow-wrap: anywhere; }
.error-page { max-width: 800px; margin: auto; padding: 2rem; }
#canvasStatus { position: fixed; bottom: 0; left: 0; padding: 1rem; background: #1a1a1a; z-index: 30; }
#sharePopup { position: fixed; top: 25%; width: min(90vw, 650px); }
#shareInput { width: 100%; }
#typeFilters .link-button { margin-top: 0 !important; }
.toggle-button { left: 10px; }

@media (max-width: 768px), (max-height: 700px) {
  body.canvas {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100%;
    overflow: auto;
    padding: 0;
    gap: 0.75rem;
  }
  #mobileWarning {
    display: block;
    position: static;
    order: 1;
  }
  body.canvas .lang-switch {
    position: static;
    order: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.5rem;
  }
  #toggleMagnifier { position: static; min-width: 44px; min-height: 44px; }
  #paintingCanvas { order: 2; width: 100%; height: auto; max-height: none; margin: 0; }
  #coords { order: 3; position: static; margin: 0 0.75rem; width: auto; align-self: flex-start; }
  #canvasStatus { order: 3; position: static; margin: 0; }
  #link {
    order: 4;
    position: static;
    transform: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0.75rem;
  }
  #link button { margin: 0; min-height: 44px; }
  #magnifierCanvas { order: 5; position: static; align-self: center; }
  .variant-controls {
    order: 6;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0 0.75rem;
  }
  .toggle-button { position: static; width: 100%; min-height: 44px; padding: 6px; }
  #typeFilters {
    order: 7;
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0.75rem;
  }
  #toggleFilters { grid-column: 1 / -1; min-height: 44px; }
  #typeFilters label { display: flex; align-items: center; min-height: 44px; gap: 0.5rem; margin: 0; }
  body.canvas .link-switch {
    order: 8;
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 0.75rem 1rem;
  }
  .link-switch .link-button { width: 100%; margin: 0; min-height: 44px; }
  body.detail { margin: 1rem !important; max-width: none; }
  body:not(.canvas) main { padding: 1rem !important; }
  body:not(.canvas) h1 { font-size: 1.75rem; }
}
