/* dfcustominstagram - scoped styles */
 
/* Section */
.dfinsta-section {
  padding: 50px 20px;
  background: #f5f0e1;
  clear: both;
  width: 100%;
  float: none;
  box-sizing: border-box;
}
 
.dfinsta-inner {
  max-width: 1200px;
  margin: 0 auto;
  clear: both;
  width: 100%;
  float: none;
}
 
/* Title */
.dfinsta-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 26px;
  font-weight: 700;
  color: #333;
  margin-bottom: 30px;
  text-align: center;
}
 
.dfinsta-icon {
  width: 28px;
  height: 28px;
  color: #c9a84c;
}
 
/* Grid */
.dfinsta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
 
/* Item */
.dfinsta-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
}
 
.dfinsta-thumb-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}
 
.dfinsta-thumb-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
 
.dfinsta-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}
 
.dfinsta-thumb-wrap:hover .dfinsta-thumb {
  transform: scale(1.08);
}
 
/* Hover overlay */
.dfinsta-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
 
.dfinsta-thumb-wrap:hover .dfinsta-thumb-overlay {
  opacity: 1;
}
 
/* ========== MODAL ========== */
.dfinsta-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
 
.dfinsta-modal.open {
  display: flex;
}
 
.dfinsta-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  cursor: pointer;
}
 
/* Modal dialog — wide enough for Instagram embed + arrows on sides */
.dfinsta-modal-dialog {
  position: relative;
  z-index: 10000;
  width: 100%;
  max-width: 1000px;
  margin: 20px auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
 
/* Modal content box */
.dfinsta-modal-content {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}
 
/* Embed wrapper */
.dfinsta-embed-wrap {
  width: 100%;
  min-height: 500px;
  display: block;
  padding: 0;
}
 
.dfinsta-embed-wrap iframe {
  width: 100% !important;
  min-width: 100% !important;
  border: none !important;
}

.dfinsta-embed-wrap blockquote.instagram-media {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
}
 
.dfinsta-loading {
  color: #999;
  font-size: 14px;
  padding: 60px 40px;
  text-align: center;
  width: 100%;
}
 
/* Close button — top right corner of dialog */
.dfinsta-modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10002;
}
 
.dfinsta-modal-close:hover {
  background: rgba(255,255,255,0.25);
}
 
/* Arrows — positioned outside the content box on left/right */
.dfinsta-modal-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  z-index: 10002;
}
 
.dfinsta-modal-arrow:hover {
  background: rgba(201,168,76,0.85);
  border-color: #c9a84c;
}
 
.dfinsta-modal-arrow:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}
 
.dfinsta-modal-prev {
  left: 20px;
}
 
.dfinsta-modal-next {
  right: 20px;
}
 
/* Counter */
.dfinsta-modal-counter {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  margin-top: 12px;
  text-align: center;
  letter-spacing: 0.5px;
}
 
/* Responsive */
@media (max-width: 768px) {
  .dfinsta-grid {
    grid-template-columns: repeat(3, 1fr);
  }
 
  .dfinsta-modal-dialog {
    max-width: 95vw;
    margin: 10px auto;
  }
 
  .dfinsta-modal-prev {
    left: 8px;
  }
 
  .dfinsta-modal-next {
    right: 8px;
  }
}
 
@media (max-width: 480px) {
  .dfinsta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
 
  .dfinsta-modal-arrow {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }
}