/* =====================================================================
   PEXTH www — base styles shared by every public page (owned by lead).
   Page-specific styles: www-discover.css (home/companies/company) and
   www-content.css (rfq/packages/calculator/partner/about/legal/my).
   Colors come ONLY from pexth-ui.css tokens → dark mode works for free
   (text on a solid var(--primary) fill uses var(--on-primary) from pexth-brand.css).
   ===================================================================== */

/* ---------- a11y ---------- */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: var(--r-sm); }
.skip-link:focus { left: 8px; }

/* ---------- header extras ---------- */
.brand span { display: inline-flex; flex-direction: column; line-height: 1.05; }
/* Thai labels are long: never break a nav label mid-word; collapse 5 items earlier than the
   shared 860px breakpoint so brand + links + auth never wrap (checked at 1024px) */
.nav-links a { white-space: nowrap; padding: 8px 10px; }
@media (max-width: 1180px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: var(--s-3) var(--gutter); box-shadow: var(--shadow-2); }
  .nav-toggle { display: inline-flex; }
}
.brand-inv { color: #fff; }
.nav-auth { display: flex; gap: var(--s-2); align-items: center; min-width: 96px; justify-content: flex-end; }
.nav-auth-skel { display: inline-block; width: 180px; height: 34px; border-radius: var(--r-sm); }
@media (max-width: 520px) { .nav-auth-skel { width: 90px; } }
.menu-btn { gap: 8px; padding-left: 6px; }
.menu-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.menu-who { display: flex; flex-direction: column; padding: 8px 12px; gap: 2px; }
.menu-who .subtle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
/* phones: drop the ghost "เข้าสู่ระบบ" link (direct child) — NOT the signed-in avatar menu button, which is
   also .btn-ghost but lives inside .menu (hiding it left phone users with no account menu / sign-out) */
@media (max-width: 520px) { .menu-name { display: none; } .nav-auth > .btn-ghost { display: none; } }
@media (max-width: 400px) { .nav .brand small { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(1200px 500px at 85% 110%, rgba(245, 166, 35, .35), transparent 60%),
              linear-gradient(150deg, var(--brand-900), var(--brand-700) 55%, var(--brand-600));
  padding: var(--s-16) 0 calc(var(--s-16) + 24px);
}
.hero h1 { color: #fff; max-width: 820px; }
.hero .lead { font-size: 1.15rem; color: #d6e2f7; max-width: 680px; margin-bottom: var(--s-8); }
.hero .tagline span { color: var(--solar-400); }
.hero .tagline span:nth-child(2) { color: #7ee2a8; }
.hero .tagline span:nth-child(4) { color: #a9c6ff; }

.search-panel {
  display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: var(--s-2);
  background: var(--surface); padding: var(--s-2); border-radius: var(--r-lg); box-shadow: var(--shadow-3); max-width: 920px;
}
.search-panel .input, .search-panel .select { border-color: transparent; background: var(--surface-2); }
@media (max-width: 760px) { .search-panel { grid-template-columns: 1fr; } }

/* ---------- sections ---------- */
.section-head { max-width: 760px; margin: 0 auto var(--s-10); text-align: center; }
.section-head p { color: var(--text-2); font-size: 1.05rem; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.page-hero { background: linear-gradient(150deg, var(--brand-900), var(--brand-700)); color: #fff; padding: var(--s-12) 0 var(--s-10); }
.page-hero h1 { color: #fff; margin-bottom: var(--s-2); }
.page-hero p { color: #d6e2f7; max-width: 720px; margin: 0; }
.breadcrumb { font-size: .85rem; color: #b9cbeb; margin-bottom: var(--s-3); }
.breadcrumb a { color: #fff; }

/* ---------- category grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-3); }
.cat-tile {
  display: flex; flex-direction: column; gap: 6px; padding: var(--s-4); border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  transition: transform .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.cat-tile:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow-2); }
.cat-tile .ico { width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 1.2rem; }
.cat-tile strong { font-size: .95rem; line-height: 1.3; }
.cat-tile .subtle { font-size: .8rem; }

/* ---------- feature / step cards ---------- */
.feature { padding: var(--s-6); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); height: 100%; }
.feature .ico { width: 48px; height: 48px; border-radius: var(--r); display: grid; place-items: center; margin-bottom: var(--s-4); background: var(--solar-100); color: var(--solar-600); font-size: 1.35rem; }
.feature h3 { font-size: 1.1rem; }
.feature p { color: var(--text-2); margin: 0; }
.steps { counter-reset: step; }
.step { position: relative; padding-left: 56px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--primary); color: var(--on-primary); }

/* ---------- stats band ---------- */
.stats-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.stats-band .stat { text-align: center; }
@media (max-width: 760px) { .stats-band { grid-template-columns: repeat(2, 1fr); } }

/* ---------- CTA band ---------- */
.cta-band { border-radius: var(--r-xl); padding: var(--s-10) var(--s-8); color: #fff; display: flex; gap: var(--s-6); align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600)); }
.cta-band h2 { color: #fff; margin: 0 0 var(--s-2); }
.cta-band p { color: #d6e2f7; margin: 0; }

/* ---------- Gold banner / Silver carousel (deck: homepage partner visibility) ---------- */
.gold-banner { position: relative; border-radius: var(--r-xl); overflow: hidden; min-height: 320px; display: flex; align-items: flex-end; background: var(--brand-900); color: #fff; box-shadow: var(--shadow-3); }
.gold-banner > img, .gold-banner > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gold-banner .overlay { position: relative; width: 100%; padding: var(--s-8); background: linear-gradient(0deg, rgba(6, 15, 30, .85), rgba(6, 15, 30, 0)); }
.gold-banner h3 { color: #fff; font-size: 1.6rem; margin-bottom: var(--s-2); }
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: var(--s-4); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s-2); scrollbar-width: thin; }
.carousel > * { scroll-snap-align: start; }
@media (max-width: 620px) { .carousel { grid-auto-columns: 82%; } }

/* ---------- company card (shared by home + directory) ---------- */
.co-card { display: flex; flex-direction: column; height: 100%; color: var(--text); }
.co-card:hover { text-decoration: none; }
.co-card .cover { aspect-ratio: 16 / 7; background: var(--surface-3) center / cover no-repeat; position: relative; }
.co-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.co-card .body { padding: var(--s-4) var(--s-5) var(--s-5); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.co-card .logo { width: 52px; height: 52px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); object-fit: contain; margin-top: -40px; position: relative; }
.co-card h3 { font-size: 1.05rem; margin: 0; }
.co-card .meta { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.co-card .desc { color: var(--text-2); font-size: .9rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.co-card .rating { color: var(--solar-600); font-weight: 700; font-size: .88rem; }
.co-card.tier-gold-card { border-color: var(--tier-gold); }
.co-card.tier-silver-card { border-color: var(--tier-silver); }

/* ---------- prose (legal / about) ---------- */
.prose { max-width: 820px; }
.prose h2 { margin-top: var(--s-10); font-size: 1.4rem; }
.prose h3 { margin-top: var(--s-6); }
.prose p, .prose li { color: var(--text-2); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 6px; }

/* ---------- footer extras ---------- */
.footer .brand { margin-bottom: var(--s-3); }
.footer-lead { color: #b9c9e6; font-size: .92rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .92rem; }
.footer-contact { font-style: normal; font-size: .88rem; line-height: 1.8; color: #b9c9e6; }
.footer .tagline span { color: var(--solar-400); }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding-block: var(--s-16); }   /* block only — keep .container's side gutter */
.not-found .code { font-size: clamp(4rem, 12vw, 7rem); font-weight: 800; line-height: 1; color: var(--primary); }
.not-found .row { justify-content: center; margin-top: var(--s-6); }
