/* --- Base Styles --- */

/* Sets the default font and background color for the page */
body {
  font-family: Arial, sans-serif;
  background-color: #f7f9fa;
  color: #333;
  margin: 0;
  padding: 0;
}

/* Centers the content and prevents it from getting too wide on large monitors */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

/* Styles the main header at the top of the page */
.main-header {
  background-color: #2c3e50;
  color: white;
  text-align: center;
  padding: 30px 20px;
}

/* Creates the white boxes holding the demonstrations */
.demo-box {
  background-color: white;
  margin-top: 30px;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Highlights the description text so the viewer notices it */
.viewer-note {
  background-color: #eef2f5;
  padding: 15px;
  border-left: 4px solid #3498db;
  margin-bottom: 20px;
}


/* --- Fluid Images --- */

/* Ensures the image never scales larger than its container, but shrinks when needed */
.fluid-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}


/* --- CSS Grid --- */

/* Turns the container into a responsive grid layout */
.grid-container {
  display: grid;
  
  /* Automatically calculates how many columns can fit. 
     If the screen is smaller than 250px, they stack. */
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

/* Styles the individual boxes inside the grid */
.grid-card {
  background-color: #fdfdfd;
  border: 1px solid #ddd;
  padding: 20px;
  border-radius: 6px;
  text-align: center;
}


/* --- Technique 3: Media Queries --- */

/* These rules ONLY apply when the screen width is 600px or smaller (like a phone) */
@media (max-width: 600px) {
  
  /* Reduces padding inside the demo boxes to save space on small screens */
  .demo-box {
    padding: 15px;
  }
  
  /* Shrinks the main heading font size so it doesn't break onto too many lines */
  .main-header h1 {
    font-size: 24px;
  }
}