html, body {
    height: 100%;
    margin: 0;
	
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}


.header {
    position: sticky; /* eller fixed */
    top: 0;
    width: 100%;      /* alltid full bredd */
    z-index: 2000;    
    background: #0a4c8a;
    color: white;
    padding: 15px 0;
}


/* Ljusast #3a7fcf 

Lite mörkare #3579c4

Lite mörkare: #2f6fb3

Lite mörkare: #2a63a3


*/

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
}

.hero {
    background: #e8f0fa;
    padding: 10px 0;
    text-align: center;
}

.courses {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 900px; /* 3 × 300px exempelvis */
    margin: 0 auto;
}

.course-card {
    background: white;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.footer {
    background: #ddd;
    text-align: center;
    padding: 15px 0;
    margin-top: 0; /* viktigt */
}






/* Vanlig text */
body, p, li, span {
    font-family: "PT Sans", sans-serif;
}

/* Titlar */
h1, h2, h3, h4, h5, h6 {
    font-family: "Bebas Neue", sans-serif;
	letter-spacing: 0.08em;
}



/* Matematiknivå-sektion */
.niva-content {
    max-width: 900px;
    margin: 40px auto 20px auto; /* mer luft ovanför */
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.niva-content h2 {
    margin-bottom: 10px;
}

.niva-content p {
    margin-bottom: 20px;
}

/* Grid för matematikområden */
.matematik-omraden {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1700px;
    margin: 20px auto 40px auto;
    padding: 0 20px;
}

/* Kort för varje område */
.omrade-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}



.omrade-card h3 {
    margin-bottom: 10px;
    color: #0a4c8a; /* matchar header-färg */
}

.omrade-card ul {
    padding-left: 1.2rem;
    list-style-type: disc;
}

.omrade-card ul li {
    margin-bottom: 8px;
    color: #333;
}

.omrade-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}


.ul-flex {
    list-style: none;
    padding-left: 0;
}

.li-flex {
    display: flex;
    align-items: flex-start; /* numret och texten toppjusteras */
    margin-bottom: 0.5em;
}

.li-number {
    font-weight: bold;
    text-align: left;
    margin-right: 0.5em;
	font-family: "Bebas Neue", sans-serif !important;
}

.li-text {
    flex: 1; /* tar resten av utrymmet */
}


a,
a:visited,
a:hover,
a:active,
a:focus {
    color: inherit;
    text-decoration: none;
}




.li-text {
    cursor: pointer;
}


.omrade-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column; /* Lägg till denna rad */
    justify-content: flex-start; /* Justerar elementen vertikalt, kan ändras vid behov */
    align-items: center; /* Centrerar elementen horisontellt */
}




/* 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 */
}






.katex * {
    font-family: inherit !important; 
	font-size: 0.95em;
}


/*


.katex-display .katex {
  font-size: 1em;    
}

----------  eller låt KaTeX använda sina egna fonts */



.sidebox {
    position: absolute;
    top: 20px;
    left: 300px;      /* TOC (220px) + marginal */
    width: 220px;
}


.teori-content {
    margin-left: 560px; /* 220 + 40 + 220 + 80 (luft) */
}

.sidebox .tip {
    display: none; /* Alla tips dolda initialt */
}