/* ===========================================================
   น้ำดื่มภูหิรัญ 99 — landing page
   Tokens lifted from the Figma file "phuhiran" (frame Desktop - 3)
   =========================================================== */

:root{
  /* palette */
  --bg:            #f9fafb;
  --surface:       #ffffff;
  --border:        #e5e7eb;
  --ink:           #111827;
  --ink-strong:    #1a1a1a;
  --muted:         #6b7280;
  --muted-2:       #666666;
  --primary:       #3b82f6;
  --primary-ink:   #ffffff;

  /* hero backdrop, sampled from the banner artwork */
  --hero-wall:     #8d9aa4;
  --hero-floor:    #c9cfd4;

  /* shape */
  --r-card:        16px;
  --r-icon:        12px;
  --r-pill:        70px;
  --shadow-card:   0 4px 8px rgba(0,0,0,.05);
  --shadow-btn:    0 8px 20px -4px rgba(59,130,246,.35);
  --shadow-header: 0 1px 0 rgba(17,24,39,.06), 0 8px 24px -18px rgba(17,24,39,.35);

  /* metrics */
  --container:     1326px;   /* 1278 content + 2x24 gutter */
  --gutter:        24px;
  --header-h:      101px;
}

*,*::before,*::after{ box-sizing:border-box; }

html{ scroll-behavior:smooth; }
@media (prefers-reduced-motion:reduce){ html{ scroll-behavior:auto; } }

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:"Noto Sans Thai","Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:16px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

img{ max-width:100%; display:block; }
a{ color:inherit; text-decoration:none; }
h1,h2,h3,p,figure,address,ul,ol{ margin:0; }
ul,ol{ padding:0; list-style:none; }
address{ font-style:normal; }

.container{
  width:100%;
  max-width:var(--container);
  margin-inline:auto;
  padding-inline:var(--gutter);
}

.skip-link{
  position:absolute; left:-9999px; top:0; z-index:100;
  background:var(--primary); color:#fff; padding:12px 20px; border-radius:0 0 10px 0;
}
.skip-link:focus{ left:0; }

:where(a,button,[tabindex]):focus-visible{
  outline:3px solid var(--primary);
  outline-offset:3px;
  border-radius:6px;
}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  height:48px; padding-inline:24px;
  border:1px solid transparent; border-radius:var(--r-pill);
  font:inherit; font-weight:600; font-size:16px; white-space:nowrap;
  cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.btn svg{ width:20px; height:20px; flex:none; }
.btn--primary{ background:var(--primary); color:var(--primary-ink); box-shadow:var(--shadow-btn); }
.btn--primary:hover{ background:#2f74ea; transform:translateY(-1px); }
.btn--ghost{ background:var(--surface); color:var(--ink); border-color:var(--border); }
.btn--ghost:hover{ background:#f3f4f6; }
.btn--lg{ height:56px; }
.btn--block{ flex:1 1 auto; }
@media (prefers-reduced-motion:reduce){ .btn:hover{ transform:none; } }

/* ---------- shared icon chip ---------- */
.icon-wrap{
  display:inline-flex; align-items:center; justify-content:center;
  width:48px; height:48px; flex:none;
  background:var(--tint,#eff6ff); border-radius:var(--r-icon);
  color:var(--primary);
}
.icon-wrap--sm{ width:44px; height:44px; }
.icon-wrap svg{ width:20px; height:20px; }
.icon-wrap img{ width:20px; height:20px; }

/* ===========================================================
   Header
   =========================================================== */
.site-header{
  position:sticky; top:0; z-index:50;
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:saturate(1.4) blur(10px);
  transition:box-shadow .2s ease, background-color .2s ease;
}
.site-header.is-stuck{ box-shadow:var(--shadow-header); background:color-mix(in srgb, var(--bg) 96%, transparent); }

.site-header__inner{
  /* Full-bleed: the brand sits at the left edge and the language switcher +
     CTA at the right edge, rather than stopping inside the 1326px content
     column. Uncapped, so it keeps spanning on monitors wider than 1440. */
  max-width:none;
  padding-inline:var(--gutter);
  height:var(--header-h);
  /* Equal 1fr side columns put the nav at true viewport centre. With flex +
     margin-inline:auto it only centred in the space left over between the
     logo and the actions, which are very different widths. */
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:24px;
}
.site-header__actions{
  display:flex; align-items:center; gap:12px;
  justify-self:end;
}
.brand{ flex:none; justify-self:start; }
.brand img{ width:auto; height:66px; }

.nav{
  justify-self:center;
  display:flex; align-items:center; gap:32px;
  font-size:20px;
}
.nav a{ color:#000; padding-block:4px; position:relative; }
.nav a::after{
  content:""; position:absolute; left:0; right:100%; bottom:0; height:2px;
  background:var(--primary); transition:right .22s ease;
}
.nav a:hover::after, .nav a.is-active::after{ right:0; }

.site-header__cta{ width:150px; height:60px; flex:none; }

/* ---------- language switcher ----------
   A two-option segmented control: both languages are always visible and the
   current one is marked, so the control shows state rather than only an action. */
.langswitch{
  display:inline-flex; align-items:center; flex:none;
  padding:3px; gap:2px;
  border:1px solid var(--border); border-radius:var(--r-pill);
  background:var(--surface);
}
.langswitch a{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:44px; height:32px; padding-inline:12px;
  border-radius:var(--r-pill);
  font-size:14px; font-weight:600; letter-spacing:.03em;
  color:var(--muted); white-space:nowrap;
  transition:background-color .18s ease, color .18s ease;
}
.langswitch a:hover{ color:var(--ink); background:#f3f4f6; }
.langswitch a[aria-current]{
  background:var(--primary); color:var(--primary-ink);
}
.langswitch a[aria-current]:hover{ background:var(--primary); }
.langswitch a:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; }

.nav-toggle{
  display:none;
  width:44px; height:44px; flex:none;
  background:none; border:1px solid var(--border); border-radius:12px;
  padding:0; cursor:pointer;
}
.nav-toggle span{
  display:block; width:20px; height:2px; margin:4px auto;
  background:var(--ink); border-radius:2px; transition:transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform:translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity:0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform:translateY(-6px) rotate(-45deg); }

/* ===========================================================
   Hero
   =========================================================== */
.hero{
  position:relative;
  aspect-ratio:1440/571;
  overflow:hidden;
  background:linear-gradient(180deg,var(--hero-wall) 0%,var(--hero-wall) 80%,var(--hero-floor) 80%,var(--hero-floor) 100%);
}
.hero__media{ position:absolute; inset:0; }
.hero__media img{ width:100%; height:100%; object-fit:cover; object-position:center; }

.hero__inner{ position:relative; height:100%; }

/* The desktop banner already carries its headline as artwork, so the HTML copy
   is only revealed on small screens where that baked-in text is unreadable. */
.hero__copy{ display:none; }
.hero__wordmark{ display:none; }

/* ===========================================================
   Sections
   =========================================================== */
.section{ padding-bottom:60px; }
.section--about{ padding-top:34px; }

.section__header{
  display:flex; flex-direction:column; align-items:center; gap:12px;
  text-align:center;
  padding-block:0 40px;
}
.section__title{
  font-size:40px; font-weight:700; line-height:1.2;
  color:var(--ink-strong); letter-spacing:-.01em;
}
.section__subtitle{ font-size:16px; color:var(--muted-2); max-width:720px; }

/* ---------- about ---------- */
.section--about .section__title{ text-align:center; }
.rule{
  width:min(667px,100%); height:1px; margin:20px auto 19px;
  border:0; background:var(--border);
}
.about__body{
  max-width:1128px; margin-inline:auto; text-align:center;
  font-size:14px; line-height:1.65; color:var(--muted);
}

/* ---------- service cards ---------- */
.cards{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:43px 39px;
}
.card{
  display:flex; flex-direction:column; gap:16px;
  min-height:250px; padding:24px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-card); box-shadow:var(--shadow-card);
  transition:transform .2s ease, box-shadow .2s ease;
}
.card:hover{ transform:translateY(-3px); box-shadow:0 14px 30px -18px rgba(17,24,39,.45); }
.card__title{ font-size:18px; font-weight:700; color:var(--ink); }
.card__body{ font-size:14px; line-height:1.5; color:var(--muted); }
@media (prefers-reduced-motion:reduce){ .card:hover{ transform:none; } }

/* ---------- photo gallery ---------- */
.gallery{
  display:grid; grid-template-columns:repeat(4,1fr); gap:26px;
}
.shot{
  position:relative; overflow:hidden;
  aspect-ratio:300/340;
  border:1px solid var(--border); border-radius:var(--r-card);
  box-shadow:var(--shadow-card);
}
.shot img{ width:100%; height:100%; object-fit:cover; transition:transform .5s ease; }
.shot:hover img{ transform:scale(1.04); }
.shot figcaption{
  position:absolute; inset-inline:0; bottom:0;
  padding:60px 16px 18px;
  color:#fff; font-size:15px; font-weight:600;
  background:linear-gradient(to bottom,rgba(0,0,0,0) 0%,rgba(0,0,0,.30) 42%,rgba(0,0,0,.86) 100%);
}
/* photo-line is a panel cropped out of a wider composite banner —
   the numbers mirror the imageTransform used on the Figma node. */
.shot--crop img{
  position:absolute; top:-18.42%; left:-288.52%;
  width:389%; height:auto; max-width:none;   /* right edge lands just inside 100% */
  object-fit:fill;
}
.shot--crop:hover img{ transform:none; }
@media (prefers-reduced-motion:reduce){ .shot:hover img{ transform:none; } }

/* ---------- process steps ---------- */
.steps{
  display:grid; grid-template-columns:repeat(6,1fr); column-gap:56px;
}
.step{
  position:relative;
  display:flex; flex-direction:column; align-items:center; gap:12px;
  text-align:center;
}
.step:not(:last-child)::after{
  content:""; position:absolute; top:0; left:100%;
  width:56px; height:48px;
  background:url("../img/icons/connector.svg") no-repeat center / 56px 48px;
}
.step__title{ font-size:18px; font-weight:700; color:var(--ink); }
.step__body{ font-size:14px; line-height:1.5; color:var(--muted); }

/* ===========================================================
   Contact
   =========================================================== */
.contact{
  display:grid; grid-template-columns:repeat(2,1fr); gap:38px;
  align-items:stretch;
}
.panel{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--r-card); box-shadow:var(--shadow-card);
  overflow:hidden;
}
.panel__title{ font-size:24px; font-weight:700; color:var(--ink); }
.panel__title--sm{ font-size:20px; }

.contact__info{ display:flex; flex-direction:column; gap:24px; padding:32px; }
.contact__head{ display:flex; flex-direction:column; gap:6px; }
.contact__company{ font-size:16px; font-weight:600; color:var(--primary); }

.facts{ display:flex; flex-direction:column; gap:20px; }
.fact{ display:flex; align-items:flex-start; gap:16px; }
.fact__label{ display:block; font-size:13px; color:var(--muted); margin-bottom:4px; }
.fact__value{ font-size:16px; line-height:1.5; color:var(--ink); }
.fact__value--strong{ font-weight:600; }
.fact__value a{ border-bottom:1px solid transparent; transition:border-color .18s ease, color .18s ease; }
.fact__value a:hover{ color:var(--primary); border-bottom-color:currentColor; }

.contact__cta{ display:flex; gap:12px; margin-top:auto; flex-wrap:wrap; }

/* ---------- map ---------- */
.contact__map{ display:flex; flex-direction:column; }
.mapshot{
  position:relative; display:block;
  flex:1 1 auto; min-height:280px;
  overflow:hidden; background:#eceae4;
}
.mapshot img{ width:100%; height:100%; object-fit:cover; }
.mapshot__pin{
  position:absolute; left:50%; top:50%;
  width:36px; height:46px; margin-left:-18px; margin-top:-46px;
  filter:drop-shadow(0 4px 8px rgba(17,24,39,.35));
}
.mapshot__pin svg{ width:100%; height:100%; }
.mapshot__pin::before{
  content:""; position:absolute; left:50%; top:46px;
  width:76px; height:76px; margin:-38px 0 0 -38px;
  border-radius:50%;
  background:rgba(59,130,246,.16); border:1.5px solid rgba(59,130,246,.35);
  z-index:-1;
}
.mapshot__label{
  position:absolute; left:50%; top:50%;
  transform:translate(-50%,calc(-46px - 100% - 10px));
  background:#fff; color:var(--ink);
  font-size:13px; font-weight:600; white-space:nowrap;
  padding:8px 12px; border-radius:8px;
  box-shadow:0 2px 8px rgba(0,0,0,.18);
}
.mapshot__attr{
  position:absolute; right:8px; bottom:8px;
  background:rgba(255,255,255,.82); color:var(--muted);
  font-size:10px; padding:3px 6px; border-radius:4px;
}

.mapinfo{ display:flex; flex-direction:column; gap:16px; padding:24px; }
.mapinfo__addr{ font-size:14px; line-height:1.5; color:var(--muted); }
.mapinfo__row{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.chip{
  background:#eff6ff; color:var(--primary);
  font-size:13px; font-weight:600;
  padding:10px 14px; border-radius:8px;
}
.mapinfo__row .btn{ margin-inline-start:auto; }

/* ===========================================================
   Footer + floating call
   =========================================================== */
.site-footer{
  background:#d9d9d9; color:#000;
  min-height:60px; display:flex; align-items:center;
  font-size:12px;
}
.site-footer .container{ text-align:center; }

.callfab{
  position:fixed; right:16px; bottom:16px; z-index:40;
  display:none; align-items:center; justify-content:center;
  width:56px; height:56px; border-radius:50%;
  background:var(--primary); color:#fff; box-shadow:var(--shadow-btn);
}
.callfab svg{ width:24px; height:24px; }

/* ===========================================================
   Reveal on scroll
   =========================================================== */
.reveal{ opacity:0; transform:translateY(14px); transition:opacity .5s ease, transform .5s ease; }
.reveal.is-in{ opacity:1; transform:none; }
@media (prefers-reduced-motion:reduce){
  .reveal{ opacity:1; transform:none; transition:none; }
}

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width:1180px){
  .section__title{ font-size:34px; }
  .cards{ grid-template-columns:repeat(2,1fr); gap:32px 28px; }
  .steps{ grid-template-columns:repeat(3,1fr); row-gap:40px; column-gap:32px; }
  .step:not(:last-child)::after{ display:none; }
}

@media (max-width:960px){
  :root{ --header-h:76px; --gutter:20px; }
  .brand img{ height:52px; }
  /* Nav leaves the flow here (it becomes the dropdown), so the 3-column grid
     no longer applies — fall back to a simple row. */
  .site-header__inner{ display:flex; }
  .site-header__actions{ margin-inline-start:auto; }
  .site-header__cta{ display:none; }
  .langswitch{ padding:2px; }
  .langswitch a{ min-width:40px; height:30px; padding-inline:10px; font-size:13px; }
  .nav-toggle{ display:block; }

  .nav{
    position:absolute; inset-inline:0; top:var(--header-h);
    flex-direction:column; align-items:stretch; gap:0;
    background:var(--surface); border-block:1px solid var(--border);
    padding:8px 20px 16px;
    font-size:18px;
    display:none;
  }
  .nav.is-open{ display:flex; }
  .nav a{ padding:14px 4px; border-bottom:1px solid var(--border); }
  .nav a:last-child{ border-bottom:0; }
  .nav a::after{ display:none; }

  .gallery{ grid-template-columns:repeat(2,1fr); gap:20px; }
  .contact{ grid-template-columns:1fr; gap:24px; }
  .mapshot{ aspect-ratio:16/10; min-height:0; }
}

/* ---- hero: the banner's headline is baked into the artwork. At 1024 it still
   renders ~28px (readable), so the banner is kept intact down to 961. At and
   below 960 it drops under ~20px, so switch to a bottle-framed crop with the
   copy as real HTML text. Crossing this line too early shows BOTH the baked-in
   text and the HTML copy at once. ---- */
@media (max-width:960px){
  .hero{ aspect-ratio:auto; min-height:clamp(420px,68vh,560px); display:flex; flex-direction:column; }
  .hero__media img{ object-position:22% center; }
  .hero__media::after{
    content:""; position:absolute; inset:0;
    background:linear-gradient(180deg,rgba(20,28,36,.05) 0%,rgba(20,28,36,.45) 46%,rgba(20,28,36,.78) 100%);
  }
  .hero__inner{
    /* .hero has only a min-height here, so height:100% would resolve to auto and
       justify-content would have no free space to push the copy down. */
    height:auto; flex:1;
    display:flex; flex-direction:column; justify-content:flex-end;
    padding-block:36px;
  }
  .hero__copy{ display:block; color:#fff; max-width:620px; }
  .hero__quote{
    font-size:16px; line-height:1.6; color:rgba(255,255,255,.92);
    margin-bottom:16px; text-wrap:pretty;
  }
  .hero__mark{ opacity:.7; }
  .hero__title{ font-size:32px; font-weight:700; line-height:1.3; }
  .hero__wordmark{
    display:block; position:absolute; top:24px; right:var(--gutter);
    text-align:right; color:#fff;
  }
  .hero__wordmark span{ display:block; font-size:22px; letter-spacing:.14em; }
  .hero__wordmark small{ display:block; font-size:12px; opacity:.85; }
}

@media (max-width:760px){
  .hero__quote{ font-size:15px; }
  .hero__title{ font-size:26px; }
  .hero__wordmark span{ font-size:20px; }
  .section__title{ font-size:28px; }
  .section__subtitle{ font-size:15px; }
  .section__header{ padding-bottom:28px; }
  .section{ padding-bottom:44px; }


  .cards{ grid-template-columns:1fr; gap:16px; }
  .card{ min-height:0; }
  .steps{ grid-template-columns:repeat(2,1fr); row-gap:32px; column-gap:20px; }

  .contact__info{ padding:24px; gap:20px; }
  .contact__cta{ flex-direction:column; }
  .contact__cta .btn{ width:100%; }
  .mapinfo__row .btn{ margin-inline-start:0; width:100%; }

  .callfab{ display:flex; }
}

@media (max-width:480px){
  .gallery{ grid-template-columns:1fr; }
  .steps{ grid-template-columns:1fr; }
  .step{ align-items:flex-start; text-align:start; }
}

/* ===========================================================
   Text-free banner variant (.hero--plain)
   The English page uses a banner with no baked-in type, so the headline
   is real HTML at every width: translatable, selectable and indexable.
   Only the >=961 case needs new rules; below that the existing
   small-screen hero treatment already renders the copy as text.
   =========================================================== */
@media (min-width:961px){
  .hero--plain .hero__inner{ display:flex; align-items:center; }
  .hero--plain .hero__copy{
    display:block; color:#fff;
    margin-inline-start:auto; max-width:min(46%,620px);
  }
  .hero--plain .hero__quote{
    font-size:18px; line-height:1.6; color:rgba(255,255,255,.92);
    margin-bottom:12px; text-wrap:pretty;
  }
  .hero--plain .hero__mark{ opacity:.7; }
  .hero--plain .hero__title{ font-size:40px; font-weight:700; line-height:1.25; }
  .hero--plain .hero__wordmark{
    display:block; position:absolute; top:28px; right:var(--gutter);
    text-align:right; color:#fff;
  }
  .hero--plain .hero__wordmark span{ display:block; font-size:34px; letter-spacing:.14em; }
  .hero--plain .hero__wordmark small{ display:block; font-size:14px; opacity:.85; }
}

/* Between 961 and 1180 the banner is short enough that a full-size wordmark
   collides with the quote. Shrink it and pull the copy in. */
@media (min-width:961px) and (max-width:1180px){
  .hero--plain .hero__wordmark span{ font-size:24px; }
  .hero--plain .hero__wordmark small{ font-size:12px; }
  .hero--plain .hero__copy{ max-width:min(52%,560px); }
  .hero--plain .hero__quote{ font-size:16px; }
  .hero--plain .hero__title{ font-size:32px; }
}

/* ===========================================================
   Tablet / iPad — 761px and up, below the desktop tiers
   iPad portrait (768) already gets 2-up cards + 3-up steps from the
   1180 tier and a collapsed nav from the 960 tier. What it did not have:
   a 3-up gallery in landscape (4-up leaves ~225px cards at 1024) and a
   hero whose copy does not run the full width of the banner.
   =========================================================== */
@media (min-width:961px) and (max-width:1180px){
  .gallery{ grid-template-columns:repeat(3,1fr); gap:22px; }
  .contact{ gap:28px; }
  /* Tighten the nav so the header's 1fr side columns can stay equal and the
     menu remains centred — longer labels (e.g. the English page) otherwise
     force the centre column off-axis at this width. */
  .nav{ font-size:17px; gap:24px; }
  .site-header__inner{ gap:16px; }
}

/* Hero on portrait tablets: the small-screen treatment applies, but the frame
   is wide enough that a phone-sized crop would leave the artwork's baked-in
   text inside the viewport. A taller hero zooms the image further, and pulling
   the crop left pushes that text off-screen. */
@media (min-width:761px) and (max-width:960px){
  .hero{ min-height:clamp(560px,72vh,760px); }
  .hero__media img{ object-position:12% center; }
  .hero__copy{ max-width:min(72%,620px); }
  .hero__title{ font-size:38px; }
  .hero__quote{ font-size:17px; }
  .hero__wordmark span{ font-size:26px; }
}

@media print{
  .site-header,.callfab,.hero__media{ display:none; }
  body{ background:#fff; }
  .panel,.card,.shot{ box-shadow:none; }
}
