#masthead .hgroup .logo {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Image styles */

#masthead .hgroup .logo img {
  max-width: 100%;
  height: auto;
  display: block;
  width: 220px;
  /* Optional: limit size */
}

/* Title styles */

#masthead .site-title.logo-title {
  font-size: 1.5rem;
  text-align: left;
  margin: 0;
}

/* Responsive behavior */

@media (max-width: 768px) {
  #masthead .hgroup .logo {
    flex-direction: column;
    align-items: flex-start;
  }

  #masthead .site-title.logo-title {
    font-size: 0.5rem;
    margin-top: 0.5rem;
    text-align: center;
  }
}

.wp-block-gallery.is-layout-flex .wp-block-image {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  min-width: 150px;
  max-width: 250px;
  flex-grow: 0;
  padding: 10px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease-in-out;
  overflow: hidden;
  box-sizing: border-box;
}

/* Now constrain images so they never overflow container */

.wp-block-gallery.is-layout-flex .wp-block-image img {
  max-height: 100px;
  max-width: 100%;
  /* key addition: limit image width to container */
  height: auto;
  width: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease-in-out;
}

/* Gallery layout */

.wp-block-gallery.is-layout-flex {
  gap: 20px;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
}

/* Responsive tweaks */

@media (max-width: 768px) {
  .wp-block-gallery.is-layout-flex .wp-block-image {
    min-height: 100px;
    min-width: 120px;
    max-width: 180px;
    padding: 8px;
  }

  .wp-block-gallery.is-layout-flex .wp-block-image img {
    max-height: 80px;
  }
}

@media (max-width: 480px) {
  .wp-block-gallery.is-layout-flex .wp-block-image {
    min-height: 80px;
    min-width: 100px;
    max-width: 140px;
    padding: 5px;
  }

  .wp-block-gallery.is-layout-flex .wp-block-image img {
    max-height: 60px;
  }
}