/* ===== RESET ===== */
*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

html,body{
  background:#0b0b0b;
  color:#f3f3f3;
  font-family: "Source Sans 3", Inter, system-ui, sans-serif;
}

@supports (-webkit-touch-callout: none) {
  .caption h2{
    letter-spacing:0.08em;
    line-height:1.45;
  }
}
.image-wrap img{
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
}
#global-lang{
  position:fixed;
  top:14px;
  right:20px;
  z-index:999;
  display:flex;
  gap:6px;
  background:rgba(0,0,0,.55);
  border:1px solid rgba(201,164,95,.5);
  border-radius:20px;
  padding:5px;
  backdrop-filter:blur(6px);

  transition:opacity .5s ease, transform .5s ease;
}

#global-lang.is-hidden{
  opacity:0;
  transform:translateY(-20px);
  pointer-events:none;
}

#global-lang button{
  border:none;
  background:none;
  color:#c9a45f;
  font-size:12px;
  padding:6px 12px;
  border-radius:14px;
  cursor:pointer;
  opacity:.6;
}

#global-lang button.active{
  background:#c9a45f;
  color:#000;
  opacity:1;
}
/* ===== SECTION ===== */
.museum-section{
  position:relative;
  height:100svh;      /* chuẩn iOS */
  min-height:100vh;  /* fallback */
  overflow:hidden;
}

/* ===== IMAGE ===== */
.image-wrap{
  position:absolute;
  inset:0;
  background:#111; /* nền đệm tránh flash xám */
}

.image-wrap img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;

  /* iOS Safari GPU fix */
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}

/* desktop / mobile */
.img-desktop{ display:block; }
.img-mobile{ display:none; }

@media (max-width:768px){
  .img-desktop{ display:none; }
  .img-mobile{ display:block; }
}

/* ===== TEXT ===== */
.caption{
  position:absolute;
  left:7%;
  bottom:7%;
  max-width:420px;
  padding:22px 26px;
  background:rgba(8,6,4,.55);
  backdrop-filter:blur(4px);
  opacity:0;
  /*  max-height: 35vh;   */      /* GIỚI HẠN CHIỀU CAO */
  /* overflow-y: auto;  */       /* BẬT CUỘN DỌC */
 /*  overflow-x: hidden; */
 /*  padding-right: 30px;
  scrollbar-width: thin;        
  scrollbar-color: rgba(201,164,95,.6) transparent; */
}

.caption::before{
  content:"";
  position:absolute;
  top:12%;
  bottom:12%;
  left:0;
  width:3px;
  background:#c9a45f;
  opacity:0;
  transition:.3s;
}

.museum-section.is-active .caption::before{
  opacity:1;
}

.caption h2{
  margin-bottom:8px;
  font-size:20px;
  color:#e6d6a2;
}

.caption p{
  font-size:15px;
  line-height:1.6;
  text-align:justify;
}

@media (max-width:768px){
  .caption{
    max-width:92%;
    left:4%;
    bottom:6%;
	 -webkit-overflow-scrolling: touch; /* iOS mượt */
  }
  .caption p{
    font-size:14.5px;
  }
}
.caption-content{
  max-height:35vh;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:30px;

  scrollbar-width: thin;
  scrollbar-color: rgba(201,164,95,.6) transparent;
}

/* Chrome / Cốc Cốc */
.caption-content::-webkit-scrollbar{
  width:6px;
}
.caption-content::-webkit-scrollbar-thumb{
  background:rgba(201,164,95,.55);
  border-radius:6px;
}
.caption-content::-webkit-scrollbar-thumb:hover{
  background:rgba(201,164,95,.85);
}
@media (max-width:768px){
  .caption-content{
    max-height:45vh;
    -webkit-overflow-scrolling: touch;
  }
}


/* ===== CAPTION CLOSE BUTTON ===== */
.caption-close{
  position:absolute;
  bottom:10px;
  right:12px;

  width:28px;
  height:28px;
  border-radius:50%;
  border:1px solid rgba(201,164,95,.45);

  background:rgba(0,0,0,.9);
  color:#FA891A;
  font-size:14px;
  line-height:1;

  display:flex;
  align-items:center;
  justify-content:center;

  cursor:pointer;
  opacity:.75;
  transition:.25s ease;
}

.caption-close:hover{
  opacity:1;
  background:rgba(201,164,95,.18);
}
.caption.is-hidden{
  opacity:0 !important;
  pointer-events:none;
  transform:translateY(10px);
  transition:.35s ease;
}

.video-wrap{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    radial-gradient(circle at center,
      rgba(201,164,95,.18),
      rgba(0,0,0,.9) 70%);
}

.yt-player{
  width:78%;
  aspect-ratio:16/9;
  border-radius:8px;
  overflow:hidden;
  box-shadow:
    0 30px 70px rgba(0,0,0,.7),
    0 0 0 1px rgba(201,164,95,.35);
}

/* mobile */
@media (max-width:768px){
  .yt-player{
    width:94%;
  }
}
.sound-toggle{
  position:absolute;
  right:6%;
  bottom:18%;
  z-index:5;

  width:44px;
  height:44px;
  border-radius:50%;
  border:1px solid rgba(201,164,95,.6);
  background:rgba(0,0,0,.55);
  color:#e6d6a2;
  font-size:18px;

  display:flex;
  align-items:center;
  justify-content:center;

  cursor:pointer;
  backdrop-filter:blur(4px);
}

.sound-toggle:hover{
  background:rgba(201,164,95,.15);
}

@media (max-width:768px){
  .sound-toggle{
    right:5%;
    bottom:22%;
    width:42px;
    height:42px;
  }
}
