/* Global reset: removes default margins/padding and sets border-box sizing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base text and color system for the whole page */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #ffffff;
  color: #333;
  line-height: 1.6;
}

/* Page header: gradient background, centered text, generous spacing */
header {
  background: linear-gradient(to right, #341632, #793474, #c051b9);
  color: #fff;
  padding: 60px 20px;
  text-align: center;
}

header h1 { font-size: 2.5rem; margin-bottom: 10px; }
header p  { font-size: 1.2rem; }

/* Section-specific heading colors for key concepts */
.keycons h2 { font-size: 2rem; margin-bottom: 20px; color: #F17D04; }
.keyconsdefs strong { margin-bottom: 20px; color: #073AD4; }

/* Site navigation bar: dark background with centered links */
nav {
  background-color: #222;
  padding: 15px 0;
}

/* Mobile menu toggle button (shown on small screens via media query) */
.nav-toggle {
  display: none;
  background: #222;
  color: #fff;
  border: none;
  padding: 10px 14px;
  font-size: 1.2rem;
  border-radius: 6px;
  margin: 0 auto 10px auto;
}

/* Horizontal nav list for larger screens */
nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
}
nav ul li { margin: 0 20px; }

/* Nav links: bold, rounded; hover adds color and shadow */
nav ul li a {
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  transition: color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  padding: 5px 10px;
  border-radius: 4px;
}
nav ul li a:hover {
  color: #c051b9;
  background-color: #0077cc;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Content sections: fixed max-width and comfortable padding */
section {
  padding: 60px 20px;
  max-width: 1000px;
  margin: auto;
}
section h2 { font-size: 2rem; margin-bottom: 20px; color: #341632; }
section ul { list-style: disc; padding-left: 20px; }
section ul li { margin-bottom: 10px; }

/* Thin horizontal divider */
hr {
  border: none;
  height: 1px;
  background-color: #ccc;
  margin: 10px 0;
}

/* Primary button style */
a.button {
  display: inline-block;
  background-color: #c051b9;
  color: #fff;
  padding: 12px 24px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}
a.button:hover { background-color: #c051b9; }

/* Layout container and text-image split block */
.content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Two-column flex layout for text with an image to the right */
.text-image-right {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.text-image-right .text { flex: 1; min-width: 300px; }
.text-image-right img {
  flex-shrink: 0;
  width: 40%;
  max-width: 400px;
  height: auto;
  border-radius: 8px;
}

/* Ensure all images scale with container width */
img { max-width: 100%; height: auto; }

/* Edge-to-edge image style */
.full-width-image {
  width: 100vw;
  height: auto;
  display: block;
  margin: 0;
  padding: 0;
}

/* Large centered image with a minimum width */
.center-image {
  width: 90%;
  height: auto;
  display: block;
  margin-left: 05%;
  min-width: 500px;
}

/* Row of framework logos/icons with wrapping */
.framework-images {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.framework-images img {
  width: 200px;
  height: auto;
  object-fit: contain;
}

/* Decorative “building blocks” image: centered with shadow */
#buildblocks {
  width: 30%;
  height: auto;
  display: block;
  margin-left: 35%;
  margin-top: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Two-column figure row with captions */
.image-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.image-row figure { width: 45%; text-align: center; }
.image-row img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.image-row figcaption { margin-top: 8px; font-size: 0.9em; color: #555; }

/* Footer: light background and smaller text */
footer {
  background-color: #f4f4f4;
  text-align: center;
  padding: 30px 20px;
  font-size: 0.9rem;
  color: #666;
}

/* Table wrapper: allows horizontal scrolling on narrow screens */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }

/* Quiz page container and card styles */
#quizPage {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(to right, #341632, #793474, #c051b9);
  padding: 20px;
}
#quizPage h1 {
  text-align: center;
  color: #ffffff;
  margin-bottom: 25px;
}
#quizPage form {
  background: #ffffff;
  max-width: 800px;
  margin: 0 auto;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
#quizPage .question { margin-bottom: 20px; }
#quizPage .question label {
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
  color: #341632;
}

/* Text inputs sized for touch and to avoid iOS zoom */
#quizPage input[type="text"] {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid #000000;
  border-radius: 5px;
}
#quizPage input[type="radio"],
#quizPage input[type="checkbox"] { margin-right: 8px; border: 1px solid #000000; }

/* Quiz buttons: solid, rounded, with hover transition */
#quizPage button {
  background-color: #341632;
  color: #fff;
  padding: 10px 18px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-right: 10px;
  font-size: 15px;
  transition: background-color 0.3s ease;
}
#quizPage button:hover { background-color: #2980b9; }

/* Quiz result message area and status styles */
#quizPage #results {
  margin-top: 25px;
  padding: 15px;
  border-radius: 8px;
  font-size: 16px;
}
#quizPage .correct   { color: #27ae60; font-weight: bold; }
#quizPage .incorrect { color: #e74c3c; font-weight: bold; }
#quizPage .pass {
  background: #d4edda; color: #155724; padding: 10px; border-radius: 5px; margin-bottom: 10px;
}
#quizPage .fail {
  background: #f8d7da; color: #721c24; padding: 10px; border-radius: 5px; margin-bottom: 10px;
}

/* ---------- Breakpoint 1: tablets and smaller ---------- */
@media (max-width: 768px) {
  /* Shows the toggle button and hides the nav list until opened */
  .nav-toggle { display: block; }

  /* Nav switches to vertical list; hidden by default, shown with .show */
  nav ul {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  nav ul.show { display: flex; }

  /* Scales down header and section spacing for smaller screens */
  header h1 { font-size: 2rem; }
  section { padding: 40px 15px; }

  /* Stacks image and text vertically */
  .text-image-right { flex-direction: column; text-align: center; }
  .text-image-right img { width: 80%; margin-top: 20px; }
  .text-image-right .text { padding-right: 0; }

  /* Figures expand to full width for readability */
  .image-row figure { width: 100%; }

  /* Centers and enlarges the decorative image on tablets */
  #buildblocks { width: 60%; margin-left: 20%; }
}

/* ---------- Breakpoint 2: phones ---------- */
@media (max-width: 480px) {
  /* Tightens header spacing and further scales text */
  header { padding: 40px 16px; }
  header h1 { font-size: 1.6rem; }
  header p  { font-size: 1rem; }

  /* Reduces section padding to fit smaller screens */
  section { padding: 24px 12px; }

  /* Narrows vertical spacing between nav items */
  nav ul li { margin: 8px 0; }

  /* Forces imagery to full width on phones */
  .text-image-right img,
  .center-image,
  .framework-images img {
    width: 100%;
    max-width: 100%;
  }

  /* Decorative image width tuned for small screens */
  #buildblocks { width: 80%; margin-left: 10%; }

  /* Larger touch targets for quiz controls */
  #quizPage input[type="text"] { padding: 14px; font-size: 18px; }
  #quizPage button {
    width: 100%;
    margin: 8px 0;
    padding: 12px 16px;
    font-size: 17px;
  }
}