/* style.css */

/*──────────────────────────────────────────────────────────
  RESET & FULL-VIEWPORT SETUP
──────────────────────────────────────────────────────────*/

.carousel {
  #position: fixed;    /* pin to viewport */
  top: 4px;
  left: 0;
  width: 100vw;       /* full width */
  height: 100vh;      /* full height */
  margin: 0;
  #overflow: hidden;
  background: #2b2b2b;
  #z-index: 9999;
}

/*──────────────────────────────────────────────────────────
  VARIABLES & BREAKPOINTS
──────────────────────────────────────────────────────────*/
:root {
  --control-size:    50px;
  --control-font:    28px;
  --timeout-bar-h:    5px;
  --counter-bar-h:    100px;
  --text-font-size:  16px;
  --left-position: 55%
}
@media (max-width: 768px) {
  :root {
    --control-size:    44px;
    --control-font:    24px;
    --timeout-bar-h:    4px;
    --counter-bar-h:    6px;
    --text-font-size:  14px;
	--left-position: 55%
  }
}
@media (max-width: 480px) {
  :root {
    --control-size:    36px;
    --control-font:    20px;
    --timeout-bar-h:    3px;
    --counter-bar-h:    4px;
    --text-font-size:  12px;
	--left-position: 55%
  }
}

/*──────────────────────────────────────────────────────────
  TOP TIMEOUT BAR
──────────────────────────────────────────────────────────*/
.timeout-bar {
  #position: absolute;
  position: relative;
  top: 0;
  left: 0;
  height: var(--timeout-bar-h);
  width: 20%;
  background: #d36e10;
  z-index: 10;
  pointer-events: none;
}

/*──────────────────────────────────────────────────────────
  IMAGE STAGE (FULL COVER)
──────────────────────────────────────────────────────────*/
.carousel-images {
 # position: absolute;
  width: 100%;
  height: 100%;
}
.carousel-images img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  #object-fit: cover;
  #object-fit: contain;
  #object-fit: inherit;
  opacity: 0;
  /* remove any scale transform 
  transform: none;
  /* only fade opacity */
  transition: opacity 500ms ease-in-out;
}

.carousel-images img.active {
  opacity: 1;
  /*transform: scale(1.02);*/
  transform: translateZ(0) scale(1);

  transition: opacity 500ms ease-in-out, transform 500ms ease-in-out;
}
/*──────────────────────────────────────────────────────────
  CONTROLS & SMALL COUNTER BAR
──────────────────────────────────────────────────────────*/
.controls {
  position: absolute;
  bottom: calc(var(--counter-bar-h) + 26px + env(safe-area-inset-bottom));
  left: 70%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6%;
  padding: 0 16px;
  #z-index: 120;
  box-sizing: border-box;
 # max-width: 100%;
 width: calc(100% - var(--left-position) - 2%);
}

/* Prev/Next buttons */
.controls button {
  width: var(--control-size);
  height: var(--control-size);
  background: transparent;
  border: 2px solid rgba(255,255,255,0.8);
  border-radius: 50%;
  color: #fff;
  font-size: var(--control-font);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 200ms ease,
              border-color 200ms ease,
              transform 120ms ease;
}
.controls button:hover {
  background: rgba(255,255,255,0.1);
  border-color: #fff;
}
.controls button:active {
  transform: scale(0.95);
}

/* Image counter text */
.counter-display {
  color: #fff;
  #background: rgba(0,0,0,0.6);
  background: rgba(40, 58, 90, 0.9);
  font-family: sans-serif;
  font-weight: 600;
  font-size: var(--text-font-size);
  padding: 4px 10px;
  border-radius: 8px;
  user-select: none;
  min-width: 70px;
  text-align: center;
}

/* Small counter‐bar next to Next */
.controls .counter-bar.small {
  width: 280px;
  height: 3px;
  background: rgba(255,255,255,0.6);
  border-radius: 20px;
  overflow: hidden;
  margin-left: 8px;
}
.controls .counter-bar.small .counter-progress {
  height: 100%;
  width: 0%;
  background: #e37f25;
  transition: width 350ms ease;
}

/*──────────────────────────────────────────────────────────
  RESPONSIVE TWEAKS
──────────────────────────────────────────────────────────*/
/* Tablet / small desktop */
@media (max-width: 768px) {
	
.carousel {
  height: 30vh;      /* full height */
}
	.carousel-images img {
		object-fit: contain;
	}
	
  .controls {
    bottom: calc(var(--counter-bar-h) + 2px + env(safe-area-inset-bottom));
    width: 90%;
    justify-content: space-between;
    padding: 0 12px;
    gap: 10px;
	left: 45%;
  }
  .controls button {
    width: var(--control-size);
    height: var(--control-size);
    font-size: var(--control-font);
  }
  .counter-display {
    font-size: var(--text-font-size);
    padding: 3px 8px;
    min-width: 40px;
  }
  .controls .counter-bar.small {
    width: 46px;
    height: 4px;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  .controls {
    bottom: calc(var(--counter-bar-h) + 8px + env(safe-area-inset-bottom));
    #width: 95%;
    gap: 2px;
    padding: 0 8px;
	#left: 45%;
  }
  .controls button {
    width: var(--control-size);
    height: var(--control-size);
    font-size: var(--control-font);
  }
  .counter-display {
    font-size: var(--text-font-size);
    padding: 2px 6px;
    min-width: 32px;
  }
  .controls .counter-bar.small {
    width: 32px;
    height: 3px;
  }
}
