img.framed {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 90%;
  /* max-width: 600px; */
  max-width: min(90%, 650px);  /* 90% on small screens, max 650px on large */
  max-height: 500px;
  width: auto;
  height: auto;
  border-style: solid;
  border-width: 12px;
  border-color: #000;
  padding: 5%;
  margin-bottom: 1rem;
  border-radius: 0.375em;
  box-shadow:
    0 15px 7px -5px rgba(0,0,0,0.3),
    0 10px 7px -5px rgba(0,0,0,0.3) inset;
}

@media (max-width: 600px) {
  img.framed {
    border-width: 6px;
    padding: 2%;
  }
}

/* hide any link styling on the image */
a.image-link {
  text-decoration: none;   /* no underline */
  border: none;            /* no border */
}

figure {
  margin: 1rem auto;
  text-align: center;
}

figcaption {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
  margin-top: 0.3rem;
  text-align: center;
}

.caption {
  display: block;
  text-align: center;
  font-size: 0.9rem;
  color: #666;           /* subtle gray */
  font-style: italic; 
  margin-top: 0.3rem;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem 0.5rem;	/* vertical, horizontal*/
  padding: 0.5rem 0.5rem	/* small outer margin */
}

.gallery-item {
  text-align: center;
  padding: 0 2px; 0 2px;
}

.gallery-item p:first-of-type {
  display: block;
  margin: 0;
  text-align: center;
}

.gallery-item p:not(:first-of-type) {
  margin: 0;
}

.gallery-caption {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  text-align: center;
  color: #666;
  font-style: italic;
}

.gallery-img {
  display: block;
  margin: 0 auto 0.4rem auto;	/* center image inside the <p> */
  width: 100%;
  max-width: 100%;
  height: auto;
  padding: 0;
  background: #eee;
  border: 4px solid #000;
  border-radius: 0.375em;
  box-shadow:
    0 6px 4px -2px rgba(0,0,0,0.3),
    0 4px 4px -2px rgba(0,0,0,0.3) inset;
}


/* Smooth zoom effect on hover for gallery images */
/* disable - doesn't look great on the iphone */
/*
8gallery-item .gallery-img {
  transition: transform 0.3s ease;
  cursor: pointer;
}

.gallery-item .gallery-img:hover {
  transform: scale(1.5); /* enlarge to 150% on hover --
  z-index: 2;            /* make sure it appears above neighbors --
} 
*/
