
/* ========================================
   POLICY PAGE
   OPTIMIZED VERSION
======================================== */

/* ========================================
   POLICY HERO
======================================== */

.policy-hero {

  position: relative;

  min-height: 78vh;

  display: flex;
  align-items: center;

  overflow: hidden;

  padding-top: 180px;
  padding-bottom: 140px;

  /* พื้นหลัง */
  background:
    linear-gradient(
      rgba(25, 0, 45, 0.78),
      rgba(55, 0, 90, 0.82)
    ),

    url("../assets/image/bg-policy.jpg");

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

}

/* overlay ม่วง */
.policy-hero::before {

  content: "";

  position: absolute;
  inset: 0;

  background:
    radial-gradient(
      circle at top left,
      rgba(182,109,255,0.22),
      transparent 38%
    ),

    radial-gradient(
      circle at bottom center,
      rgba(255,255,255,0.12),
      transparent 45%
    );

  pointer-events: none;

}

/* เบลอล่าง */
.policy-hero::after {

  content: "";

  position: absolute;

  left: 0;
  right: 0;
  bottom: -120px;

  height: 260px;

  background:
    radial-gradient(
      ellipse at center,
      rgba(255,255,255,0.6),
      transparent 72%
    );

  filter: blur(40px);

  pointer-events: none;

}

/* container */
.policy-hero .container {

  position: relative;
  z-index: 5;

  display: flex;
  justify-content: flex-end;

}

/* content */
.policy-hero-content {

  max-width: 720px;

}

/* title */
.policy-title {

  font-size: clamp(2.8rem, 6vw, 5.2rem);

  font-weight: var(--fw-black);

  line-height: 1.05;

  margin-bottom: 20px;

  color: white;

}

/* highlight */
.policy-title span {

  color: #b56dff;

}

/* subtitle */
.policy-subtitle {

  font-size: 1.1rem;

  font-weight: var(--fw-light);

  color: rgba(255,255,255,0.82);

  line-height: 1.8;

}

/* section number */
.policy-hero .section-number {

  color: #f0c04f;

}

/* ========================================
   OVERVIEW
======================================== */
.policy-overview {
  padding: 80px 0 120px;
  background: var(--off-white);
}

/* ========================================
   POLICY GRID
======================================== */
.policy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

/* ========================================
   CATEGORY CARD
======================================== */
.policy-category-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 32px;

  border: 1px solid rgba(107,33,168,0.08);

  box-shadow:
    0 4px 12px rgba(0,0,0,0.04);

  display: flex;
  flex-direction: column;
  gap: 16px;

  position: relative;
  overflow: hidden;

  transition:
    transform .22s ease,
    box-shadow .22s ease,
    border-color .22s ease;

  will-change: transform;

  transform: translateZ(0);
  backface-visibility: hidden;
}

.policy-category-card::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;

  background:
    linear-gradient(90deg,
    var(--purple-mid),
    var(--purple-light));

  transform: scaleX(0);

  transition: transform .22s ease;
}

.policy-category-card:hover {
  transform: translateY(-4px);

  border-color: rgba(107,33,168,0.14);

  box-shadow:
    0 10px 24px rgba(0,0,0,0.06);
}

.policy-category-card:hover::before {
  transform: scaleX(1);
}

/* Featured */
.policy-category-card--featured {
  background: var(--purple-main);
  border-color: transparent;
}

.policy-category-card--featured::before {
  background:
    linear-gradient(90deg,
    var(--gold),
    var(--gold-light));
}

.policy-category-card--featured .policy-cat-title,
.policy-category-card--featured .policy-cat-count,
.policy-category-card--featured .policy-cat-list li {
  color: var(--white);
}

.policy-category-card--featured .policy-cat-icon {
  background: rgba(255,255,255,0.14);
  color: var(--gold);
}

.policy-category-card--featured .policy-cat-list li i {
  color: var(--gold);
}

.policy-category-card--featured .policy-cat-btn {
  background: var(--gold);
  color: var(--purple-dark);
}

.policy-category-card--featured .policy-cat-btn:hover {
  background: var(--gold-light);
}

/* Icon */
.policy-cat-icon {
  width: 56px;
  height: 56px;

  border-radius: var(--radius-md);

  background: var(--purple-pale);
  color: var(--purple-mid);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 1.4rem;

  transition:
    background .2s ease,
    color .2s ease;
}

.policy-category-card:hover .policy-cat-icon {
  background: var(--purple-mid);
  color: var(--white);
}

/* Title */
.policy-cat-title {
  font-size: 1.4rem;
  font-weight: var(--fw-bold);
  color: var(--purple-main);
}

/* Count */
.policy-cat-count {
  font-size: 0.8rem;
  font-weight: var(--fw-semibold);
  color: var(--gold);

  letter-spacing: .1em;
  text-transform: uppercase;
}

/* List */
.policy-cat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.policy-cat-list li {
  display: flex;
  align-items: center;
  gap: 10px;

  font-size: 0.9rem;
  font-weight: var(--fw-light);

  color: var(--gray);
}

.policy-cat-list li i {
  font-size: .5rem;
  color: var(--purple-light);
  flex-shrink: 0;
}

/* Button */
.policy-cat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 12px 24px;

  background: var(--purple-pale);
  color: var(--purple-main);

  border: none;
  border-radius: var(--radius-full);

  font-family: var(--font);
  font-size: .875rem;
  font-weight: var(--fw-semibold);

  cursor: pointer;

  margin-top: auto;

  transition:
    transform .2s ease,
    background .2s ease,
    color .2s ease;
}

.policy-cat-btn:hover {
  background: var(--purple-mid);
  color: var(--white);

  transform: translateY(-2px);
}

/* ========================================
   MODAL OVERLAY
======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;

  background: rgba(10,0,20,0.6);

  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);

  z-index: 2000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  opacity: 0;
  pointer-events: none;

  transition: opacity .22s ease;

  will-change: opacity;

  transform: translateZ(0);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ========================================
   MODAL BASE
======================================== */
.category-modal,
.policy-modal {
  background: rgba(255,255,255,0.88);

  border: 1px solid rgba(255,255,255,0.24);

  border-radius: var(--radius-xl);

  overflow-y: auto;

  position: relative;

  opacity: 0;

  transform:
    translate3d(0,16px,0)
    scale(.985);

  transition:
    transform .22s ease,
    opacity .22s ease;

  will-change: transform, opacity;

  box-shadow:
    0 10px 28px rgba(0,0,0,0.08);

  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Open */
.modal-overlay.open .category-modal,
.modal-overlay.open .policy-modal {
  opacity: 1;

  transform:
    translate3d(0,0,0)
    scale(1);
}

/* Category modal */
.category-modal {
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  padding: 48px;
}

/* Policy modal */
.policy-modal {
  width: 100%;
  max-width: 620px;
  max-height: 88vh;
  padding: 48px;
}

/* ========================================
   CLOSE BUTTON
======================================== */
.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;

  width: 40px;
  height: 40px;

  border-radius: 999px;

  background: rgba(107,33,168,0.08);
  color: var(--purple-main);

  border: none;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition:
    background .2s ease,
    color .2s ease;
}

.modal-close-btn:hover {
  background: var(--purple-mid);
  color: var(--white);
}

/* ========================================
   HEADER
======================================== */
.cat-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  margin-bottom: 32px;
  padding-bottom: 24px;

  border-bottom: 1px solid var(--gray-light);
}

.cat-modal-label {
  font-size: .75rem;
  font-weight: var(--fw-semibold);

  color: var(--gold);

  letter-spacing: .15em;
  text-transform: uppercase;

  margin-bottom: 8px;
}

.cat-modal-title {
  font-size: 2rem;
  font-weight: var(--fw-black);
  color: var(--purple-main);
}

.cat-modal-sub {
  font-size: .9rem;
  color: var(--gray);
  margin-top: 4px;
}

.cat-modal-count-wrap {
  text-align: center;
  margin-right: 56px;
}

.cat-modal-count {
  font-size: 3rem;
  font-weight: var(--fw-black);
  color: var(--gold);
  line-height: 1;
}

.cat-modal-count-label {
  font-size: .75rem;
  color: var(--gray);
  margin-top: 4px;
}

/* ========================================
   POLICY CARDS
======================================== */
.policy-cards-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 16px;

  margin-bottom: 32px;
}

.policy-card {
  background: var(--off-white);

  border-radius: var(--radius-md);

  padding: 24px 20px;

  cursor: pointer;

  border: 1px solid transparent;

  position: relative;
  overflow: hidden;

  transition:
    transform .2s ease,
    box-shadow .2s ease,
    border-color .2s ease;

  will-change: transform;

  transform: translateZ(0);
}

.policy-card::after {
  content: '';

  position: absolute;
  inset-inline: 0;
  bottom: 0;

  height: 2px;

  background:
    linear-gradient(90deg,
    var(--purple-mid),
    var(--purple-light));

  transform: scaleX(0);

  transition: transform .2s ease;
}

.policy-card:hover {
  background: var(--white);

  border-color: rgba(107,33,168,0.12);

  transform: translateY(-3px);

  box-shadow:
    0 8px 20px rgba(0,0,0,0.05);
}

.policy-card:hover::after {
  transform: scaleX(1);
}

.policy-card-num {
  font-size: .7rem;
  font-weight: var(--fw-bold);

  color: var(--purple-light);

  letter-spacing: .15em;

  margin-bottom: 8px;
}

.policy-card-title {
  font-size: .95rem;
  font-weight: var(--fw-semibold);

  color: var(--purple-main);

  line-height: 1.4;
}

.policy-card-arrow {
  display: flex;
  align-items: center;
  gap: 4px;

  font-size: .75rem;
  font-weight: var(--fw-medium);

  color: var(--gold);

  margin-top: 12px;
}

/* ========================================
   POLICY MODAL
======================================== */
.policy-modal-header {
  margin-bottom: 28px;
  padding-right: 40px;
}

.policy-modal-number {
  font-size: .75rem;
  font-weight: var(--fw-bold);

  color: var(--gold);

  letter-spacing: .2em;

  margin-bottom: 8px;
}

.policy-modal-title {
  font-size: 1.6rem;
  font-weight: var(--fw-black);

  color: var(--purple-main);

  line-height: 1.3;
}

/* ========================================
   TABS
======================================== */
.w1h-tabs {
  display: flex;
  gap: 4px;

  background: var(--off-white);

  border-radius: var(--radius-full);

  padding: 4px;

  margin-bottom: 24px;

  overflow-x: auto;
}

.w1h-tab {
  flex: 1;
  min-width: 60px;

  padding: 8px 12px;

  border-radius: var(--radius-full);
  border: none;

  background: transparent;

  font-family: var(--font);
  font-size: .75rem;
  font-weight: var(--fw-bold);

  color: var(--gray);

  cursor: pointer;

  white-space: nowrap;

  letter-spacing: .05em;

  transition:
    background .18s ease,
    color .18s ease;
}

.w1h-tab.active {
  background: var(--purple-main);
  color: var(--white);

  box-shadow:
    0 2px 8px rgba(0,0,0,0.05);
}

.w1h-tab:hover:not(.active) {
  background: rgba(107,33,168,0.08);
  color: var(--purple-main);
}

/* ========================================
   CONTENT
======================================== */
.w1h-content {
  min-height: 120px;

  padding: 24px;

  background: var(--off-white);

  border-radius: var(--radius-md);

  border-left: 3px solid var(--purple-mid);

  margin-bottom: 28px;
}

.w1h-content p {
  font-size: .95rem;
  font-weight: var(--fw-light);

  color: var(--black);

  line-height: 1.9;
}

/* ========================================
   FOOTER
======================================== */
.cat-modal-footer,
.policy-modal-footer {
  display: flex;
  justify-content: flex-end;

  padding-top: 24px;

  border-top: 1px solid var(--gray-light);
}

/* ========================================
   BACK HOME
======================================== */
.back-home {
  padding: 100px 0;
  background: var(--white);
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 900px) {

  .policy-grid {
    grid-template-columns: 1fr;

    max-width: 480px;

    margin-left: auto;
    margin-right: auto;
  }

  .policy-cards-grid {
    grid-template-columns: repeat(2,1fr);
  }

  .category-modal,
  .policy-modal {
    padding: 32px 24px;
  }
}

@media (max-width: 600px) {

  .policy-cards-grid {
    grid-template-columns: 1fr;
  }

  .cat-modal-header {
    flex-direction: column;
    gap: 16px;
  }

  .cat-modal-count-wrap {
    margin-right: 0;
  }

  .policy-modal {
    padding: 32px 20px;
  }

  .w1h-tabs {
    border-radius: var(--radius-lg);
  }
}

/* ========================================
   FIX MOBILE MODAL SCROLL
======================================== */

body {
  overflow-x: hidden;
}

.category-modal,
.policy-modal {
  overflow-y: auto;

  -webkit-overflow-scrolling: touch;
}

/* ========================================
   GOSSIP PROBLEM
======================================== */

.gossip-section{
  padding: 120px 0;
}

.gossip-box{

  max-width: 950px;

  margin: 0 auto;

  padding: 56px;

  border-radius: 36px;

  background:
    linear-gradient(
      135deg,
      rgba(124,58,237,0.10),
      rgba(255,255,255,0.92)
    );

  backdrop-filter: blur(18px);

  border: 1px solid rgba(124,58,237,0.12);

  box-shadow:
    0 10px 40px rgba(88,28,135,0.08);
}

/* TEXT */

.gossip-head span{
  color: #d4a017;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 14px;
}

.gossip-head h2{

  font-size: clamp(2.2rem, 5vw, 4.5rem);

  line-height: 1.1;

  margin-top: 14px;

  margin-bottom: 20px;
}

.gossip-head p{

  color: #777;

  line-height: 1.9;

  max-width: 700px;

  font-size: 1.05rem;
}

/* FORM */

.gossip-form{

  margin-top: 42px;

  display: flex;

  flex-direction: column;

  gap: 22px;
}

/* INPUT */

.gossip-input,
.gossip-textarea{

  width: 100%;

  border: none;

  outline: none;

  border-radius: 22px;

  background: rgba(255,255,255,0.72);

  box-shadow:
    inset 0 0 0 1px rgba(124,58,237,0.10);

  padding: 20px 24px;

  font-size: 1rem;

  font-family: inherit;

  transition: 0.3s ease;
}

.gossip-input:focus,
.gossip-textarea:focus{

  box-shadow:
    inset 0 0 0 2px #a855f7,
    0 0 24px rgba(168,85,247,0.18);

  background: white;
}

/* TEXTAREA */

.gossip-textarea{

  min-height: 220px;

  resize: vertical;

  line-height: 1.8;
}

/* BUTTON */

.gossip-btn{

  width: fit-content;

  border: none;

  outline: none;

  cursor: pointer;

  padding: 18px 34px;

  border-radius: 999px;

  background:
    linear-gradient(
      135deg,
      #6d28d9,
      #9333ea
    );

  color: white;

  font-size: 1rem;

  font-weight: 700;

  display: flex;

  align-items: center;

  gap: 12px;

  transition: 0.3s ease;

  box-shadow:
    0 12px 30px rgba(124,58,237,0.28);
}

.gossip-btn:hover{

  transform: translateY(-4px);

  box-shadow:
    0 18px 40px rgba(124,58,237,0.38);
}

/* NOTE */

.gossip-note{

  margin-top: 20px;

  color: #888;

  font-size: 0.95rem;
}

/* MOBILE */

@media(max-width:768px){

  .gossip-section{
    padding: 80px 20px;
  }

  .gossip-box{
    padding: 32px 24px;
    border-radius: 28px;
  }

  .gossip-head h2{
    font-size: 2.5rem;
  }

  .gossip-textarea{
    min-height: 180px;
  }

  .gossip-btn{
    width: 100%;
    justify-content: center;
  }

}