/* ===============================
   Typografie & basis
   =============================== */
body, h1, h2, h3, h4, h5, h6 {
  font-family: "Raleway", sans-serif;
}
html, body {
  height: 100%;
  line-height: 1.8;
}

/* Zorg voor uniforme tekstgrootte in grijze containers */
.w3-container.w3-light-grey p {
  font-size: 1.1rem;
  line-height: 1.7;
}

/* voorkomt html frameborder error in youtube video links, daar de frameborder="0" eruit halen */
iframe {
  border: none;
}

.img-100 {
  float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    margin: 12px 0 16px 0;
    clear: both;
}



/* Afbeeldingen krimpen binnen container */
/* ≥600px: rechts floaten, 40% breed */
@media (min-width: 600px) {
  .lesson-content img.float-right,
  .page-content  img.float-right {
    float: right;
    width: 40%;
    max-width: 40%;
    height: auto;
    margin: 0 0 10px 20px;
  }
  #img-contact {
  float: right;
    width: 20%;
    max-width: 40%;
    height: auto;
    margin: 0 0 10px 20px;
}

}



/* Kleine schermen (<600px) */
/* <600px: niet floaten, 100% breed */
@media (max-width: 599px) {
  .lesson-content img.float-right,
  .page-content  img.float-right {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    margin: 12px 0 16px 0;
    clear: both;
  }
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* blokken content open en dichtklappen */
.toggle-heading {
    cursor: pointer;
    background-color: #eee;
    padding: 0.6em 1em;
    border-radius: 6px;
    margin-top: 2em;
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 1.2em;
  }

  .toggle-icon {
    margin-right: 0.5em;
    font-weight: bold;
    font-size: 1.2em;
  }

  .toggle-content {
    display: none;
    margin-top: 1em;
  }

/* Wetenschappelijke notatie */
.sci {
  font-family: 'STIX Two Math', 'Cambria Math', serif;
  font-weight: 400;
  font-size: 1em;
}

/* ===============================
   Video (responsief)
   =============================== */
.video-float {
  float: right;
  clear: right;
  margin: 0 0 10px 20px;
  width: 100%;
  max-width: 560px;
}
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.video-float figcaption {
  text-align: center;
  font-size: .9rem;
  color: #555;
  margin-top: 4px;
}
/* voor videos die NIET rechts moeten floaten: */

.video-center {
  margin: 20px auto;           /* centreren */
  max-width: 560px;            /* maximale breedte op grote schermen (pas dit aan naar wens) */
  width: 100%;                 /* vult breedte tot max */
  height: 100%;
  clear: both;                 /* voorkomt tekst ernaast */
  display: block;
  text-align: center;
}
/* Kleine schermen: altijd volle breedte container */
@media (max-width: 600px) {
  .video-center {
    max-width: 100% !important;
    margin: 12px 0 16px 0;
    text-align: center;
  }
}

/* alle figcaptions cursief */
figcaption {
  font-style: italic;
}




/* ===============================
   Layout: sidebar + content
   =============================== */
.page-grid {
  display: grid;
  grid-template-columns: minmax(260px, 30%) minmax(0, 1fr);
  grid-template-areas: "sidebar content";
  gap: 20px;
  align-items: start;
  padding: 32px 16px;
}
/* ▼ geef elk kind zijn area-naam */
.sidebar      { grid-area: sidebar; position: sticky; top: 80px; align-self: start; }
.page-content { grid-area: content; }


/* ===============================
   Knoppenkolom
   =============================== */
.btn-stack {
  display: block;
  max-width: 100%;
  margin: 40px 0;
}
.sidebar .btn-stack {
  display: inline-block;
}
.btn-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 16px;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  text-align: left;
  white-space: normal;
  word-break: break-word;
}
.btn-icon {
  flex: 0 0 2.6rem;
  text-align: center;
  font-size: 1.2em;
}
.btn-text {
  flex: 1 1 auto;
}
.btn-stack > .btn-item {
  margin-bottom: 10px;
}
.btn-stack > .btn-item:last-child {
  margin-bottom: 0;
}
.btn-stack .btn-item {
  max-width: 95%;
  margin-left: auto;
  margin-right: auto;
}

/* ===============================
   Contentkaart rechts
   =============================== */
.page-content .w3-card {
  padding: 16px 20px;
}

/* ===============================
   Lesinhoud
   =============================== */
.lesson-content {
  max-width: 800px;
  margin: auto;
  padding: 16px;
  font-size: 1.1rem;
  line-height: 1.7;
}
.lesson-content h2, .lesson-content h3 {
  margin-top: 1.5em;
}
.lesson-content ul, .lesson-content ol {
  margin-left: 1.2em;
}
.lesson-content code {
  background: #eee;
  padding: 2px 4px;
  border-radius: 4px;
}
.lesson-content small {
  display: block;
  margin-top: 2em;
  color: #666;
  font-size: .9em;
}

/* ===============================
   Tabellen
   =============================== */
.w3-responsive {
  overflow-x: auto;
  max-width: 100%;
}
.oefentabel-clean td:nth-child(3) {
  padding-right: 20px;
}
.lesson-content table:not(.oefentabel-clean):not(.rijtje-tabel):not(.receptsom) {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: inherit;
}
.lesson-content table:not(.oefentabel-clean):not(.rijtje-tabel):not(.receptsom) th,
.lesson-content table:not(.oefentabel-clean):not(.rijtje-tabel):not(.receptsom) td {
  border: 1px solid #ccc;
  padding: 8px 12px;
  text-align: left;
}
.lesson-content table:not(.oefentabel-clean):not(.rijtje-tabel):not(.receptsom) th {
  background: #f2f2f2;
}
.lesson-content table.rijtje-tabel {
  font-size: 1.1rem;
}

/*oefensommen breuken: breuken wat kleiner tov tekst" */

.breukfontsize {
  font-size:0.9em;
  margin: 5px 7px;

}


/* ---------
verberg haakje } bij receptsommen op kleine schermen
---------- */
/* standaard: brace zichtbaar */
.brace-cell {
  text-align: center;
  vertical-align: middle;
}

/* kleine schermen:*/
@media (max-width: 600px) {
  .brace-cell img {
    display: none !important; /* haakje verbergen */
  }

  .receptsom tr {
    display: block; /* elke rij wordt blok */
  }

  .receptsom td {
    display: block; /* elke cel onder elkaar */
    width: 100%;
    padding: 6px 0;
  }

  .receptsom td:nth-child(3) {
    padding-right: 0; /* geen extra ruimte rechts op mobiel */
  }

  ul, ol {
    list-style-position: outside !important; 
    padding-left: 0 !important;             
    margin-left: 1.2em !important;              
  }
  ul li, 
  ol li {
    margin-left: 0 !important;
    padding-left: 0 !important;
    text-indent: 0 !important;
  }

}




/* Utilities */
.grijs { background: #ddd; }
.table-responsive { overflow-x: auto; }
.only-mobile { display: none; }
.blauw { color: #0058cc; }
.trucje { color: #0058cc; font-weight: bold; }
.trucje strong { display: inline-block; min-width: 2em; }
h2[id], h3[id], h4[id] { scroll-margin-top: 80px; }
/*
.toc-link { text-decoration: none; font-weight: bold; color: inherit; } */
.page-content, .lesson-content { min-width: 0; }

/* ===============================
   Media queries
   =============================== */

/* Desktop breed */
@media (min-width: 1025px) {
  .btn-stack .btn-item { max-width: 600px; }
}
@media (min-width: 1200px) {
  .video-float { width: 40%; max-width: none; }
  .btn-item { padding: 16px 20px; font-size: 1.1rem; }
  .sidebar .btn-stack { display: block; width: 100%; }
  .btn-icon { flex: 0 0 3rem; font-size: 1.4em; }
}

/* Hele kleine schermen (≤420px) */
@media (max-width: 420px) {
  .btn-stack { margin: 24px 0; }
  .btn-item { padding: 12px 14px; }
  .btn-icon { flex: 0 0 2.0rem; }
  .rdj-header-text-small { font-size: 1.6rem !important; }
}

/* Mobiel algemeen (≤768px)*/
@media (max-width: 768px) {
  .page-grid { 
    grid-template-columns: 1fr; 
    grid-template-areas:
      "content"
      "sidebar";
  }
  /* sidebar niet sticky op klein scherm */
  .sidebar { 
    position: static; 
    top: auto; 
    width: 100%; 
    margin: 0; 
    padding: 0;
  }
  
  .btn-stack { width: 100%; margin: 16px 0; }
  .btn-item { width: 100%; box-sizing: border-box; }
  .btn-stack .btn-item { max-width: 95%; margin-left: auto; margin-right: auto; }

  .page-content, .video-float {
    float: none !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 12px 0 16px 0 !important;
    clear: both;
  }

 

}
/* Tablets in portrait: sidebar onder content (iPad e.d.) */
@media (orientation: portrait) and (min-width: 769px) and (max-width: 1024px) {
  .page-grid { 
    grid-template-columns: 1fr;
  /* volgorde afdwingen voor iPad portrait */
    grid-template-areas:
      "content"
      "sidebar";
  }

  .sidebar {
    position: static;
    top: auto;
    width: 100%;
    margin: 0;
    padding: 0;
    
  }

}


@media (max-width: 768px) { 
#tbl-voorvoegsels thead {
    display: none; /* koprij verbergen */
  }

  table.hide-header-mobile thead {
    display: none;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table tr {
    margin-bottom: 1.5em;
    border: 1px solid #ddd;
    padding: 0.5em;
    border-radius: 8px;
    background: #fafafa;
    box-sizing: border-box;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .responsive-table td {
    text-align: left !important;
    padding: 0.4em 0.6em;
    position: relative;
  }

  /* Kolomtitel vóór de celinhoud zetten */
  .responsive-table td::before {
    content: attr(data-label);
    font-weight: bold;
    display: block;
    margin-bottom: 0.25em;
    color: #333;
  }
   .only-desktop { display: none !important; }
  .only-mobile { display: block !important; }
  .only-mobile p { margin: .25em 0; }

}



