/* Base body and container adjustments */
body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f9;
  color: #333;
  scroll-behavior: smooth;
  transition: background-color 0.3s, color 0.3s;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Make main container flexible with wrap to avoid squishing */
.container {
  flex: 1; /* Take up remaining height */
  display: flex;
  flex-wrap: wrap; /* Allow wrapping on smaller viewports */
  justify-content: center; /* Center children horizontally */
  align-items: stretch; /* Stretch children vertically */
  background-color: #48bfe3;
  padding: 20px; /* Add padding inside container */
  gap: 20px; /* Space between items */
  box-sizing: border-box;
}

/* Image placeholders: fixed width but responsive */
.image-placeholder {
  flex: 0 0 200px; /* Fixed basis */
  max-width: 200px; /* Ensure no growing */
  background-color: #ccc;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  box-sizing: border-box;
}

/* Images inside placeholders should scale nicely without distortion */
.image-placeholder img {
  width: 100%;
  height: auto; /* Maintain aspect ratio */
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* Section content: flexible, grows to fill available space */
.section {
  flex: 1 1 400px; /* Grow and shrink, minimum 400px wide */
  background: #80ffdb;
  border-radius: 8px;
  padding: 20px; /* More padding for comfortable spacing */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  margin-top: 56px; /* Adjusted margin-top - see explanation below */
  overflow-wrap: break-word; /* Prevent long words from overflowing */
  box-sizing: border-box;
  max-width: 800px; /* Optional max width for readability */
}

/* Headings centered */
h2 {
  color: #4caf50;
  text-align: center;
  margin-top: 0;
  margin-bottom: 1em;
}

/* Lists with comfortable spacing */
ul {
  padding-left: 20px;
  margin-top: 0;
  margin-bottom: 1em;
}

/* Bubble text styles - centered and padded */
.bubble {
  background-color: #64dfdf;
  border-radius: 20px;
  padding: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  margin: 10px 0;
  font-weight: bold;
  text-align: center;
  transition: background-color 0.3s, transform 0.3s;
  display: inline-block;
}

/* Adjust margin-top on section: 
   Reduced from 117px to 56px to avoid too much vertical gap under fixed headers */
.section {
  margin-top: 56px;
}

/* Responsive adjustments for smaller devices */
@media screen and (max-width: 768px) {
  .container {
    flex-direction: column; /* Stack items vertically on small screens */
    align-items: center;
    padding: 10px;
  }
  .image-placeholder,
  .section {
    flex: none;
    max-width: 100%;
    width: 90vw; /* Almost full viewport width */
    margin: 0 auto 20px auto; /* Center and space vertically */
  }
  .section {
    margin-top: 10px;
  }
}
