/* ===============================
   GLOBAL VARIABLES
=================================*/
:root {
  --purple: #6504b5;
  --bg: #f8f8f8;
  --overlay: rgba(0, 0, 0, 0.85);
  --transition-fast: 0.15s ease;
  --transition-mid: 0.35s ease;
  --transition-slow: 0.5s ease;
}

/* ===============================
   BODY
=================================*/
body {
  font-family: "Nunito", "Montserrat", sans-serif;
  background: #EEEDF1;
  color: #333;
  margin: 0;
  letter-spacing: 0.03rem;
  font-weight: 100;
  line-height: 1.4em;
}

/* ===============================
   GALLERY CONTAINER
=================================*/
.gallery-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6vh 0;
  background: var(--bg);
}

/* ===============================
   GALLERY LAYOUT
=================================*/
.gallery {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 24px;
  background: white;
  padding: 24px;
  border-radius: 16px;
  max-width: 950px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  justify-content: center;
}

/* ===============================
   MAIN IMAGE
=================================*/
.main-image {
  width: 600px;
  max-width: 60vw;
  border-radius: 12px;
  overflow: hidden;
}

.main-image img {
  width: 100%;
  border-radius: 12px;
  aspect-ratio: 16/10;
  object-fit: cover;
  object-position: top;
  /* 👇 make opacity animatable & a bit slower */
  opacity: 1;
  transition: opacity 0.35s ease-in-out,
              transform 0.35s ease,
              filter 0.35s ease;
  cursor: pointer;
}

/* fade helpers (only affect images, not the whole overlay box) */
.main-image img.fade-out,
.overlay img.fade-out {
  opacity: 0;
}

.main-image img.fade-in,
.overlay img.fade-in {
  opacity: 1;
}

/* ✔ Bounce on click */
@keyframes mainImageBounceUpDownSmooth {
  0%   { transform: translateY(0) scale(1); }
  22%  { transform: translateY(-10px) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}

.main-image img.clicked {
  animation: mainImageBounceUpDownSmooth 0.65s cubic-bezier(0.3, 0.75, 0.35, 1);
}

.main-image img:hover {
  filter: brightness(1.15);
  transform: scale(1.07);
}

/* ===============================
   THUMBNAILS
=================================*/
.thumbs {
  width: 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thumbs img {
  width: 100%;
  height: 90px;
  border-radius: 10px;
  object-fit: cover;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.25s ease, border 0.25s ease;
}

.thumbs img:hover {
  transform: scale(1.05);
}

@keyframes thumbFadeInPurple {
  0% {
    border-color: transparent;
  }
  100% {
    border-color: var(--purple);
  }
}

.thumbs img.active {
  border-color: var(--purple);
  animation: thumbFadeInPurple 0.65s ease-in-out;
}

/* Mobile thumbnails horizontal */
@media (max-width: 700px) {
  .gallery {
    flex-direction: column;
    gap: 18px;
  }

  .main-image {
    width: 100%;
    max-width: 100%;
  }

  .thumbs {
    flex-direction: row;
    width: 100%;
    justify-content: center;
    gap: 10px;
  }

  .thumbs img {
    width: 70px;
    height: 70px;
  }
}

/* ===============================
   THUMBNAIL SCROLL ARROWS
=================================*/
.thumb-switch {
  background: white;
  border: 3px solid var(--purple);
  color: var(--purple);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  align-self: center;
  transition: transform 0.25s ease, background 0.25s ease;
}

.thumb-switch:hover {
  background: var(--purple);
  color: white;
  transform: scale(1.12);
}

.thumb-left::before { content: "↑"; }
.thumb-right::before { content: "↓"; }

@media (max-width: 700px) {
  .thumb-switch {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .thumb-left::before { content: "←"; }
  .thumb-right::before { content: "→"; }
}

/* ===============================
   LIGHTBOX OVERLAY
=================================*/
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 100;
  opacity: 0;
  transition: opacity var(--transition-mid), backdrop-filter var(--transition-mid);
}

.overlay.active {
  display: flex;
  opacity: 1;
  animation: overlayFadeIn var(--transition-mid) forwards;
}

@keyframes overlayFadeIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to   { opacity: 1; backdrop-filter: blur(4px); }
}

@keyframes overlayFadeOut {
  from { opacity: 1; backdrop-filter: blur(4px); }
  to   { opacity: 0; backdrop-filter: blur(0px); }
}

.overlay.fade-out {
  animation: overlayFadeOut var(--transition-mid) forwards;
}

/* Lightbox main image */
.overlay img {
  width: 65%;
  max-width: 850px;
  border-radius: 12px;
  aspect-ratio: 16/10;
  object-fit: cover;
  object-position: top;
  opacity: 1;
  /* same fade as main-image img */
  transition: opacity 0.35s ease-in-out;
}

/* ===============================
   PAW ARROWS
=================================*/
.paw {
  background: none;
  border: none;
  cursor: pointer;
  width: clamp(50px, 7vw, 74px);
  height: clamp(50px, 7vw, 74px);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  opacity: 1;
  transition: opacity var(--transition-mid), transform var(--transition-mid);
  z-index: 10;
}

.paw.left { left: clamp(2%, 5vw, 6%); }
.paw.right { right: clamp(2%, 5vw, 6%); }

.paw img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: filter 0.35s ease-in-out;
}

.paw:hover img {
  filter: brightness(2);
}

/* Bounce animations */
@keyframes pawBounceBase {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.80); }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.paw.clicked img {
  animation: pawBounceBase 0.65s cubic-bezier(0.25, 0.75, 0.35, 1);
}

@keyframes pawBounceLeft {
  0%   { transform: scale(1) rotate(0deg); }
  35%  { transform: scale(0.80) rotate(-10deg); }
  70%  { transform: scale(1.05) rotate(8deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.paw.left.clicked img {
  animation: pawBounceLeft 0.65s cubic-bezier(0.25, 0.75, 0.35, 1);
}

@keyframes pawBounceRight {
  0%   { transform: scale(1) rotate(0deg); }
  35%  { transform: scale(0.80) rotate(10deg); }
  70%  { transform: scale(1.05) rotate(-8deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.paw.right.clicked img {
  animation: pawBounceRight 0.65s cubic-bezier(0.25, 0.75, 0.35, 1);
}

/* Hide paws when overlay inactive */
.overlay:not(.active) .paw {
  opacity: 0;
  pointer-events: none;
}

/* Mobile paw size */
@media (max-width: 600px) {
  .paw {
    width: clamp(44px, 12vw, 60px);
    height: clamp(44px, 12vw, 60px);
  }
  .paw.left  { left: clamp(3%, 6vw, 8%); }
  .paw.right { right: clamp(3%, 6vw, 8%); }
}

/* ===============================
   DOTS
=================================*/
.dots {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  transition: background 0.25s ease;
}

.dot.active {
  background: var(--purple);
}

/* ===============================
   CLOSE BUTTON
=================================*/
.close-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  background: transparent;
  color: white;
  border: none;
  font-size: 32px;
  font-weight: 600;
  cursor: pointer;
  z-index: 101;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.close-btn:hover {
  opacity: 0.65;
}

.close-btn.clicked {
  animation: xClickBounce 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.overlay:not(.active) .close-btn {
  opacity: 0;
  pointer-events: none;
}

@keyframes xClickBounce {
  0%   { transform: scale(1) translateY(0) rotate(0deg); }
  40%  { transform: scale(0.85) translateY(15px) rotate(12deg); }
  70%  { transform: scale(1.1) translateY(-6px) rotate(-8deg); }
  100% { transform: scale(1) translateY(0) rotate(0deg); }
}

/* ===============================
   DOCUMENTATION STYLES
=================================*/
main {
  padding: 5vh 12vw;
}

section {
  background-color: #FFFFFF;
  padding: 2em 5em;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 40px;
}

@media (max-width: 1024px) {
  section { padding: 2em 3em; }
}

@media (max-width: 600px) {
  section { padding: 1.2em 2em; }
}

h1.rules-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.08rem;
  margin-top: 40px;
  margin-bottom: 20px;
  color: #4a148c;
  border-bottom: 3px solid #d1c4e9;
  padding-bottom: 8px;
  text-transform: uppercase;
  line-height: 1.3em;
}

a {
  color: #6a1b9a;
  text-decoration: none;
  font-weight: 500;
  max-width: 100%;
  display: inline-block;
}

.object-title {
  font-family: 'Poppins', sans-serif;
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: #6a1b9a;
  margin-top: 18px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.divider {
  border: none;
  border-top: 3px dashed #d1c4e9;
  width: 80%;
  margin: 40px auto;
}

.object-desc,
.bold {
  color: #a380b8;
  font-weight: 1000;
}

.bold {
  font-size: 1.1rem;
}

.final-image {
  width: 100%;
  max-width: 650px;
  display: block;
  margin: 20px auto; 
  border-radius: 12px;
}
