.card-collection {
  display: flex;
  flex-direction: row;
  gap: 1rem; /* space between cards */
  height: 100dvh;
  width: 100%;
  overflow-x: auto; /* scroll horizontally if needed */
  overflow-y: hidden;
  padding: 1rem;
  box-sizing: border-box;

  pointer-events: auto;

  z-index: var(--z-index-99);
}

.card-collection::-webkit-scrollbar {
    height: 8px;
}

.card-collection::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.75);
    border-radius: var(--radius-small);
}

.card {
  position: relative; /* so absolute children stay inside */
  flex: 0 0 auto; /* fixed width in flex layout */
  width: clamp(150px, 30vw, 300px);
  height: clamp(200px, 40vw, 400px);
  border-radius: var(--radius-normal);
  box-shadow: 0 10px 50px 10px rgba(255, 255, 255, 0.3);
  background: rgb(241, 241, 241);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;

  cursor: pointer;
}

.card:hover {
  box-shadow: 0 0 25px 10px rgba(230, 230, 230, 0.5);
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.301);
  border: 1px solid rgba(255, 255, 255, 0.3);
}



.card .card-content {
  position: absolute;
  inset: 0; /* replaces top, left, width, height */
  z-index: 1;
  transition: opacity 0.8s cubic-bezier(0, 0.02, 0, 1);
  opacity: var(--opacity, 1);
  font-family: "Orelo-sw-db", serif;
}

.card .card-content::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3),
    rgba(0, 0, 0, 0) 30%,
    rgba(0, 0, 0, 0) 50%,
    rgba(0, 0, 0, 0.5)
  );
}


.card .card-title {
  position: absolute;
  z-index: 1;
  color: #ffffff;
  bottom: 20px;
  left: 20px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.35); /* พื้นหลังโปร่งใส */
  backdrop-filter: blur(6px); /* เบลอด้านหลัง */
  border-radius: 12px; /* ขอบมน */
  transition: all 0.4s ease;
  font-size: clamp(20px, 3vw, 30px);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 4px 8px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.card .card-title:hover {
  transform: translateY(-4px);
  background: rgba(0, 0, 0, 0.5);
  text-shadow: 0 0 12px rgb(255, 255, 255), 0 6px 12px rgba(0, 0, 0, 0.4);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.card:active {
  box-shadow: 0 0 25px 10px rgba(230, 230, 230, 0.5);
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.301);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
  justify-self: center;

  overflow: hidden;

  z-index: 10;
  height: 40rem;
  width: 100%;
  pointer-events: none;

  border: 4px solid rgba(255, 255, 255, 0.308);
  backdrop-filter: blur(20px);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
  animation: slideUpFadeIn 0.8s ease-out;
  box-sizing: border-box;
}

.card-section .title {
  padding: 8px 16px;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: bold;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.75); /* สีดำโปร่งใส */
  border-radius: 8px;
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.15),
    0 0 15px rgba(255, 255, 255, 0.25), 0 0 25px rgba(255, 255, 255, 0.15);
  text-shadow: 0 0 3px #ffffff, 0 0 6px rgba(255, 255, 255, 0.6),
    0 0 12px rgba(255, 255, 255, 0.4);
  transition: all 0.3s ease;
}

.card-section .title:hover, .card-section .title:active {
  background: rgba(0, 0, 0, 0.85); /* สีดำเข้มขึ้นตอน hover */
  transform: translateX(-50%) translateY(-3px);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.25),
    0 0 20px rgba(255, 255, 255, 0.4), 0 0 40px rgba(255, 255, 255, 0.25);
  text-shadow: 0 0 5px #ffffff, 0 0 10px rgba(255, 255, 255, 0.7),
    0 0 20px rgba(255, 255, 255, 0.5);
}

.HTML-CSS  {
  border: none;
  background-color: transparent;
  color: #333; /* สีตัวอักษรเทาเข้ม ดูสุภาพ */
  padding: 10px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px; /* มุมโค้งมน */
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: inset 0 0 0 2px #7c7c7c; /* กรอบเส้นบาง ๆ แบบใน */
}

.HTML-CSS button {
  border: none;
  background-color: transparent;
  color: #333; /* สีตัวอักษรเทาเข้ม ดูสุภาพ */
  padding: 10px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px; /* มุมโค้งมน */
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  
}

.HTML-CSS button:hover {
  background-color: #ffffff; 
  color: #111; 
  box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
  transform: scale(1.05);
}
.HTML-CSS button:focus,
.HTML-CSS button:active {
  outline: none;
  background-color: #ffcc00;
  color: #111;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15); 
}

/* เบสสำหรับ container */
.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem;
  box-sizing: border-box;
}

/* media-wrap ควบคุมกรอบและอัตราส่วนของรูป */
.media-wrap {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  height: auto;  /* หรือไม่กำหนด height */
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  margin-top: 1rem;
  background: #f3f3f3;
  padding: 3rem;
}


.content.center-self img {
  width: 100%;
  height: auto; /* ให้ความสูงปรับตามสัดส่วน */
  object-fit: cover;
  object-position: center;
  border-radius: 15px;
  transition: transform 0.35s ease, filter 0.35s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2); /* เพิ่มเงาให้ดูนุ่ม */
}

.content.center-self img:hover {
  transform: scale(1.05); /* ขยายเล็กน้อยตอน hover */
  filter: brightness(1.05); /* ทำให้สว่างขึ้นนิดๆ */
}

img.responsive-cover {
  width: 100%;           
  height: auto;        
  object-fit: cover;     
  object-position: center; 
  border-radius: 10px;   
  transition: transform 0.35s ease, filter 0.35s ease; 
  max-width: 100%;       
  display: block;        
}



@media (max-width: 600px) {
  .media-wrap {
    border-radius: 10px;
  }
  .content { padding: 0.9rem; }
}

/* Large screens — ใส่ margin ข้างและขนาดเล็กเมื่อมีข้อความด้านข้าง */




@media (max-width: 1024px) {
    .card-section {
        min-height: 25rem;   /* ให้มีขั้นต่ำ แต่ขยายตามเนื้อหาได้ */
        height: auto;        /* ปรับความสูงอัตโนมัติ */
    }
}

@media (max-width: 768px) {
    .card-section {
        min-height: 20rem;
        height: auto;
    }
}

@media (max-width: 480px) {
    .card-section {
        min-height: 10rem;
        height: auto;
    }
}

@media (max-width: 425px) {
    .card-section {
        min-height: 8rem;
        height: auto;
    }
}
@media (max-width: 480px) {
    .card-section h1 {
        font-size: clamp(1.5rem, 6vw, 2.2rem); 
        line-height: 1.2;                      
        word-break: break-word;                
        hyphens: auto;                         
        overflow-wrap: break-word;             
        text-align: center;                    
    }
}



@media (max-width: 1440px) {
    section {
        height: 50dvh;
    }
}

@media (max-width: 1024px) {
    section {
        height: 40dvh;
    }
}

@media (max-width: 768px) {
    section {
        height: 35dvh;
    }
}

@media (max-width: 480px) {
    section {
        height: 30dvh;
    }
}



