* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-size: 16px;
}

/* Header */
header {
  height: 100px;
  background-color: #fbfbfb;
  color: rgb(0, 0, 0);
  display: flex;
  align-items: center;
  padding: 0 20px;
}

#headerOvergang {
  height: 0.5vh;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
}

#headerKnapperDiv {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-right: 120px;
}

a.headerKnapper {
  color: black;
  margin: 20px;
  font-size: 1.2rem;
  font-weight: 500;
  text-decoration-line: none;
}

header img {
  height: 70px;
  width: auto;
}

header h1 {
  font-size: 1.5rem;
}

/* Indhold */
h1, h2, h3 {
  padding: 20px 0px 10px 0px;
}

p {
  padding: 0px 0px 10px 0px;
  overflow-wrap: break-word;
}

ul, ol {
  padding: 0px 0px 0px 30px;
}

li {
  padding: 0px 20px 3px 0px;
  overflow-wrap: break-word;
}

/* Layout */
.app {
  display: flex;
  height: calc(100vh - 100px);
  padding: 2vh 1vw 2.5vh 1vw;
  background-color: #ffffff;
}

.left, .center, .right {
  min-width: 0; /* Tillader flex-items at krympe */
}

.left {
  flex: 1;
  padding: 0px 20px 20px 0px;
}

/* Side-navigation */
.nav-bar {
  background-color: #fbfbfb;
  border: 2.5px solid rgba(194, 194, 194, 30%);
  border-radius: 12px;
  padding: 18px 16px;
  width: 100%;

  display: flex;
  flex-direction: column;
  gap: 6px;

  /* Følger med når man scroller */
  position: sticky;
  top: 10px;
}

/* Overskrift i boksen */
.nav-bar h3 {
  padding: 0 0 10px 0;
  font-size: 1.25rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  margin-bottom: 6px;
}

/* Links */
.nav-bar a {
  text-decoration: none;
  color: #222;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}

/* Hover */
.nav-bar a:hover {
  background: rgba(0,0,0,0.06);
}

/* Klik-feedback */
.nav-bar a:active {
  background: rgba(0,0,0,0.10);
}

.center {
  flex: 2.5;
  display: flex;
  flex-direction: column;
  padding: 0px 2% 20px 2%;
  background-color: #fbfbfb;
  overflow-y: auto;
  overflow-x: hidden; /* Ingen vandret scroll */
  border: 2.5px solid rgba(194, 194, 194, 30%);
  border-radius: 12px;
}

.right {
  flex: 1;
  padding: 0px 40px 20px 0px;
  overflow: hidden;
}

/* Billeder */
.billede-wrapper {
  width: 100%;
  padding-top: 20px;
}

/* Ligger ALTID på én linje */
.billede-række {
  display: flex;
  flex-wrap: nowrap;     /* ← ingen wrapping */
  gap: 4%;
  width: 100%;
}

/* Hvert billede tager lige meget plads og må gerne krympe */
.billede-række img {
  flex: 1 1 0;           /* deler pladsen ligeligt */
  min-width: 0;          /* KRITISK: tillader shrinking i flexbox */
  width: 100%;           /* fylder sin flex-celle */
  height: auto;          /* bevarer proportioner */

  object-fit: contain;

  border-radius: 8px;
  border: 2px solid #ccc;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);

  padding: 25px;
  box-sizing: border-box;
  background: white;
}

.nav-bar {
  width: 100%;
}

/* Tabeller */
table {
  width: 55%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 1rem;
  margin-bottom: 1.3rem;
  text-align: left;
  max-width: 100%; /* Forhindrer overflow */
}

th, td {
  padding: 4px 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  font-weight: 500;

  white-space: normal;          /* Må bryde linjer */
  overflow-wrap: break-word;
}

/* MathJax skal respektere containeren */
.center mjx-container {
  max-width: 100% !important;
  overflow-x: auto;
}

/* Skaler meget lange ligninger i stedet for at sprænge layout */
.center mjx-container[jax="SVG"] {
  font-size: clamp(0.85rem, 1vw, 1rem);
}

/* Responsive magic */
@media (max-width: 2000px) {
  html, body {
    font-size: 14px; /* slight scale-down */
  }
}