
* {
  box-sizing: border-box;
}

h1 ,h2 ,h3 , h4 ,p {
    color: #ffffff;
}

body{
    background-color: rgb(21, 28, 26);
    overflow-x: hidden;

}

h1{
    color: #97d457;
    margin: 0;
    font-size: 3.5rem;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

h2{
    margin: 5px;
    color: #cfd384;
    font-weight: 300;
    font-family: sarabun;
}

h3{
    color: #c9d39e;
    margin: 0;
    letter-spacing: 1.5px;
    font-weight: 500;
    font-size: 1.5rem;
    font-family: kanit;
}

main{
    position: relative;
}
/* หัว ================================= */

.top {
    position: relative; 
    padding: 4rem 2rem;
    text-align: center;
    margin: auto;
    border-width: 3px;
    max-width: 800px;
}

.top .bg-img {
  position: absolute;     /* วางทับ */
  top: 80%;
  left: 80%;
  transform: translate(-50%, -50%); /* จัดให้อยู่กลาง */
  width: 90%;             /* ปรับขนาดตามใจ */
  opacity: 0.2;           /* ทำให้จางๆ */
  z-index: -1;             /* ดันไปอยู่ข้างหลัง */
}

.top-detail, .top-detail-2{
    color: hsl(107, 61%, 94%);
    padding: 15px;
    border-radius: 1rem;
    margin-top: 10px;
    margin: 2rem, 2rem;
    font-size: 16px;
    font-weight: 200;
    line-height: 30px;
    font-family: sarabun;
    max-width: 800px;
}

.top-detail{
    background-color: #8080549d;
}

.top-detail-2{
    background-color: #4a4a3dc2;
    margin-bottom: 0.67rem;   
}

.social-links-container{
    background-color: #393937c2;
    border-radius: 1rem;
    padding: 6px;
}

.cmsterm-nav a{
  text-decoration: none;
  color: #1a2114;
}

.cmsterm-nav{
  background-color: #d26b16;
  font-family: kanit;
  font-size: 1.5rem;
  font-weight: 600;
  margin: auto;
  margin-top: 12px;
  max-width: fit-content;
  border: 2px solid rgb(0, 0, 0);
  border-radius: 1rem;
  padding: 10px 20px;
  transition: all 0.2s ease-in-out;
}

.cmsterm-nav:hover{
  background-color: #edc557;
  transform: translateY(5px);
}
p{
    margin: 0;
}

@media (max-width: 768px) {
    .top {
        margin: 30px auto; /* ลด margin ตอนจอแคบ */
        padding: 0 35px;    /* เผื่อบีบตัว */
    }
    h1 {
        font-size: 2rem;
    }
    h2 {
        font-size: 1.2rem;
    }
    .top-detail{
        font-size: 15px;
    }
    .interest-title{
        font-size: 2rem; 
    }
}

@media (max-width: 1200px) {
    .top .bg-img{
    display: none;
    }
}

/* interest-selector ===================== */
.interest-selector{
    position: relative; 
    z-index: 3;
    padding: 1rem;
    margin-bottom: 5rem;
    background-color: #c2b740;
    background-image: linear-gradient(#c2b740,#88b850);
}

.interest-title{
    text-align: center;
    font-family: kanit;
    font-size: 2.5rem;
    font-weight: 600;
    color: #075007;
}

.option{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
}

.option a{
  text-decoration: none;
}
.option div{
    flex: 1 1 200px;  
    max-width: 250px; 
    background-color: #f4ffe772;
    border-radius: 1rem;
    margin: 0.45rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    transition: transform 0.2s ease-in-out;
}

.option div:hover{
    cursor: pointer;
    transform: scale(1.04);
    background-color: #f4ffe79a;
}

.option h3{
    color: #5a7412;
    font-family: kanit;
    font-weight: 650;
    font-size: 1.5rem;
    text-align: center;
    line-height: 24px;
    margin: 3px;
    padding: 0;
}
.option p{
    color: #84a95f;
    font-family: kanit;
    font-weight: 500;
    font-size: 1rem;
    text-align: center;
}
.option img{
  width: 100%;
  height: auto;
  max-height: 180px;
  max-width: 200px;
  object-fit: contain;
}

@media (min-width: 1200px) {
   .option img{
      max-height: 300px;
      max-width: 350px;
      margin: 1rem;
   }

    .option div{
      max-width: 350px;
    }
   .interest-title{
    font-size: 4rem;
   }
   .option h3{
    font-size: 2.3rem;
    line-height: 2rem;
   }
   .option p{
    font-size: 1.4rem;
   }
}

.option-painting img{
    border-radius: 50%;
    object-fit: cover;
}

@media (max-width: 500px) {
  .option div{
    height: 200px;
    max-width: 100px;
    padding: 10px;
    margin: 3px;
  }
  .option h3{
    font-size: 19px;
    line-height: 15px;
  }
  .option p {
    font-size: 0.8rem;
        line-height: 15px;
  }
}
/* Cms info-------------------------------------- */
.cms-container{
    position: relative; 
    text-align: center;
    justify-content: center;
    align-items: centers;
    z-index: 2;
}

.cms-container h2{
    font-size: 3rem;
    margin: 0;
    color: #e2562c;
    position: relative;
    z-index: 2;
}

.cms-container h3{
    font-size: 1.4rem;
    font-weight: 400;
    color: #bce395;
    position: relative;
    z-index: 2;
}

.cms-box p{
  margin: 4px;
}

.cms-box h4{
  font-size: 1.2rem;
  color: #49591f;
  font-weight: 600;
  background-color: #e0e6b5;
  padding: 2px;
  margin: 22px 20vw;
}
/* leaf --------------------------------*/
.wrapper {
  position: relative;
}

.image-wrapper{
  position: relative;
  z-index: 2;
}

.leaf {
  position: absolute;
  z-index: -1;
  opacity: 0.3;
  margin: auto;
  user-select: none;       
}

.leaf1{ right: 10px; margin: 0;}
.leaf2{ left: 10px; width: 70%; max-width: 800px; rotate: -40deg;}
.leaf3{ right: 10px; rotate: 20deg; }
.leaf4{ left: 10px; transform: scaleX(-1);}
.leaf5{left: 10px;}
.leaf6{right: 10px; width: 500px; rotate: -20deg;}

@media (max-width: 1250px) {
  .leaf1{left: 5px; max-width: 350px;}
  .leaf2{top: 60em; rotate: -20deg;}
  .leaf4{width: 65%;} 
  .leaf3{display: none;}
  .leaf5{max-width: 300px; left: 10px; right: auto;}
  .leaf6{left: 5px; width: 45%; margin: 1px; }
  .image-wrapper {  margin: 0px 25px; }
}

.content {
  position: relative;
  z-index: 1; /* เนื้อหาอยู่เหนือรูป */
}

/* image resize */
.image-wrapper {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.thumbnail {
  width: 30%;
  max-width: 300px;
  height: auto;
  object-fit: cover;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.thumbnail:hover {
  transform: scale(1.05);
}

.pixelart .thumbnail:hover {
  filter: none;
}

@media (hover: hover) and (pointer: fine) {
    .thumbnail:hover {
        filter: hue-rotate(180deg);
        transform: scale(1.05);
    }
}

@media (hover: none) and (pointer: coarse) {
  .thumbnail:hover {
    filter: none;
  }
}

.pixelart .thumbnail{
  width: 40%;
  max-width: fit-content;
  aspect-ratio: auto;
}

.tinysprite{
  background-color: #f8f4e5;
  margin-top: 1rem;
  padding: 10px;
}
.tinysprite img {
 width: 20%;
}
@media (max-width: 1280px){
  .pixelart .thumbnail{
  width: 80%;
  }
}
.content hr{
  border: 1px solid rgba(194, 166, 54, 0.354);
  margin: 50px 8vw;
}

.mc-img {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  padding: 20px;
}

.mc-img img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 0 5rem;
  background-image: linear-gradient(#72baad,#eaff7fcd);
}
/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
}

.close-btn:hover {
  color: #ccc;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* cms term toggle */
.cmsterm{
    background-color: #313120c2;
    background-image: linear-gradient(#181806c2,#1a2114);
    filter: drop-shadow(0px 0px 8px #62d40480);
    border-radius: 2rem;
    margin: 1rem 10rem ;
    color: #edecd3;
    border-style: solid;
    border-color: #83a95f;
    text-align: center;
    margin-bottom: 5rem;
}

.cmsterm h3{
  font-size: 2.5rem;
  font-family:"Orbitron" ;
  color: #c5850f;
  margin-top: 1.5rem;
}
.cmsterm h4{
  font-size: 1.6rem;
  font-family: kanit;
  font-weight: 250;
  color: #c5c50f;
  margin: 0;
}
.cmsterm p {
  margin: 11px ;
  font-weight: 200;
  font-size: 20px;
  margin-top: 1rem;
  font-weight: 200;
  line-height: 30px;
  background-color: #4a831c35;
  padding: 20px;
  border-radius: 1rem;
  transition: transform 0.2s ease-in-out;
}

.cmsterm p:hover{
  transform: scale(1.03);
}

.cmsterm p, ul {
  text-align: left;
}

.cmsterm h5{
  font-size: 1.5rem;
  font-family: kanit;
  font-weight: 600;
  padding: 10px;
  color: #1d1c04;
  background-color: #80c235;
  transition: background-color 1s ease;

}

.cmsterm h5:hover{
  background-color: #fbd514;
}

.cmsterm h6{
  font-size: 1.5rem;
  background-color: #e2bc10;
  color: #1a2114;
  margin-top: 1.2rem;
  margin-bottom: 0;
  max-width: 20rem;
  text-align: left;
  padding: 2px 20px;
}

.cmsterm ul{
  font-size: 1rem;
  color: #e7e54e;
  font-weight: 300;
  margin-right: 10px;
}
.cmsterm li{
  margin-top: 10px;
  line-height: 25px;
}

.cmsterm .note{background-color: #457e1690;}
.commericaluse{
  margin-top: 1rem;
}

.commericaluse p {
    color: rgb(6, 36, 7) ;
    margin: 0%;
    border-radius: 0%;
}
.commericaluse p:hover{transform: none;}
.commericaluse p.commerical {background-color: rgb(131, 205, 116);}
.commericaluse p.personal {background-color: rgb(219, 216, 124);}

summary{
  font-size: 1.5rem;
  background-color: #e2bc10;
  text-align: left;
  color: #1a2114;
  margin-top: 1.2rem;
  padding-left: 20px;
  max-width: 20rem;
  transition: 200ms ease;
}
summary:hover{
  max-width: 100%;
}

details > summary {
  cursor: pointer;
  font-weight: bold;
}

details[open] summary{
  max-width: 100%;
}

details > summary::-webkit-details-marker {
  display: none; /* ซ่อนลูกศร default */
}
/* กล่องที่เลื่อน */
details .commericaluse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, padding 0.3s ease;
}

/* ตอน open */
details[open] .commericaluse {
  max-height: 1000px; /* ตั้งให้ใหญ่พอที่จะคลุมเนื้อหาหมด */
}

@media (max-width: 768px) {
  .cmsterm{ 
    margin: 1rem 25px ;
    max-width: none ;
  }

  .cmsterm h6{
    max-width: fit-content;
  }

  .cmsterm p {
    font-size: 1rem;
  }
}

.back-to-top{
  width: 100%;
  max-width: fit-content;
  border: 2px solid #fff09c;
  color: #bced0b;
  border-radius: 1rem;
  display: flex;
  margin: 4rem auto;
  justify-content: space-between;
  padding: 0.4rem 3rem;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  transition: transform 0.2s ease-in-out;
}

.back-to-top p{
  text-decoration: none;
  font-family: kanit;
  color: #bced0b;
  font-size: 1.5rem;

}
.back-to-top i{
  font-size: 1.2rem;
}

.back-to-top:hover{
  transform: translateY(-5px);
}
/* credit----------------------------------------- */
.credit{
    text-align: center;
    background-color: #fffee1;
    margin: 20px 0;
    padding: 10px;
    margin-top: 5rem;
}

.credit img{
    width: 90%;
    max-width: 800px;
}
.credit p {
    color: #433e3a;
    font-size: 1rem;
    margin: 0;
}
.credit p a{
    text-decoration: none;
    color: #503d07;
}
/* social links----------------------- */
.social-links {
  margin-top: 1rem;

}
.social-links a {
    color: #ffffff;
    filter: drop-shadow(0 0 5px #51c24d9b);
}

.social-links a :hover{
    color: #65f98d;
}

