.spf_container {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  padding: 1rem;
  white-space: normal;
}

.spf_container.spf_size_small {
  grid-template-columns: repeat(5, 1fr);
}

.spf_container .spf_item {
  position: relative;
  padding-bottom: 100%;
  overflow: hidden;
}

.spf_container .spf_item img {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  transition: all 0.2s ease-in-out;
}

.spf_container .spf_item img:hover,
.spf_container .spf_item a:focus img {
  transform: scale(1.1);
}

.spf_caption {
  font-size: 11px;
  padding: 0.5rem;
}

#spf_lightbox_container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 99999999;
}

#spf_lightbox_image_box {
  position: fixed;
  top: 2em;
  left: 2em;
  right: calc(2em + 35%);
  bottom: 2em;
  text-align: center;
}

#spf_lightbox_image_box img {
  max-width: 100%;
  max-height: 100%;
  border: 2px solid #000;
  outline: 1px solid #ccc;
  box-sizing: border-box;
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
}

#spf_lightbox_caption {
  position: fixed;
  bottom: 11em;
  top: 7em;
  right: 2em;
  background: #222;
  color: #fff;
  padding: .5em;
  box-sizing: border-box;
  text-align: center;
  border: 1px solid #ccc;
  width: calc(35% - 4em);
  overflow-y: auto;
  text-align: left;
}

#spf_lightbox_link {
  position: fixed;
  right: 2em;
  bottom: 7em;
  background: #222;
  color: #fff;
  padding: .5em;
  width: calc(35% - 4em);
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  border: 1px solid #ccc;
}
#spf_lightbox_link:hover {
  background: #444;
}

#spf_lightbox_next > svg,
#spf_lightbox_prev > svg,
#spf_lightbox_close > svg {
  width: 3em;
  height: 3em;
  color: #fff;
}

#spf_lightbox_next:hover > svg,
#spf_lightbox_prev:hover > svg,
#spf_lightbox_close:hover > svg {
  color: #aaaaaa;
}

#spf_lightbox_next {
  position: fixed;
  right: 2em;
  transform: translateY(-50%);
  cursor: pointer;
  bottom: 1em;
}

#spf_lightbox_prev {
  position: fixed;
  transform: translateY(-50%);
  cursor: pointer;
  bottom: 1em;
  right: calc(35% - 5em);
}

#spf_lightbox_close {
  position: fixed;
  top: 2em;
  right: 2em;
  cursor: pointer;
}

@media (orientation:portrait) {
  #spf_lightbox_image_box {
    right: 2em;
    bottom: 16em;
    top: 7em;
  }

  #spf_lightbox_caption {
    top: unset;
    left: 2em;
    width: unset;
    text-align: center;
    bottom: 2em;
    height: 8.8em;
  }

  #spf_lightbox_link {
    bottom: 12em;
    right: 50%;
    translate: 50%;
    width: unset;
    max-width: calc(100% - 11em);
  }

  #spf_lightbox_prev {
    left: 2em;
    right: unset;
    bottom: 9.8em;
  }

  #spf_lightbox_next {
    bottom: 9.8em;
  }
}

@media only screen and (max-width: 768px) {
  .spf_container {
	grid-template-columns: 1fr 1fr;
	padding: 1rem 0;
  }

  .spf_container.spf_size_small {
	grid-template-columns: repeat(3, 1fr);
  }
}

@media only screen and (max-width: 480px) {
  .spf_container {
	grid-template-columns: 1fr;
  }

  .spf_container.spf_size_small {
	grid-template-columns: 1fr 1fr;
  }
}














/* Styles complémentaires pour le feed Instagram (version flat) */

body.light pre
{
	background-color: transparent!important;
}

.spf_container {
	background-color: transparent;
	padding: 0.5rem;
  }
  
  .spf_item {
	background-color: #fff;
	border: 0;
	border-radius: 0;
	overflow: hidden;
  }
  
  .spf_item img {
	display: block;
	width: 100%;
	height: auto;
  }
  
  .spf_caption {
	padding: 0.75rem;
	background-color: #fff;
	border: 0;
	border-radius: 0;
	color: #262626;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.4;
  }
  
  .spf_item::before {
	content: '';
	position: absolute;
	top: 10px;
	right: 10px;
	width: 24px;
	height: 24px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z'/%3E%3C/svg%3E");
	background-size: cover;
	opacity: 0.7;
	z-index: 1;
  }
  
  /* Ajustements pour le responsive design */
  @media screen and (max-width: 768px) {
	.spf_container {
	  padding: 0.25rem;
	}
	
	.spf_caption {
	  font-size: 12px;
	  padding: 0.5rem;
	}
	
	.spf_item::before {
	  width: 20px;
	  height: 20px;
	  top: 8px;
	  right: 8px;
	}
  }
  
  @media screen and (max-width: 480px) {
	.spf_container {
	  padding: 0.125rem;
	}
	
	.spf_caption {
	  font-size: 11px;
	  padding: 0.375rem;
	}
	
	.spf_item::before {
	  width: 16px;
	  height: 16px;
	  top: 6px;
	  right: 6px;
	}
  }