/* =============================================
   Vind-Account — style.css
   ============================================= */

/* --- Design Tokens & Base --- */
:root {
  --navy: #1e3a5f; --gold: #d69e2e; --white: #ffffff;
  --sky: #eaf3fb;  /* tint ฟ้าอ่อน — hero bg + decorative */
  --gold-dark: #a5761f; /* เฟ้มเข้ม — text-on-white only (B5), not used on btn fills */
  --bg: #f7f9fc; --text: #2d3748; --muted: #5f7085; /* #5f7085 = 5.07:1 on white, 4.81:1 on --bg — WCAG AA */
  --radius: 12px; --maxw: 1140px;
  --transition: 0.25s ease;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Sarabun', sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}
h1, h2, h3 {
  font-family: 'Prompt', sans-serif;
  color: var(--navy);
  line-height: 1.3;
}
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
section { padding: 4.5rem 0; }
img, svg { max-width: 100%; }

/* --- Utility --- */
.gold { color: var(--gold); }
/* B5: logo suffix "Account" on white navbar needs darker gold for 3:1 large-bold AA */
#navbar .logo .gold { color: var(--gold-dark); }

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn-gold {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn-gold:hover, .btn-gold:focus-visible {
  background: #c8912a;
  border-color: #c8912a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(214,158,46,0.35);
  outline: none;
}
.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline:hover, .btn-outline:focus-visible {
  background: rgba(30,58,95,0.07);
  border-color: var(--navy);
  transform: translateY(-2px);
  outline: none;
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* =============================================
   NAVBAR
   ============================================= */
#navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: 0 2px 12px rgba(30,58,95,0.10);
}

/* Hide the actual checkbox */
#nav-toggle { display: none; }

.nav-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

/* Logo */
.logo {
  font-family: 'Prompt', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  margin-right: auto;
}

/* Desktop nav links */
.nav-links {
  display: flex;
  list-style: none;
  gap: 0.15rem;
  align-items: center;
}
.nav-links a {
  color: var(--navy);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover, .nav-links a:focus-visible {
  color: var(--gold);
  background: rgba(30,58,95,0.06);
  outline: none;
}

/* Nav actions: lang toggle + CTA + hamburger */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.btn-lang {
  background: transparent;
  border: 1.5px solid var(--navy);
  color: var(--navy);
  border-radius: 8px;
  padding: 0.3rem 0.75rem;
  font-family: 'Prompt', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.btn-lang:hover, .btn-lang:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
  outline: none;
}

/* --- Hamburger label --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0.4rem;
  width: 36px;
  height: 36px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger animate when checked */
#nav-toggle:checked ~ .nav-inner .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#nav-toggle:checked ~ .nav-inner .hamburger span:nth-child(2) { opacity: 0; }
#nav-toggle:checked ~ .nav-inner .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Mobile dropdown nav --- */
.mobile-nav {
  display: none;
  background: var(--white);
  padding: 0.5rem 1.25rem 1rem;
  border-top: 1px solid rgba(30,58,95,0.08);
  box-shadow: 0 4px 12px rgba(30,58,95,0.08);
}
.mobile-nav ul { list-style: none; }
.mobile-nav a {
  display: block;
  color: var(--navy);
  text-decoration: none;
  padding: 0.65rem 0.5rem;
  font-size: 1rem;
  border-bottom: 1px solid rgba(30,58,95,0.08);
  transition: color var(--transition);
}
.mobile-nav a:hover { color: var(--gold); }

/* --- Responsive Navbar (< 768px) --- */
@media (max-width: 767px) {
  .hamburger { display: flex; }
  .nav-links { display: none; } /* hide desktop links on mobile */

  /* Show mobile nav when checkbox is checked */
  #nav-toggle:checked ~ .mobile-nav { display: block; }
}

/* =============================================
   HERO
   ============================================= */
#hero {
  background: linear-gradient(160deg, var(--sky) 0%, #ffffff 100%);
  padding: 5.5rem 0 4.5rem;
  overflow: hidden;
  position: relative;
}
/* Decorative circles — sky/gold tones, jаng ๆ */
#hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,58,95,0.06) 0%, transparent 70%);
  pointer-events: none;
}
#hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214,158,46,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  position: relative; /* sit above ::before/::after */
  z-index: 1;
}
.hero-text h1 {
  color: var(--navy);
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 700;
  margin-bottom: 1.1rem;
  white-space: pre-line;
}
.hero-sub {
  color: var(--text); /* --text #2d3748 = 10.68:1 on --sky, passes WCAG AA; --muted only 3.58:1 */
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 480px;
}
.hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.hero-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-illustration svg {
  width: 100%;
  max-width: 340px;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(30,58,95,0.18));
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

@media (max-width: 767px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  .hero-text h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-btns { justify-content: center; }
  .hero-illustration svg { max-width: 240px; }
}

/* =============================================
   SECTION HEADER (reusable pattern)
   ============================================= */
.bg-alt { background: var(--bg); }

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 700;
}
.section-underline {
  width: 48px;
  height: 4px;
  background: var(--gold);
  border-radius: 2px;
  margin: 0.6rem auto 0;
}

/* =============================================
   ABOUT
   ============================================= */
.about-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.about-text p {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.8;
}
.trust-points {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.trust-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
}
.trust-icon svg { width: 100%; height: 100%; }
.trust-item h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.25rem;
}
.trust-item p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 767px) {
  .about-inner { grid-template-columns: 1fr; }
}

/* =============================================
   SERVICES
   ============================================= */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .services-grid { grid-template-columns: repeat(4, 1fr); }
}

.service-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: 0 2px 12px rgba(30,58,95,0.07);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid rgba(30,58,95,0.06);
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(30,58,95,0.13);
}
.service-icon {
  width: 56px;
  height: 56px;
  background: rgba(214,158,46,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  flex-shrink: 0;
}
.service-icon svg { width: 100%; height: 100%; }
.service-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
}
.service-card p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
}
.service-link {
  color: #8a6118; /* M4a: #8a6118 on white = 5.68:1 contrast (passes WCAG AA >=4.5:1) */
  text-decoration: none;
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color var(--transition);
  margin-top: auto;
}
.service-link:hover, .service-link:focus-visible {
  color: #c8912a;
  outline: none;
}

/* =============================================
   LATEST POSTS
   ============================================= */
#posts { background: var(--bg); }

.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 768px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

.post-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: 0 2px 12px rgba(30,58,95,0.07);
  border: 1px solid rgba(30,58,95,0.06);
  transition: transform var(--transition), box-shadow var(--transition);
}
.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 28px rgba(30,58,95,0.13);
}
.post-card time {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: 'Prompt', sans-serif;
}
.post-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
}
.post-card p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  /* CSS line-clamp: 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.posts-footer {
  text-align: center;
  margin-top: 0.5rem;
}

/* =============================================
   CONTACT
   ============================================= */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
@media (min-width: 768px) {
  .contact-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 479px) {
  .contact-grid { grid-template-columns: 1fr; }
}

.contact-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 2px 12px rgba(30,58,95,0.07);
  border: 1px solid rgba(30,58,95,0.06);
  transition: transform var(--transition), box-shadow var(--transition);
}
.contact-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 28px rgba(30,58,95,0.13);
}
.contact-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
.contact-icon svg { width: 100%; height: 100%; }
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.contact-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: 'Prompt', sans-serif;
  font-weight: 500;
}
.contact-value {
  font-size: 0.95rem;
  color: var(--navy);
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
  word-break: break-all;
}

/* =============================================
   FOOTER
   ============================================= */
#footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 3rem 0 1.5rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 1.5rem;
}
@media (max-width: 767px) {
  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-links, .footer-contact { align-items: center; }
}

.logo-footer { font-size: 1.2rem; margin-bottom: 0.5rem; display: inline-block; }
.footer-disclaimer {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55); /* M4: raised from 0.50 → 4.66:1 on navy, WCAG AA pass */
  line-height: 1.6;
  margin-top: 0.5rem;
  max-width: 220px;
}
@media (max-width: 767px) {
  .footer-disclaimer { max-width: none; }
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--gold); }

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-contact a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition);
}
.footer-contact a:hover { color: var(--gold); }

.footer-copy {
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55); /* M4: raised from 0.40 → 4.66:1 on navy, WCAG AA pass */
}

/* =============================================
   TASK 7: RESPONSIVE + A11Y POLISH
   ============================================= */

/* Ensure no element overflows horizontally at any size */
* { max-width: 100%; }
img, svg, video { display: block; max-width: 100%; }

/* Small screen (320px) safety */
@media (max-width: 360px) {
  .container { padding: 0 1rem; }
  .hero-text h1 { font-size: 1.45rem; }
  .hero-btns { flex-direction: column; align-items: stretch; }
  .hero-btns .btn { text-align: center; }
  .btn { padding: 0.7rem 1.25rem; font-size: 0.95rem; }
  .services-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { gap: 1.25rem; }
}

/* Focus outline on all interactive elements (gold) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
label:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Ensure min tap target ≥ 44px for all interactive elements */
.nav-links a { min-height: 44px; display: inline-flex; align-items: center; }
.service-link { min-height: 44px; display: inline-flex; align-items: center; }
.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.btn-lang { min-height: 44px; }
.hamburger { min-width: 44px; min-height: 44px; }

/* Prevent text overflow in cards */
.service-card h3,
.post-card h3,
.trust-item h3 {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Smooth section scroll offset for sticky nav */
section[id] { scroll-margin-top: 70px; }

/* Hide CTA button on small mobile screens to prevent navbar overflow */
@media (max-width: 480px) {
  #navbar .nav-actions .btn-gold {
    display: none;
  }
}

