html, body {
    min-height: 100vh;
    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;
}

.footer {
    background: #ddd;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 50px;
    padding-right: 50px;
    flex-shrink: 0; /* säkerställer att footern inte krymper */
}




/* 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;
}

.main-nav #tts-btn {
    color: white;             /* SVG:n tar färgen härifrån */
    text-decoration: none;
    margin-left: 20px;
    padding: 0;               /* tar bort standardpadding från button */
    line-height: 1;           /* matcha a och button */
    vertical-align: middle;   /* centrera vertikalt */
    background: none;
    border: none;
    font: inherit;            /* samma font som länkar */
    cursor: pointer;
    box-sizing: border-box;
}


/* Enkel icke-blockerande modal */
#tts-modal {
    display: none;           /* gömd som standard */
    position: absolute;      /* följer sidan */
    z-index: 1000;           /* ovanpå annat innehåll */
    top: 100px;              
    right: 40px;             
    background-color: #fff;  /* själva boxen */
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Stängknappen inuti */
#tts-modal .close {
    position: absolute;
    top: 5px;
    right: 8px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
}

.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);
}





.copyright-date p {
    margin: 0; /* tar bort standardmarginal på <p> */
}



/* 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;
}

h4 {
    margin-top: 50px;
}

/* 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 */
}





.katex * {
    font-family: inherit !important; 
	font-size: 0.95em;
}


/*


.katex-display .katex {
  font-size: 1em;    
}

----------  eller låt KaTeX använda sina egna fonts */



.exempel {
  margin-left: 40px;
  margin-right: 40px;  /* indrag 40px */
  background-color: #d9f0ff;  /* ljusblå bakgrund */
  border-radius: 12px;    /* rundade hörn */
  padding: 12px;          /* lite luft inuti rutan */
}


.page-wrapper.problemlosning .toc {
    flex: 0 0 200px;
    max-height: 80vh;   /* scrollhöjd endast här */
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
}

.page-wrapper.problemlosning .teori-content {
    flex: 1;
    overflow: hidden;
}