


/* Wrapper för att kunna positionera TOC fritt */
.page-wrapper {
  position: relative; /* för TOC absolut-position */
}

/* ---------- TOC ---------- */
.toc {
  position: absolute;    /* ligger utanför flödet */
  top: 20px;             /* starta på samma höjd som content */
  left: 40px;            /* avstånd från vänsterkanten */
  width: 220px;          /* fast bredd */
}

.toc h3 {
  margin-bottom: 1rem;
}

.toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.toc a {
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  color: #333;
  font-style: normal;
  font-weight: normal;
}

.toc a:hover {
  font-style: italic;
}

.toc a:active {
  font-weight: bold;
}


.toc a.toc-active {
    font-weight: bold;       /* Fetstil */
    margin-left: 10px;       /* Flytt åt höger */
    color: #3a7fcf;          /* ljusare blå */
}

/* ---------- Teori content ---------- */
.teori-content {
  max-width: 800px;
  width: 100%;
  margin: 20px auto 0 auto; /* centrera horisontellt och ge luft upptill */
  box-sizing: border-box;
}

p {
  margin-bottom: 0;
}




.clickable {
    cursor: pointer;       /* visar att det går att klicka */
}

.clickable:hover {
    font-style: italic;    /* kursiv när musen är över */
}






.teori-content {
    margin-left: 560px; /* 220 + 40 + 220 + 80 (luft) */
}


.sidebox {
    position: absolute;
    top: 20px;
    left: 300px;      /* TOC (220px) + marginal */
    width: 220px;
}



.sidebox .tip {
    display: none; /* Alla tips dolda initialt */
}


.begreppbox {
    position: absolute;
    left: 1430px;      /* TOC (220px) + marginal */
    width: 300px;
}





.hover-term {
	position: relative;
	cursor: help;  
	font-weight: bold;
	/*display: none;           ordet är gömt initialt */
}

.hover-term .tooltip {
	position: absolute;
	top: 1.5em;
	right: 100%;
	transform: translateY(-38px);
	background: #052d54;
	color: #fff;
	font-size: 0.9em;
	min-width: 200px;
	max-width: 600px;
	font-weight: normal;
	z-index: 1000;
	display: none !important;          /* tooltip göms tills hover */
	
	--s: 1.5em; /* triangle size */
	--r: 1em; /* the radius */

	padding: 1em;
	border: var(--s) solid #0000;
	border-radius: calc(var(--r) + var(--s));
	border-top-right-radius: 0;
	-webkit-mask:
	  radial-gradient(100% 100% at 100% 100%, #0000 99%, #000 102%)
		100% calc(var(--s) - 1px) / var(--s) var(--s) no-repeat border-box,
	  linear-gradient(#000 0 0) padding-box;
}

.hover-term .tooltip.visible {
    display: inline-block !important;
}

.tooltip-tables {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.tooltip-tables table {
  border-collapse: collapse;
  background: #fff;
  color: #000;
}

.tooltip-tables th,
.tooltip-tables td {
  border: 1px solid #ccc;
  padding: 5px;
}

.auto-iframe {
  visibility: hidden;
}