body {
  font-family: Arial;
  padding: 60px;
}

.container {
  max-width: 968px;
}

p {
  /* No need to reapply max-width here */
}

h3 {
  margin-top: 1.7em;
}

.blog-item {
  margin-bottom: 0.5em;
}

span.blog-subline {
  color: #333;
  font-style: italic;
  font-size: 1.2em;
}

span.blog-section-header {
  display: inline-block;
  margin-top: 12px;
  font-weight: bold;
}

.captioned-image-container {
  float: right;
  position: relative;
  margin-left: 1em;
  margin-bottom: 1em;
  background-color: #ccc;
  border: 1px solid #333;
  padding: 5px;
  box-sizing: border-box;
  text-align: left;
  display: inline-block;
  vertical-align: top;
  max-width: 250px; /* Back to original size */
}

.captioned-image-container.first-image {
  max-width: 150px; /* Smaller size for first images */
}

.captioned-image-container img {
  display: block;
  width: 100%; /* Image will scale to container's width */
  height: auto;
  margin: 0 auto 0.5em auto;
}

.captioned-image-container .caption {
  font-size: 0.8em;
  font-style: italic;
  font-weight: bold;
  color: #333;
  word-wrap: break-word; /* Allows long words to break and wrap */
  white-space: normal; /* Ensures caption wraps to the next line */
}

blockquote {
  margin: 2em 0;
  padding: 1.5em 2em;
  border-left: 4px solid #333;
  background-color: #f8f8f8;
  font-style: italic;
  font-size: 0.95em;
  line-height: 1.6;
  color: #444;
  position: relative;
}

blockquote::before {
  content: '"';
  font-size: 2.5em;
  color: #999;
  position: absolute;
  left: 0.3em;
  top: 0.1em;
  font-family: Georgia, serif;
  z-index: 1;
}

@media (max-width: 768px) {
  body {
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
  }
  
  .container {
    max-width: 100%;
  }
  
  h1 {
    font-size: 1.8em;
    line-height: 1.3;
    margin-bottom: 0.5em;
  }
  
  h2 {
    font-size: 1.5em;
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
  }
  
  h3 {
    font-size: 1.3em;
    line-height: 1.3;
    margin-top: 1.3em;
    margin-bottom: 0.5em;
  }
  
  p {
    font-size: 1.1em;
    line-height: 1.7;
    margin-bottom: 1em;
  }
  
  span.blog-subline {
    font-size: 1.1em;
    margin-bottom: 1em;
    display: block;
  }
  
  span.blog-section-header {
    font-size: 1.3em;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    display: block;
  }
  
  .captioned-image-container {
    float: none;
    display: block;
    margin: 1.5em auto;
    max-width: 100%;
    padding: 8px;
  }
  
  .captioned-image-container .caption {
    font-size: 0.9em;
    line-height: 1.4;
    margin-top: 0.5em;
  }
  
  blockquote {
    margin: 1.5em 0;
    padding: 1.2em 1.5em;
    font-size: 1.05em;
    line-height: 1.6;
  }
  
  blockquote::before {
    font-size: 2em;
    left: 0.2em;
    top: 0.1em;
  }
  
  /* Adjust modal sizes for mobile */
  .modal-content,
  .image-modal-content {
    width: 95%;
    padding: 15px;
  }
  
  .close-button,
  .image-close-button {
    font-size: 30px;
    right: 15px;
  }
}

.play-button {
  position: absolute;
  filter: invert(90%);
  text-align:center;
}

.play-button img {
  display: block;
  margin: auto;
  width: 30%;
}

/* Video Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
  position: relative;
  margin: auto;
  padding: 20px;
  width: 80%;
  max-width: 800px;
  top: 50%;
  transform: translateY(-50%);
}

.close-button {
  position: absolute;
  right: 25px;
  top: 0;
  color: #f1f1f1;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover {
  color: #bbb;
}

#modalVideo {
  width: 100%;
  max-height: 80vh;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

/* Image Modal Styles */
.image-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
}

.image-modal-content {
  position: relative;
  margin: auto;
  padding: 20px;
  width: 90%;
  max-width: 1200px;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
}

.image-close-button {
  position: absolute;
  right: 25px;
  top: 0;
  color: #f1f1f1;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
}

.image-close-button:hover {
  color: #bbb;
}

#modalImage {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

.image-modal-caption {
  color: #f1f1f1;
  font-size: 14px;
  margin-top: 10px;
  text-align: center;
}

.video-thumbnail {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 100%;
}

.video-thumbnail:hover {
  opacity: 0.9;
}

.video-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
}