@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ===== GLOBAL FONT ===== */
body, body * {
  font-family: 'Prompt', sans-serif !important;
}

/* ===== NAVBAR ===== */
.wp-block-template-part[class*="header"],
header.wp-block-template-part,
.wp-site-blocks > header,
.wp-block-group.is-layout-constrained:first-child {
  background: rgba(8, 8, 20, 0.96) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  box-shadow: 0 2px 30px rgba(139, 92, 246, 0.2) !important;
  border-bottom: 1px solid rgba(139, 92, 246, 0.25) !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 999 !important;
}

.wp-block-navigation a {
  color: #e2e8f0 !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  letter-spacing: 0.4px !important;
  transition: color 0.3s ease !important;
  text-decoration: none !important;
}

.wp-block-navigation a:hover {
  color: #a78bfa !important;
}

/* ===== SITE TITLE ===== */
.wp-block-site-title a {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.3px !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

/* ===== HERO SECTION ===== */
.wp-block-cover__inner-container h1,
.wp-block-cover h1 {
  font-size: clamp(2.2rem, 4.5vw, 4rem) !important;
  font-weight: 700 !important;
  text-transform: none !important;
  letter-spacing: -1px !important;
  line-height: 1.15 !important;
  color: #ffffff !important;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5) !important;
}

.wp-block-cover__inner-container p,
.wp-block-cover p {
  font-size: 1.05rem !important;
  font-weight: 300 !important;
  color: rgba(255,255,255,0.85) !important;
  line-height: 1.7 !important;
}

/* ===== HERO QUOTE ===== */
.wp-block-cover blockquote,
.wp-block-quote {
  border-left: 3px solid #a78bfa !important;
  padding-left: 1.2rem !important;
  margin: 1.5rem auto !important;
}

/* ===== POST CARDS AREA ===== */
.wp-block-post-template {
  gap: 2px !important;
}

.wp-block-post-template li {
  background: #ffffff !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  border: none !important;
  border-bottom: 1px solid #f1f1f1 !important;
  box-shadow: none !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
}

.wp-block-post-template li:hover {
  background: #faf9ff !important;
  border-left: 3px solid #7c3aed !important;
}

/* ===== FEATURED IMAGE ===== */
.wp-block-post-featured-image img {
  width: 100% !important;
  height: 260px !important;
  object-fit: cover !important;
  display: block !important;
  transition: transform 0.5s ease !important;
}

.wp-block-post-template li:hover .wp-block-post-featured-image img {
  transform: scale(1.04) !important;
}

/* ===== POST TITLE ===== */
.wp-block-post-title,
.wp-block-post-title a {
  font-size: 1.3rem !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: -0.3px !important;
  line-height: 1.4 !important;
  color: #1a1a2e !important;
  text-decoration: none !important;
  transition: color 0.3s ease !important;
}

.wp-block-post-title a:hover {
  color: #7c3aed !important;
}

/* ===== CATEGORY BADGE ===== */
.wp-block-post-terms a,
.wp-block-post-terms span {
  font-size: 0.65rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 1.8px !important;
  color: #7c3aed !important;
  background: rgba(124, 58, 237, 0.08) !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(124, 58, 237, 0.2) !important;
  text-decoration: none !important;
}

/* ===== MAIN CONTENT AREA ===== */
.wp-site-blocks main,
main.wp-block-group {
  background: #f8f7ff !important;
  padding: 40px 0 !important;
}

/* ===== HEADINGS GENERAL ===== */
h1, h2, h3, h4, h5 {
  text-transform: none !important;
  font-family: 'Prompt', sans-serif !important;
}

/* ===== FOOTER ===== */
.wp-block-template-part[class*="footer"],
footer.wp-block-template-part,
.wp-site-blocks > footer {
  background: #0a0a1a !important;
  border-top: 1px solid rgba(139, 92, 246, 0.3) !important;
  padding: 30px 20px !important;
}

.wp-site-blocks > footer *,
.wp-block-template-part[class*="footer"] * {
  color: rgba(255,255,255,0.5) !important;
  font-size: 0.82rem !important;
}

/* ===== FACEBOOK BUTTON / CTA ===== */
.wp-block-cover a:not(.wp-block-navigation-item__content) {
  display: inline-block !important;
  background: linear-gradient(135deg, #7c3aed, #4f46e5) !important;
  color: #ffffff !important;
  padding: 12px 28px !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35) !important;
  margin-top: 10px !important;
}

.wp-block-cover a:not(.wp-block-navigation-item__content):hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5) !important;
}

/* ===== FEATURED IMAGE FULL FIX (added 2026-05-17) ===== */
/* แสดงรูปบนสุดของบทความเต็มอัตราส่วน ไม่ตัดหัว/ขา */
figure.wp-block-post-featured-image {
  height: auto !important;
  aspect-ratio: auto !important;
  max-height: none !important;
}
figure.wp-block-post-featured-image img {
  height: auto !important;
  width: 100% !important;
  max-height: 70vh !important;
  object-fit: contain !important;
  aspect-ratio: auto !important;
  display: block !important;
}


/* ===== MOBILE UX FIX (added 2026-05-18) ===== */
/* Goal: readable on phones. Does NOT touch desktop (>= 782px). */
@media (max-width: 781px) {

  /* --- 1. NAVBAR: force hamburger, hide expanded list --- */
  header .wp-block-navigation__responsive-container-open {
    display: flex !important;
    visibility: visible !important;
    background: transparent !important;
    border: 0 !important;
    padding: 8px !important;
    color: #fff !important;
    cursor: pointer !important;
  }
  header .wp-block-navigation__responsive-container-open svg {
    fill: #fff !important;
    width: 28px !important;
    height: 28px !important;
  }
  header .wp-block-navigation.is-responsive .wp-block-navigation__responsive-container:not(.is-menu-open):not(.has-modal-open) {
    display: none !important;
  }
  header.wp-block-template-part {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
  header .wp-block-site-logo img.custom-logo {
    width: 36px !important;
    height: 36px !important;
  }
  .wp-block-site-title a {
    font-size: 16px !important;
  }

  /* --- 2. MOBILE MENU OPEN: full-viewport solid overlay --- */
  .wp-block-navigation__responsive-container.is-menu-open {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    background: #0a0a1a !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 64px 24px 32px !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
  }
  .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    width: 100% !important;
    align-items: stretch !important;
  }
  .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
    font-size: 18px !important;
    font-weight: 500 !important;
    padding: 16px 4px !important;
    color: #ffffff !important;
    letter-spacing: 0.2px !important;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
    display: block !important;
    text-align: left !important;
  }
  .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 14px !important;
    right: 14px !important;
    background: rgba(255,255,255,0.06) !important;
    border: 0 !important;
    border-radius: 999px !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    color: #fff !important;
    z-index: 10000 !important;
  }
  .wp-block-navigation__responsive-container-close svg {
    fill: #fff !important;
    width: 28px !important;
    height: 28px !important;
  }
  /* Prevent body scroll behind open menu */
  body:has(.wp-block-navigation__responsive-container.is-menu-open) {
    overflow: hidden !important;
  }

  /* --- 3. HERO: smaller so it doesn't take whole screen --- */
  .wp-block-cover {
    min-height: 56vh !important;
  }
  .wp-block-cover__inner-container h1,
  .wp-block-cover h1 {
    font-size: 26px !important;
    line-height: 1.25 !important;
    letter-spacing: -0.5px !important;
  }
  .wp-block-cover__inner-container p,
  .wp-block-cover p {
    font-size: 15px !important;
    line-height: 1.6 !important;
  }

  /* --- 4. POST LIST: stack vertically (current row layout cramps images) --- */
  .wp-block-post-template li {
    flex-direction: column !important;
    align-items: stretch !important;
    padding-bottom: 12px !important;
  }
  .wp-block-post-template li > * {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .wp-block-post-template li > .wp-block-post-featured-image,
  .wp-block-post-template li > figure {
    padding: 0 !important;
  }
  .wp-block-post-featured-image img {
    height: auto !important;
    max-height: 220px !important;
    width: 100% !important;
    aspect-ratio: 16/9 !important;
    object-fit: cover !important;
  }
  .wp-block-post-title,
  .wp-block-post-title a {
    font-size: 18px !important;
    line-height: 1.4 !important;
  }

  /* --- 5. ARTICLE BODY: readable type --- */
  .wp-block-post-content,
  .entry-content {
    font-size: 17px !important;
    line-height: 1.75 !important;
  }
  .wp-block-post-content p,
  .entry-content p {
    font-size: 17px !important;
    line-height: 1.75 !important;
    margin-bottom: 1em !important;
  }
  .wp-block-post-content h1,
  .entry-content h1 {
    font-size: 28px !important;
    line-height: 1.25 !important;
  }
  .wp-block-post-content h2,
  .entry-content h2 {
    font-size: 24px !important;
    line-height: 1.3 !important;
    margin-top: 1.6em !important;
  }
  .wp-block-post-content h3,
  .entry-content h3 {
    font-size: 20px !important;
    line-height: 1.35 !important;
    margin-top: 1.4em !important;
  }

  /* --- 6. SIDE PADDING --- */
  .wp-site-blocks .has-global-padding,
  .wp-block-group.has-global-padding {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* --- 7. MAIN CONTENT AREA: lighter top padding on mobile --- */
  .wp-site-blocks main,
  main.wp-block-group {
    padding: 20px 0 !important;
  }

  /* --- 8. IMAGES: never overflow --- */
  .wp-block-image img,
  .wp-block-post-content img,
  figure img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* --- 9. FOOTER: tighter --- */
  .wp-site-blocks > footer {
    padding: 24px 16px !important;
    text-align: center !important;
  }
}
/* ===== END MOBILE UX FIX ===== */
