/* Responsive slideshow styles for Defining Dishes */

.responsive-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
  text-align: center;
}

.mobile-slideshow-wrapper {
  padding: 0;
  margin: 0 auto;
  line-height: 0;
  font-size: 0;
  position: relative;
  max-width: 100%;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.defdozen-slideshow {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  height: auto;
  line-height: 0;
  font-size: 0;
  min-height: 200px;
  display: inline-block;
  text-align: center;
}

.slideshow-images-container {
  position: relative;
  display: inline-block;
  margin: 0 auto;
  max-width: 100%;
  min-height: 200px;
}

/* Default display for first image only */
.slideshow-images-container img {
  display: none;
}

.slideshow-images-container img:first-child {
  display: block;
}

/* Cycle2 specific styles */
.cycle-slide {
  display: none;
}

.cycle-slide.cycle-slide-active {
  display: block !important;
}

.defdozen-slideshow img,
.responsive-img {
  width: auto;
  height: auto;
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  margin: 0 auto;
  vertical-align: middle;
  padding: 0;
  border: 0;
}

/* Navigation arrows - making them more visible */
.cycle-prev,
.cycle-next {
  width: 34px;
  height: 34px;
  z-index: 1000 !important;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.5) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
  user-select: none;
  -webkit-user-select: none;
  color: #222 !important;
  border: none;
  border-radius: 4px;
}

.nav-arrow {
  color: white;
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  pointer-events: none;
}

/* Desktop-specific adjustments */
@media screen and (min-width: 769px) {
  .homeArticle {
    /* height: 100vh;
    min-height: 100vh;
    max-height: 100vh; */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
  }

  .defdozen-slideshow,
  .slideshow-images-container,
  .responsive-container {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .defdozen-slideshow img,
  .responsive-img {
    width: auto !important;
    height: auto !important;
    max-width: 100vw !important;
    max-height: 100% !important;
    object-fit: contain;
    margin: 0 !important;
    display: block;
  }

  /* Add space around the slideshow to ensure buttons are visible */
  .slideshow-images-container {
    margin: 0 auto;
    max-width: calc(100% - 120px);
  }
}

/* Mobile-specific adjustments */
@media screen and (max-width: 768px) {
  body {
    -webkit-overflow-scrolling: touch;
  }

  .homeArticle {
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
  }

  .defdozen-slideshow,
  .slideshow-images-container,
  .responsive-container {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .defdozen-slideshow img,
  .responsive-img {
    width: auto !important;
    height: auto !important;
    max-width: 100vw !important;
    max-height: 100% !important;
    object-fit: contain;
    margin: 0 !important;
    display: block;
  }

  .responsive-container {
    padding: 0;
    margin: 0;
  }

  .mobile-slideshow-wrapper {
    font-size: 0;
  }

  #defdozen-content {
    margin: 0;
    padding: 0;
  }

  .homeArticle {
    padding: 0;
    margin: 0;
  }

  section.responsive-container {
    margin: 0;
    padding: 0;
    font-size: 0;
    line-height: 0;
  }
}

/* Lighter backgrounds for navigation and pause/play buttons */
.cycle-prev:active,
.cycle-next:active {
  background-color: rgba(255, 255, 255, 0.9) !important;
}

#slideshow-toggle {
  background: rgba(255, 255, 255, 0.5) !important;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  outline: none;
  z-index: 1100;
}

#slideshow-toggle:active {
  background: rgba(255, 255, 255, 0.9) !important;
}

#slideshow-toggle-icon,
.cycle-prev .nav-arrow,
.cycle-next .nav-arrow {
  color: #222 !important;
}

/* Show thumbnails on desktop beside the image */
@media screen and (min-width: 900px) {
  .responsive-container {
    max-width: 1200px;
  }

  .defdozen-slideshow-row {
    display: block;
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    border: 5px solid #e4bf8e;
    height: auto;
    min-height: 400px;
  }

  .slideshow-images-container {
    width: 730px;
    margin-right: 117px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .slideshow-thumbnails {
    display: flex !important;
    flex-direction: column;
    width: 115px;
    gap: 7px;
    overflow-y: hidden;
    padding: 10px;
    background-color: #e4bf8e;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    box-sizing: border-box;
  }

  .slideshow-controls {
    position: static;
    margin-top: 10px;
    background-color: transparent;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    z-index: 1001;
    width: 730px !important;
    max-width: 730px;
    margin-left: 0;
    margin-right: auto;
    flex-wrap: nowrap;
    gap: 15px;
    clear: both;
  }

  .slideshow-thumbnails .thumbnail-img {
    width: 100px;
    height: 45px;
    object-fit: cover;
    cursor: pointer;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .slideshow-thumbnails .thumbnail-img.active {
    border: 3px solid #00c853;
    box-shadow: 0 0 12px 3px rgba(0, 200, 83, 0.6);
  }

  .slideshow-thumbnails .thumbnail-img:hover {
    border-color: #005a9e;
  }

  .thumbnail-item-wrapper {
    position: relative;
    width: 100px;
    height: 45px;
    display: block;
  }

  .thumbnail-overlay-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.35);
    padding: 2px;
    box-sizing: border-box;
    pointer-events: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cycle-prev,
  .cycle-next {
    z-index: 1001;
  }

  #slideshow-toggle {
    z-index: 1100;
  }
}

/* Hide thumbnails on mobile */
@media screen and (max-width: 899px) {
  .slideshow-thumbnails {
    display: none !important;
  }

  .defdozen-slideshow-row {
    flex-direction: column;
  }

  .slideshow-controls {
    order: 2;
    position: static;
    transform: none;
    margin-top: 10px;
  }
}

.defdozen-slideshow-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

/* Global slideshow controls styling */
.slideshow-controls {
  position: static !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  background-color: transparent;
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  padding: 10px 5px;
  z-index: 1001;
  margin-top: 10px;
  width: 100% !important;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  flex-wrap: nowrap;
  gap: 15px;
}

.navigation-control {
  display: flex;
  align-items: center;
  gap: 0px;
  justify-content: center;
  align-items: center;
  background-color: #e8f4f8;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #d1e7ed;
}

.timeout-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #666;
  margin: 0 10px;
  background-color: #f8f0e8;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #ede4d1;
}

.timeout-control label,
.navigation-control label {
  font-size: 14px;
  font-weight: normal;
  white-space: nowrap;
  display: flex;
  align-items: center;
  height: 30px;
  line-height: 1;
  margin-bottom: 2px;
}

.speed-btn {
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #333;
  transition: background-color 0.2s ease;
  outline: none;
}

.speed-btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

.speed-btn:active {
  background: rgba(255, 255, 255, 1);
  transform: scale(0.95);
}

#timeout-display {
  font-weight: bold;
  color: #333;
  min-width: 25px;
  text-align: center;
}

/* When inside slideshow controls, use static positioning */
.slideshow-controls .cycle-prev,
.slideshow-controls .cycle-next,
.slideshow-controls #slideshow-toggle {
  position: static !important;
  transform: none !important;
  margin: 0 10px;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
}

@media screen and (max-width: 500px) {
  .timeout-control {
    display: none !important;
  }

  .slideshow-controls {
    justify-content: center !important;
  }
}

@media screen and (max-width: 400px) {
  .slideshow-controls {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 280px;
  }
}
