/* Breadcrumb */
.breadcrumb-area {
    padding: 0;
    height: 800px;
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    text-shadow: 3px 3px 5px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.breadcrumb-content h4 {
    font-size: 60px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

body {
  background-image: url("../images/bg-structure.png"); /* path ไปยังภาพ */
  background-repeat: no-repeat;                /* ไม่ให้ภาพซ้ำ */
  background-size: cover;                      /* ปรับขนาดให้เต็มหน้าจอ */
  background-position: center center;          /* จัดตำแหน่งให้อยู่กลาง */
  background-attachment: fixed;                /* ให้ภาพอยู่กับพื้นหลัง ไม่เลื่อนตาม scroll */
}

/* Tabs */
.organization-tabs {
    background: linear-gradient(90deg, #611e72 0%, #792a98 100%);
    padding: 10px 0;
    text-align: center;
    box-shadow: 0 4px 16px rgba(30, 60, 114, 0.3);
}

.tabs {
    display: inline-flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    gap: 28px;
    margin: 0;
}

.tab {
    padding: 5px 20px;
    font-size: 14px;
    cursor: pointer;
    color: #eaf1f8;
    border-radius: 50px;
    font-weight: 700;
    letter-spacing: 0.04em;
    user-select: none;
    box-shadow: 0 0 12px transparent;
    transition: background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s ease;
}

.tab:hover {
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 6px 16px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.tab.active {
    background: #ffffff;
    color: #1e3c72;
    box-shadow: 0 10px 28px rgba(30, 60, 114, 0.35);
    transform: translateY(-2px);
}

.organization-structure {
    padding: 80px 24px 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1600px; /* ขยายจาก 1280px เป็น 1600px */
    width: 95%; /* กำหนดให้กว้างตาม 95% ของหน้าจอ */
    margin: 0 auto 60px;
}

/* Section title */
.section-title {
    font-size: 36px;
    font-weight: 700;
    color: #1e3c72;
    margin-bottom: 56px;
    text-align: center;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: 0 3px 8px rgba(30, 60, 114, 0.3);
}

/* Card container */
.card-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* เปลี่ยนเป็น 4 คอลัมน์ */
    gap: 32px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 12px;
}

/* Card */
.card {
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 20px 40px rgb(0 0 0 / 0.07);
    cursor: pointer;
    overflow: hidden;
    max-width: 320px; /* กว้างขึ้น */
    padding: 32px 24px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    user-select: none;
}

.card:hover {
    box-shadow: 0 28px 48px rgb(0 0 0 / 0.15);
    transform: translateY(-6px);
}

/* รูปโปรไฟล์เต็มมุมโค้ง */
.card-image {
    width: 100%;
    height: 280px;  /* สูงขึ้นจาก 220px เป็น 280px */
    object-fit: cover;
    border-radius: 20px; /* ลดความโค้งลงเล็กน้อย */
    margin-bottom: 20px; /* ลดช่องว่างระหว่างรูปกับเนื้อหา */
    transition: transform 0.3s ease;
}

.card:hover .card-image {
    transform: scale(1.05);
}

/* เนื้อหาด้านล่างรูป */
.card-body {
    text-align: left;
    width: 100%;
    max-width: 320px;
    font-family: 'Kanit', sans-serif;
    color: #4C0070;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    user-select: text;
}

.card-body h3 {
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 8px;
    color: #1a004d;
}

.card-body p.position {
    font-weight: 600;
    color: #5c6bc0;
    margin-bottom: 14px;
}

.card-body p.contact {
    margin: 6px 0;
    color: #7e4ca0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.card-body p.contact svg {
    fill: #7e4ca0;
    width: 18px;
    height: 18px;
}

/* ลิงก์รายละเอียด */
.details-link {
    display: inline-block;
    margin-top: 24px;
    font-weight: 600;
    font-size: 14px;
    color: #a855f7;
    cursor: pointer;
    user-select: none;
    text-align: center;
    width: 100%;
    transition: color 0.3s ease;
}

.details-link:hover {
    color: #7c3aed;
}

/* Responsive */
@media (max-width: 1024px) {
   .card-container {
        grid-template-columns: repeat(3, 1fr); /* 3 คอลัมน์ จอเล็กลง */
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .organization-tabs {
        padding: 18px 0;
        border-radius: 0 0 16px 16px;
    }

    .tabs {
        flex-direction: column;
        gap: 18px;
    }

    .tab {
        margin: 0 auto;
        width: 80%;
        font-size: 18px;
        padding: 16px 0;
        border-radius: 50px;
    }

     .card-container {
        grid-template-columns: repeat(2, 1fr); /* 2 คอลัมน์ tablet */
        gap: 28px;
        max-width: 100%;
        padding: 0 16px;
    }

    .card {
        max-width: 100%;
        width: 100%;
        border-radius: 20px;
        box-shadow:
            0 10px 28px rgba(30, 60, 114, 0.15);
    }

    .card-body h3 {
        font-size: 20px;
    }

    .card-body p {
        font-size: 16px;
    }
    
    /* Modal Responsive */
    .modal-content {
        max-width: 90vw;
        padding: 30px 24px;
        flex-direction: column;
        gap: 24px;
    }
    .modal-detail-wrapper {
        flex-direction: column;
        gap: 24px;
    }
    .modal-image {
        max-width: 100%;
        height: auto;
        margin: 0 auto;
        border-radius: 12px;
    }
    .modal-detail h2 {
        font-size: 24px;
    }
    .modal-detail h3 {
        font-size: 18px;
    }
    .modal-detail {
        font-size: 16px;
    }
}

/* Modal Styling */
.modal {
  display: none;
  position: fixed;
  z-index: 1050;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  -moz-backdrop-filter: blur(5px);
  padding: 40px 20px;
}

.modal-content {
  /* ปรับความสูงด้วย min-height */
  max-width: 1000px;
  min-height: 680px;   /* เพิ่มความสูงขั้นต่ำ */
  margin: 0 auto;
  border-radius: 24px;
  padding: 40px 48px;
  box-shadow: 0 24px 48px rgba(30, 60, 114, 0.25);
  position: relative;
  text-align: left;
  animation: fadeInScale 0.3s ease forwards;
  display: flex;
  flex-direction: row;
  gap: 36px;
  font-family: 'Kanit', sans-serif;
  background-color: rgba(255, 255, 255, 0.74); /* สีขาวโปร่งใส */
}
.modal-detail-wrapper {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  width: 100%;
}

.modal-detail {
  flex: 1;
  color: #2c3e50;          /* สีฟ้าน้ำทะเลเข้ม ดูทันสมัย */
  font-weight: 600;
  font-size: 18px;
  line-height: 1.6;
}

.modal-detail h2 {
  color: #0d47a1;          /* ฟ้อนต์ชื่อสีฟ้าเข้ม */
  font-weight: 900;
  font-size: 28px;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.modal-detail h3 {
  color: #1565c0;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 20px;
  font-style: normal;  /* เอา italic ออก */
}

.modal-detail p {
  margin: 10px 0;
  font-weight: 500;
}

.modal-detail p strong {
  font-weight: 700;
  color: #1976d2;          /* เน้น label สีฟ้า */
}

/* ปรับขนาดรูปให้เล็กลง */
.modal-image {
  max-width: 400px;      /* ลดจาก 400px มา 280px */
  height: 560px;         /* ลดจาก 560px มา 380px */
  object-fit: cover;
  border-radius: 16px;
  box-shadow: none;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.modal-image:hover {
  transform: scale(1.04);
}

/* ปุ่มปิด (×) */
.modal-close {
  position: absolute;
  top: 18px;
  right: 24px;
  font-size: 30px;
  font-weight: 700;
  color: #1565c0;
  cursor: pointer;
  transition: color 0.3s ease;
  user-select: none;
}

.modal-close:hover {
  color: #0d47a1;
}

#executive h2,
#administration h2,
#sustainability h2 {
    text-align: center;
    margin: 10px 0 60px 0; /* เว้นระยะห่างบน 40px ล่าง 60px */
    color: #0d47a1; /* สีฟ้าเข้ม ดูเด่น */
    font-family: 'Kanit', sans-serif; /* ฟ้อนต์ทันสมัย */
    font-weight: 900;
    font-size: 32px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-shadow: 1px 1px 3px rgba(13, 71, 161, 0.4);
}



@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive for smaller screens */
@media (max-width: 576px) {
  .modal-content {
    padding: 32px 24px;
    max-width: 90vw;
  }
  .modal-detail-wrapper {
    flex-direction: column;
    gap: 24px;
  }
  .modal-image {
    max-width: 140px;
    margin: 0 auto;
  }
  .modal-detail {
    font-size: 14px;
  }
}
