/* =====================================================
   tomato agency — pages.css
   Styles for multi-page + blog components (built on style.css vars).
   Mobile-first; brand tokens: --red --pink --cream --ink etc.
   ===================================================== */

/* ---- Breadcrumbs ---- */
.crumbs {
  padding: 14px 0 0;
  font-family: var(--font-thai);
  font-size: var(--fz-sm);
}
.crumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--ink-soft);
}
.crumbs__list li + li::before {
  content: "›";
  margin-right: 6px;
  color: var(--ink-line);
}
.crumbs__list a { color: var(--ink-mid); text-decoration: none; }
.crumbs__list a:hover { color: var(--red); }
.crumbs__list [aria-current="page"] span { color: var(--ink); font-weight: 600; }

/* ---- Landing-page hero ---- */
.lp-hero {
  position: relative;
  padding: clamp(32px, 6vw, 72px) 0 clamp(24px, 4vw, 48px);
  background:
    radial-gradient(120% 120% at 12% 0%, var(--pink-soft) 0%, transparent 55%),
    radial-gradient(120% 120% at 100% 0%, var(--blue-soft) 0%, transparent 50%),
    var(--cream);
  overflow: hidden;
}
.lp-hero--accent {
  background:
    radial-gradient(130% 130% at 80% -10%, rgba(196,28,35,.16) 0%, transparent 55%),
    radial-gradient(120% 120% at 0% 0%, var(--pink-soft) 0%, transparent 55%),
    var(--cream);
}
.lp-hero__inner { max-width: 880px; }
.lp-kicker {
  display: inline-block;
  font-family: var(--font-thai);
  font-size: var(--fz-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--red);
  background: var(--white);
  border: 1px solid var(--ink-line);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.lp-title {
  font-family: var(--font-thai);
  font-weight: 700;
  font-size: var(--fz-3xl);
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 14px;
  letter-spacing: -.01em;
}
.lp-title__sub {
  display: block;
  font-size: var(--fz-lg);
  font-weight: 500;
  color: var(--ink-mid);
  margin-top: 6px;
}
.lp-lead {
  font-family: var(--font-thai);
  font-size: var(--fz-md);
  line-height: 1.7;
  color: var(--ink-mid);
  max-width: 60ch;
  margin: 0 0 22px;
}
.lp-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- Landing-page body / prose ---- */
.lp-body { padding: clamp(28px, 5vw, 56px) 0; }
.prose {
  max-width: 760px;
  font-family: var(--font-thai);
  font-size: var(--fz-base);
  line-height: 1.85;
  color: var(--ink-mid);
}
.prose > h2 {
  font-family: var(--font-thai);
  font-weight: 700;
  font-size: var(--fz-xl);
  line-height: 1.3;
  color: var(--ink);
  margin: 1.8em 0 .6em;
}
.prose > h3 {
  font-family: var(--font-thai);
  font-weight: 600;
  font-size: var(--fz-lg);
  color: var(--ink);
  margin: 1.4em 0 .5em;
}
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.prose li { margin-bottom: .5em; }
.prose a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--red-deep); }
/* buttons inside prose keep their own colors, not the link style */
.prose a.btn { color: var(--fg); text-decoration: none; }
.prose a.btn:hover { color: var(--fg); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose blockquote {
  border-left: 4px solid var(--pink);
  margin: 1.4em 0;
  padding: .4em 0 .4em 1.1em;
  color: var(--ink-mid);
  font-style: italic;
}
.prose hr { border: 0; border-top: 1px dashed var(--ink-line); margin: 2em 0; }
.prose figure { margin: 1.6em 0; }
.prose figure img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid var(--ink-line);
  box-shadow: 0 8px 26px rgba(0,0,0,.08);
}
.prose figcaption {
  margin: .7em auto 0;
  max-width: 520px;
  text-align: center;
  font-size: var(--fz-sm);
  color: var(--ink-soft);
  line-height: 1.55;
}
.prose figure img.is-zoomable { cursor: zoom-in; }

/* Blog image lightbox (JS-driven, scoped to .post__body img) */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 76px) 24px calc(env(safe-area-inset-bottom, 0px) + 24px);
  background: rgba(20, 12, 14, .82);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
}
.lightbox.is-open { display: flex; animation: lb-fade .18s var(--ease, ease); }
@keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox__fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  cursor: default;
}
.lightbox__img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,.5);
}
.lightbox__cap {
  margin: 14px auto 0;
  max-width: 720px;
  text-align: center;
  color: rgba(255,255,255,.86);
  font-size: var(--fz-sm);
  line-height: 1.55;
}
.lightbox__close {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: calc(env(safe-area-inset-right, 0px) + 16px);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.lightbox__close:hover { background: rgba(0,0,0,.72); transform: scale(1.06); }
@media (prefers-reduced-motion: reduce) {
  .lightbox.is-open { animation: none; }
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: var(--fz-sm);
}
.prose th, .prose td {
  border: 1px solid var(--ink-line);
  padding: .6em .8em;
  text-align: left;
  vertical-align: top;
}
.prose thead th { background: var(--pink-soft, #FFE5EE); color: var(--ink); font-weight: 700; }
.lp-related {
  margin-top: 2em;
  padding-top: 1.2em;
  border-top: 1px solid var(--ink-line);
  font-size: var(--fz-sm);
  color: var(--ink-soft);
}
.lp-meta-note { color: var(--ink-soft); font-size: var(--fz-sm); margin-top: 2em; }

/* ---- Landing-page FAQ block ---- */
.lp-faq { padding: 0 0 clamp(32px, 6vw, 64px); }
.lp-faq__title {
  font-family: var(--font-thai);
  font-weight: 700;
  font-size: var(--fz-xl);
  color: var(--ink);
  margin: 0 0 18px;
}

/* ---- Home: work types ---- */
.worktypes { padding: clamp(36px, 6vw, 72px) 0; background: var(--white); }
.worktypes__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
  justify-content: center;
}
@media (max-width: 900px) { .worktypes__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .worktypes__grid { grid-template-columns: minmax(0, 360px); justify-content: center; } }
.wtcard {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(160deg, var(--white) 0%, var(--pink-cream) 100%);
  border: 1px solid var(--ink-line);
  border-radius: var(--r-lg);
  padding: 24px 22px 24px;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  isolation: isolate;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
/* soft glow blob, top-right */
.wtcard::after {
  content: ""; position: absolute; top: -44px; right: -44px;
  width: 124px; height: 124px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, var(--pink-soft) 0%, transparent 70%);
  opacity: .65; transition: transform .45s var(--ease), opacity .3s var(--ease);
}
.wtcard:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--pink); }
.wtcard:hover::after { transform: scale(1.3); opacity: 1; }

.wtcard__icon {
  display: grid; place-items: center;
  width: 50px; height: 50px; border-radius: var(--r-md);
  background: var(--pink-soft); color: var(--red);
  margin-bottom: 16px;
  transition: transform .3s var(--ease), background .3s var(--ease);
}
.wtcard__icon svg { width: 25px; height: 25px; }
.wtcard__icon img { width: 32px; height: 32px; border-radius: 9px; display: block; }
.wtcard:hover .wtcard__icon { transform: scale(1.08) rotate(-4deg); }

.wtcard__kicker {
  display: inline-block;
  font-family: var(--font-thai);
  font-size: var(--fz-xs);
  font-weight: 700;
  color: var(--red);
  background: var(--pink-soft);
  border-radius: var(--r-pill);
  padding: 3px 11px;
  margin-bottom: 12px;
}
.wtcard h3 { font-family: var(--font-thai); font-size: var(--fz-lg); color: var(--ink); margin: 0 0 7px; font-weight: 700; }
.wtcard p { font-family: var(--font-thai); font-size: var(--fz-sm); color: var(--ink-soft); margin: 0; line-height: 1.6; }

/* featured (IDOL+) */
.wtcard--accent { background: linear-gradient(150deg, var(--red) 0%, var(--red-deep) 100%); border-color: transparent; box-shadow: var(--shadow-md); }
.wtcard--accent::after { background: radial-gradient(circle, rgba(255,255,255,.2) 0%, transparent 70%); opacity: 1; }
.wtcard--accent .wtcard__kicker { background: rgba(255,255,255,.22); color: #fff; }
.wtcard--accent h3 { color: #fff; }
.wtcard--accent p { color: rgba(255,255,255,.86); }
.wtcard--accent .wtcard__icon { background: rgba(255,255,255,.16); color: #fff; }
.wtcard--accent:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }

/* ---- Hero H1 Thai keyword line (home) ---- */
.hero__title-th {
  display: block;
  font-family: var(--font-thai);
  font-weight: 600;
  font-size: var(--fz-lg);
  color: var(--ink-mid);
  margin-top: 10px;
  letter-spacing: 0;
}

/* ---- Section head row (latest) ---- */
.section-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.latest { padding: clamp(36px, 6vw, 72px) 0; background: var(--cream); }
.latest__all { font-family: var(--font-thai); font-weight: 600; font-size: var(--fz-sm); color: var(--red); text-decoration: none; white-space: nowrap; }
.latest__all:hover { color: var(--red-deep); }

/* ---- Blog listing ---- */
.blog-list { padding: clamp(24px, 4vw, 48px) 0 clamp(40px, 7vw, 80px); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chip {
  font-family: var(--font-thai);
  font-size: var(--fz-sm);
  color: var(--ink-mid);
  background: var(--white);
  border: 1px solid var(--ink-line);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  text-decoration: none;
  transition: all .2s var(--ease-soft);
}
.chip:hover { border-color: var(--pink); color: var(--red); }
.chip.is-active { background: var(--red); border-color: var(--red); color: #fff; }

/* ---- Card grid + post cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}
.pcard {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--ink-line);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pcard__media { aspect-ratio: 1200 / 630; background: var(--pink-soft); overflow: hidden; }
.pcard__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.pcard__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--font-thai); font-size: var(--fz-xs); color: var(--ink-soft); }
.pcard__cat { color: var(--red); font-weight: 700; }
.pcard__title { font-family: var(--font-thai); font-weight: 700; font-size: var(--fz-md); line-height: 1.4; color: var(--ink); margin: 0; }
.pcard__excerpt { font-family: var(--font-thai); font-size: var(--fz-sm); line-height: 1.6; color: var(--ink-soft); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Single post ---- */
.post { padding: clamp(20px, 4vw, 40px) 0 clamp(36px, 6vw, 64px); }
.post__container { max-width: 820px; }
.post__head { margin-bottom: 22px; }
.post__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-family: var(--font-thai); font-size: var(--fz-sm); color: var(--ink-soft); margin-bottom: 14px; }
.post__cat { color: var(--red); font-weight: 700; text-decoration: none; background: var(--pink-soft); border-radius: var(--r-pill); padding: 4px 12px; }
.post__cat:hover { background: var(--pink); }
.post__title { font-family: var(--font-thai); font-weight: 700; font-size: var(--fz-2xl); line-height: 1.25; color: var(--ink); margin: 0 0 12px; letter-spacing: -.01em; }
.post__lead { font-family: var(--font-thai); font-size: var(--fz-md); line-height: 1.7; color: var(--ink-mid); margin: 0; }
.post__cover { margin: 0 0 28px; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-md); aspect-ratio: 1200 / 630; background: var(--pink-soft); }
.post__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post__body { /* uses .prose */ }
.post__faq { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--ink-line); }
.post__faq h2 { font-family: var(--font-thai); font-weight: 700; font-size: var(--fz-xl); color: var(--ink); margin: 0 0 16px; }

/* ---- Author box ---- */
.post__author {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 36px 0;
  padding: 22px;
  background: var(--cream);
  border: 1px solid var(--ink-line);
  border-radius: var(--r-lg);
}
.post__author img { width: 56px; height: 56px; border-radius: var(--r-pill); flex-shrink: 0; }
.post__author strong { font-family: var(--font-thai); font-size: var(--fz-md); color: var(--ink); display: block; margin-bottom: 4px; }
.post__author p { font-family: var(--font-thai); font-size: var(--fz-sm); line-height: 1.6; color: var(--ink-soft); margin: 0 0 8px; }
.post__author a { font-family: var(--font-thai); font-size: var(--fz-sm); color: var(--red); text-decoration: none; font-weight: 600; }
.post__author a:hover { color: var(--red-deep); }

/* ---- Related ---- */
.post__related { margin-top: 40px; }
.post__related-title { font-family: var(--font-thai); font-weight: 700; font-size: var(--fz-xl); color: var(--ink); margin: 0 0 20px; }

/* ---- Contact ---- */
.contact__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-bottom: 36px; }
.contact__card {
  display: block;
  background: var(--white);
  border: 1px solid var(--ink-line);
  border-radius: var(--r-lg);
  padding: 26px;
  text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.contact__card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--pink); }
.contact__card h2 { font-family: var(--font-thai); font-size: var(--fz-lg); color: var(--ink); margin: 0 0 6px; font-weight: 700; }
.contact__card p { font-family: var(--font-thai); font-size: var(--fz-md); color: var(--red); margin: 0 0 8px; font-weight: 600; }
.contact__card span { font-family: var(--font-thai); font-size: var(--fz-sm); color: var(--ink-soft); }
.contact__note { max-width: 760px; }

/* ---- FAQ "more" link on home ---- */
.faq__more { text-align: center; margin-top: 22px; font-family: var(--font-thai); font-size: var(--fz-sm); color: var(--ink-soft); }
.faq__more a { color: var(--red); text-decoration: none; font-weight: 600; }

/* ---- App store download buttons ---- */
.storebtns { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 4px 0 22px; }
.storebtn {
  display: inline-flex; align-items: center; gap: 10px;
  background: #111; color: #fff;
  border-radius: 14px; padding: 9px 18px 9px 15px;
  text-decoration: none; line-height: 1;
  border: 1px solid #111;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.storebtn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: #000; }
.storebtn svg { flex: none; }
.storebtn__txt { display: flex; flex-direction: column; gap: 2px; font-family: var(--font-sans); text-align: left; }
.storebtn__txt small { font-size: 10px; opacity: .82; letter-spacing: .02em; }
.storebtn__txt strong { font-size: var(--fz-md); font-weight: 700; letter-spacing: -.01em; }

/* ---- Featured app band (home) ---- */
.appfeat {
  padding: clamp(28px, 5vw, 56px) 0;
  background:
    radial-gradient(120% 130% at 100% 0%, var(--pink-soft) 0%, transparent 55%),
    var(--pink-cream);
}
.appfeat__inner {
  display: flex; align-items: center; gap: clamp(20px, 4vw, 44px);
  background: var(--white);
  border: 1px solid var(--ink-line);
  border-radius: var(--r-lg, 24px);
  padding: clamp(22px, 4vw, 38px);
  box-shadow: var(--shadow-sm);
}
.appfeat__logo img {
  width: clamp(96px, 14vw, 128px); height: auto;
  border-radius: 26px; display: block;
  box-shadow: var(--shadow-md);
}
.appfeat__body { flex: 1; min-width: 0; }
.appfeat__kicker {
  display: inline-block; font-family: var(--font-thai);
  font-size: var(--fz-xs); font-weight: 700; letter-spacing: .04em;
  color: var(--red); background: var(--pink-soft);
  border-radius: var(--r-pill); padding: 5px 13px; margin-bottom: 12px;
}
.appfeat__title { font-family: var(--font-thai); font-weight: 700; font-size: var(--fz-2xl); color: var(--ink); margin: 0 0 10px; line-height: 1.2; }
.appfeat__brand { color: var(--red); }
.appfeat__lead { font-family: var(--font-thai); font-size: var(--fz-md); line-height: 1.7; color: var(--ink-mid); max-width: 56ch; margin: 0 0 18px; }
.appfeat__more { align-self: center; }

/* ---- App landing hero (idol-plus) ---- */
.appland__hero { display: flex; align-items: center; gap: clamp(20px, 4vw, 40px); max-width: 960px; }
.appland__logo img { width: clamp(104px, 16vw, 132px); height: auto; border-radius: 28px; display: block; box-shadow: var(--shadow-md); }
.appland__head { flex: 1; min-width: 0; }
.appland__head .lp-title { margin-bottom: 10px; }

/* ---- Mobile tuning ---- */
@media (max-width: 640px) {
  .lp-hero__cta { flex-direction: column; align-items: stretch; }
  .lp-hero__cta .btn { justify-content: center; }
  .section-head--row { align-items: flex-start; }
  .post__author { flex-direction: column; }
  .appfeat__inner { flex-direction: column; text-align: center; }
  .appfeat__kicker { margin-inline: auto; }
  .appfeat__lead { margin-inline: auto; }
  .appfeat__logo img { margin-inline: auto; }
  .storebtns { justify-content: center; }
  .appland__hero { flex-direction: column; text-align: center; }
  .appland__logo img { margin-inline: auto; }
  .appland__head .lp-kicker { margin-inline: auto; }
  .appland__head .storebtns { justify-content: center; }
}
