/* footer.css: styles of the three footer variants for krobjobsystem.com (27 พ.ย. 2569), plus the skyline top edge and the navy colour set of the locked footer (block "skyline" at the end, owner 29 พ.ย. 2569).
   The same file serves all three; each <footer class="foot"> also carries foot-a, foot-b or foot-c, and that class only swaps colour tokens. Layout, type and spacing are shared.
   Responsive rules use CSS container queries, not media queries: the footer must be wrapped in an element with class foot-frame (container-type: inline-size), so the same markup lays out correctly full width on the site and inside the 390 px phone box on the choice page index.html.
   Vertical rhythm: every row in the three columns is --f-row tall, a heading is --f-gap-h above its first row, and the blocks of the organisation column (and the stacked columns on narrow screens) are --f-gap-block apart; no negative margins anywhere.
   Colour tokens come from the page's :root block (index.html today, the site's global tokens later): --navy --gold --blue --white --h-tint --h-ink --h-muted --h-line --font-head --font-body, plus the footer-only ones --navy-muted --navy-line --ph-ink --ph-bg --ph-ink-dark. Everything in px below is declared once as a custom property on .foot, so the rules themselves only ever use var(). */

/* ---------- container ---------- */
.foot-frame { container-type: inline-size; container-name: foot; }

/* ---------- size and colour tokens of the footer ---------- */
.foot {
  --f-fs: 15px;          /* body text in the footer */
  --f-fs-sm: 13px;       /* copyright, placeholder chips, tiny marks */
  --f-fs-md: 16px;       /* company name */
  --f-fs-h: 14px;        /* the small column headings (ติดต่อ, นโยบาย) */
  --f-fs-brand: 18px;    /* the written brand name next to the icon in variant B */
  --f-fs-tag: 14px;      /* the tagline under the logo (DESIGN.md: 14 px navy) */
  --f-lh: 1.6;
  --f-logo: 36px;        /* logo height, same as the site header */
  --f-tap: 44px;         /* minimum height of every link */
  /* vertical rhythm of the columns, three tokens only (28 พ.ย. 2569, owner: "จัดให้ทั้ง 3 คอลัมน์สมดุล"):
     --f-row       height of every key/value row, every policy link row and the registration row, so the lines of all three columns fall on one 44 px beat (the tap height, text centred inside)
     --f-gap-h     space between a column heading and its first row (the heading belongs to its list, so this is the smallest step)
     --f-gap-block space between the blocks of the organisation column (logo + tagline / company + address / registration) and, below 1000 px, between the stacked columns */
  --f-row: var(--f-tap);
  --f-gap-h: 4px;
  --f-gap-block: 16px;
  /* --f-pad-b is the padding under the grid of variants A and B, kept apart from the padding above (--f-s6, then --f-s7 from 1000 px) so that the space from the top edge of the footer to the first line of text equals the space from the last row of text to the copyright hairline (owner, 28 พ.ย. 2569: the gap above the ติดต่อ heading must match the gap under the เวลาทำการ row). The rows are 44 px tall with their text centred, so the text box of a 15 px row ends 10 px above the bottom of its row, and that 10 px is part of the gap under the last line; the value is worked out from a Playwright measurement in Chrome rather than guessed.
     29 พ.ย. 2569 (owner: "ลบ คู่มือการใช้งาน ดีกว่าบรรทัดจะได้เท่ากัน ลดความสูงของส่วนนี้ลงได้อีก"): the policy list lost its คู่มือการใช้งาน row, so the contact and policy columns are both 4 rows and end on the same beat, and the padding above the grid, this padding and the copyright band each came down one step. On the locked navy footer the top edge is the ground line of the skyline (no border); on variants A and B of index.html it is the 1 px top border, which adds 1 px to both sides of the comparison.
     Below 1000 px the first thing in the footer is the logo, whose top sits 32 px (--f-s6) under the top edge; the last line is the last row of the stacked or side-by-side lists, so the gap under it is 10 px of row slack + this padding. 32 − 10 = 22, rounded to the 24 px step (--f-s5), gives 34 px against 32 px (measured at 390: logo top 32, last policy text to hairline 35).
     From 1000 px the ติดต่อ heading text starts 38 px under the top edge (40 px padding, less the 2 px the Thai glyph box rises above the line box). With 4 rows the policy column now ends with the contact column, and the organisation column is the tallest: its registration row ends 23.6 px under the เวลาทำการ text (10 px row slack + 13.6 px, the row ends at 253.2 px against 239.6 px). So the gap under that text is 23.6 + this padding. 38 − 23.6 = 14.4, rounded to the 16 px step (--f-s4), gives 39.6 px against 38 px; the container query below swaps the value. */
  --f-pad-b: var(--f-s5);
  --f-icon: 20px;        /* Lucide icon size */
  --f-disc: 40px;        /* navy circle behind the icon */
  --f-s1: 4px;
  --f-s2: 8px;
  --f-s3: 12px;
  --f-s4: 16px;
  --f-s5: 24px;
  --f-s6: 32px;
  --f-s7: 40px;
  --f-s8: 48px;
  --f-wrap: 1200px;
  --f-addr: 330px;       /* line box of the address: at 15 px the break lands after แขวงบางปะกอก anywhere from 260 to 400 px, so 330 px sits in the middle of that range */
  --f-gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --f-gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --f-radius-sm: 6px;
  --f-ring: 3px;
  --f-ring-gap: 2px;
  --f-hair: 1px;
  --f-gold-rule: 2px;
  --f-chip-h: 26px;
  --f-chip-pad: 9px;
  --f-underline: 1px;
  --f-underline-hover: 2px;
  --f-underline-gap: 3px;
  --f-letter: 0.04em;
  --f-digits: 0.02em;
  /* variant A colours are the defaults: light footer on the tint */
  --f-bg: var(--h-tint);
  --f-ink: var(--h-ink);
  --f-muted: var(--h-muted);
  --f-line: var(--h-line);
  --f-link: var(--blue);
  --f-brand: var(--navy);
  --f-ring-c: var(--navy);
  --f-ph-ink: var(--ph-ink);
  --f-ph-bg: var(--ph-bg);

  background: var(--f-bg);
  color: var(--f-ink);
  font-family: var(--font-body);
  font-size: var(--f-fs);
  line-height: var(--f-lh);
  border-top: var(--f-hair) solid var(--f-line);
}
/* variant B: navy ground, white text, one 2 px gold rule along the top edge as the single gold accent */
.foot-b {
  --f-bg: var(--navy);
  --f-ink: var(--white);
  --f-muted: var(--navy-muted);
  --f-line: var(--navy-line);
  --f-link: var(--white);
  --f-brand: var(--white);
  --f-ring-c: var(--white);
  --f-ph-ink: var(--ph-ink-dark);
  --f-ph-bg: transparent;
  border-top: var(--f-gold-rule) solid var(--gold);
}
/* variant C: white ground, contact row first */
.foot-c { --f-bg: var(--white); }

.foot *, .foot *::before, .foot *::after { box-sizing: border-box; }
.foot h2, .foot p, .foot ul, .foot dl, .foot dd { margin: 0; }
.foot ul { padding: 0; list-style: none; }
.foot img { display: block; }

.foot-in {
  width: 100%;
  max-width: var(--f-wrap);
  margin: 0 auto;
  padding-left: var(--f-gutter-l);
  padding-right: var(--f-gutter-r);
}

/* ---------- links: 44 px tall, focus ring in the variant's ring colour ---------- */
/* The policy list links and the contact links in the key/value rows (tel:, LINE, mailto:, final.html) share one style: link colour, 500 weight, no underline at rest, underline on hover, 44 px tall by inline-flex so the row they sit in never clips the hit area. */
.foot a { color: var(--f-link); }
.foot a:focus-visible { outline: var(--f-ring) solid var(--f-ring-c); outline-offset: var(--f-ring-gap); border-radius: var(--f-radius-sm); }
.foot-list a,
.foot-kv a {
  display: inline-flex;
  align-items: center;
  min-height: var(--f-tap);
  text-decoration: none;
  font-weight: 500;
}
.foot-list a:hover,
.foot-kv a:hover { text-decoration: underline; text-decoration-thickness: var(--f-underline); text-underline-offset: var(--f-underline-gap); }
/* B: links underlined at rest (white on navy has no colour of its own to mark a link) */
.foot-b .foot-list a,
.foot-b .foot-kv a { text-decoration: underline; text-decoration-thickness: var(--f-underline); text-underline-offset: var(--f-underline-gap); text-decoration-color: var(--f-muted); }
.foot-b .foot-list a:hover,
.foot-b .foot-kv a:hover { text-decoration-color: var(--f-link); text-decoration-thickness: var(--f-underline-hover); }

/* ---------- logo and tagline ---------- */
.foot-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--f-s3);
  /* the image sits on the top edge of the box so the logo top lines up with the headings of the other two columns; the 44 px tap height comes from the padding under the image, not from centring the image in a taller box */
  padding-bottom: calc(var(--f-tap) - var(--f-logo));
  text-decoration: none;
  color: var(--f-brand);
}
.foot-logo img { height: var(--f-logo); width: auto; }
/* B has no light-on-dark lockup file: the icon file plus the brand name written in text (not a redrawn wordmark) */
.foot-brand { font-family: var(--font-head); font-weight: 700; font-size: var(--f-fs-brand); line-height: 1.2; color: var(--f-brand); }
.foot-tag { font-size: var(--f-fs-tag); font-weight: 500; color: var(--f-brand); line-height: 1.4; }
.foot-b .foot-tag { color: var(--f-muted); }

/* ---------- text pieces ---------- */
.foot-co { font-size: var(--f-fs-md); font-weight: 500; color: var(--f-ink); }
/* The address is balanced into two lines on the desktop column: "34 ซ.สุขสวัสดิ์ 26 แยก 9 แขวงบางปะกอก" then "เขตราษฎร์บูรณะ กรุงเทพฯ 10140". The max-width (token --f-addr) is a line box narrow enough to push the district onto the second line yet wide enough to hold the first, and text-wrap: balance evens the two lines out. On narrow screens the lines may break elsewhere, but the .nw spans in the markup keep แขวง and เขต names whole. */
.foot-addr { color: var(--f-ink); max-width: var(--f-addr); text-wrap: balance; }
.foot-h {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--f-fs-h);
  letter-spacing: var(--f-letter);
  line-height: 1.4;
  color: var(--f-muted);
}
.foot-k { color: var(--f-muted); }
.foot-v { color: var(--f-ink); }
/* digits that should line up: registration number, postcode, phone. Tabular figures of the body font, slightly spaced; no second font family.
   Scoped to .foot (29 พ.ย. 2569): pricing-demo.css also declares an unscoped .mono with letter-spacing var(--p-digits) and loads after this file on the assembled page ../index.html, so an unscoped rule here lost and the footer digits fell back to normal spacing (--p-digits is not defined outside .pd). .foot .mono outranks the bare .mono whatever the load order, so the assembled page needs no extra rule. */
.foot .mono { font-variant-numeric: tabular-nums; letter-spacing: var(--f-digits); }
.nw { white-space: nowrap; }

/* key/value rows: label first, value after, wraps to two lines when the column is narrow. Every row is --f-row (44 px) tall with its text centred, so rows with a link and the plain opening-hours row keep one rhythm, the same as the policy list rows and the registration row of the organisation column. */
.foot-kv { display: grid; gap: 0; }
.foot-kv > div { display: flex; flex-wrap: wrap; gap: 0 var(--f-s2); align-items: center; min-height: var(--f-row); }
.foot-list li { display: flex; align-items: center; min-height: var(--f-row); }
.foot-kv dt { color: var(--f-muted); flex: 0 0 auto; }
.foot-kv dd { color: var(--f-ink); display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 var(--f-s1); }

/* placeholder chip: a visible dashed gap, never a design element. Text "รอข้อมูลจริง". */
.ph {
  display: inline-flex;
  align-items: center;
  min-height: var(--f-chip-h);
  padding: 0 var(--f-chip-pad);
  border: var(--f-hair) dashed var(--f-ph-ink);
  border-radius: var(--f-radius-sm);
  background: var(--f-ph-bg);
  color: var(--f-ph-ink);
  font-size: var(--f-fs-sm);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

/* ---------- variants A and B: three columns like smartapi.co.th ---------- */
.foot-grid {
  display: grid;
  /* stacked columns are one block apart, the same step as the blocks inside the organisation column; the padding under the grid is --f-pad-b, smaller than the padding above it because the last row already carries 10 px of space under its text (see the token) */
  gap: var(--f-gap-block) var(--f-s5);
  padding-block: var(--f-s6) var(--f-pad-b);
}
/* organisation column: three blocks, logo + tagline, company + address, registration. No gap of its own; each block after the first starts --f-gap-block below the previous one, so the two block gaps are identical. */
.foot-org { display: grid; gap: 0; align-content: start; }
.foot-org .foot-co { margin-top: var(--f-gap-block); }
.foot-org .foot-reg { margin-top: var(--f-gap-block); }
/* the registration row is a row like the contact rows, --f-row tall. Its text sits on the top edge of the row rather than centred: it follows a paragraph (the address), not a heading, so the --f-gap-block above it then reads the same as the gap between the tagline and the company name, and at three columns its text lands within 4 px of the fourth row of the other two columns. The spare height is below the text, where the grid padding absorbs it. */
.foot-reg { display: flex; flex-wrap: wrap; gap: 0 var(--f-s2); align-items: start; min-height: var(--f-row); }
/* contact and policy columns: heading, then the rows --f-gap-h below it. The rows carry their own height, so nothing is pulled up or pushed down by hand. */
.foot-data, .foot-pol { display: grid; gap: var(--f-gap-h); align-content: start; }
/* copyright band: one step tighter since 29 พ.ย. 2569 (--f-s5 24 px became --f-s4 16 px), the same 16 px above and below the 13 px line */
.foot-bottom {
  border-top: var(--f-hair) solid var(--f-line);
  padding-block: var(--f-s4);
  color: var(--f-muted);
  font-size: var(--f-fs-sm);
}
/* two columns from 700 px: org on the left, the two text columns side by side on the right */
@container foot (min-width: 700px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-org { grid-column: 1 / -1; }
}
/* three columns from 1000 px (the smartapi grid): org 1.4 parts, data and policy 1 part each, one 48 px gutter between them, 40 px above and --f-pad-b (16 px here) below (48 and 24 px until 29 พ.ย. 2569), so the gap from the top edge to the ติดต่อ heading equals the gap from the เวลาทำการ row text to the copyright hairline */
@container foot (min-width: 1000px) {
  .foot { --f-pad-b: var(--f-s4); }
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: var(--f-gap-block) var(--f-s8); padding-block: var(--f-s7) var(--f-pad-b); }
  .foot-org { grid-column: auto; }
}

/* ---------- variant C: contact row first, fine print after ---------- */
.foot-c1 { display: grid; gap: var(--f-s6); padding-block: var(--f-s7) var(--f-s6); }
.foot-c .foot-org { gap: var(--f-s2); }
.foot-contacts { display: grid; gap: var(--f-s3); }
.foot-ci {
  display: flex;
  align-items: center;
  gap: var(--f-s3);
  min-height: var(--f-tap);
  color: var(--f-ink);
  text-decoration: none;
}
.foot-disc {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--f-disc);
  height: var(--f-disc);
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
}
.foot-disc svg { width: var(--f-icon); height: var(--f-icon); }
.foot-ci-text { display: grid; gap: 0; line-height: 1.4; }
.foot-ci-text .foot-k { font-size: var(--f-fs-sm); }
.foot-ci-text .foot-v { font-weight: 500; }
.foot-c2 {
  border-top: var(--f-hair) solid var(--f-line);
  padding-block: var(--f-s4) var(--f-s5);
  display: grid;
  gap: var(--f-s2);
  color: var(--f-muted);
  font-size: var(--f-fs-sm);
}
.foot-fine { color: var(--f-muted); }
.foot-fine .mono { color: var(--f-ink); }
/* inline link row: 44 px tall items separated by a middle dot */
.foot-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--f-s2); }
.foot-inline li { display: inline-flex; align-items: center; gap: var(--f-s2); }
.foot-inline li + li::before { content: "\00B7"; color: var(--f-muted); }
.foot-inline a {
  display: inline-flex;
  align-items: center;
  min-height: var(--f-tap);
  font-size: var(--f-fs);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: var(--f-underline);
  text-underline-offset: var(--f-underline-gap);
}
.foot-inline a:hover { text-decoration-thickness: var(--f-underline-hover); }
.foot-copy { color: var(--f-muted); }
/* contacts in two columns from 560 px, four in a row and beside the logo from 1000 px */
@container foot (min-width: 560px) {
  .foot-contacts { grid-template-columns: 1fr 1fr; gap: var(--f-s3) var(--f-s5); }
}
@container foot (min-width: 1000px) {
  .foot-c1 { grid-template-columns: auto 1fr; align-items: center; gap: var(--f-s8); padding-block: var(--f-s8) var(--f-s7); }
  .foot-contacts { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--f-s5); }
}

/* ---------- skyline: the top edge of the locked footer (owner 29 พ.ย. 2569) ----------
   Owner's pick 29 พ.ย. 2569 from skyline/index.html, variant 1 "พื้น navy เมืองสีเดียวกับ footer": footer A, same markup and
   the same rules above, so every row sits where it sat in the tint footer A of 27 พ.ย. 2569 (owner: "การจัดวางตรงนี้ต้องเหมือนเดิม
   นะ แต่เปลี่ยนสีอักษรได้"). Markup: <footer class="foot foot-a foot-sky foot-sky-navy">, first child <div class="sky" aria-hidden="true">
   (so the footer landmark and its content are unchanged), logo img/logo-krobjob-lockup-dark.svg (the same lockup with a white
   wordmark, see img/README.md). Used by final.html and ../index.html; skyline/index.html keeps the comparison of both variants.
   .foot-sky   the silhouette band. .sky is a block of --sky-c cut by img/skyline.svg used as a CSS mask: one vector asset, the
               colour comes from CSS. The url() resolves against this file, so every page that loads footer.css gets the same file.
               mask-size cover + position 50% 100% equals preserveAspectRatio="xMidYMax slice": the ground line sits on the bottom
               edge and narrow boxes crop both sides evenly instead of shrinking the city to a sliver.
               Height follows the footer's own width (cqi of the .foot-frame container): 56 px at 800 px wide and under, 120 px from
               1714 px; on the site, where the footer is full width, 7cqi equals 7vw. No motion.
               Behind the city the footer paints --sky-above, the ground of the section above (ราคาและนัด Demo แบบ B, --p-bg of
               .pd-b = --h-tint), so the sky is that section continuing down even where the page chrome behind it is dark. That
               band is a gradient layer that stops 1 px ABOVE the bottom of the silhouette (--sky-overlap), over a background-color
               of --f-bg: whatever fraction of a pixel the mask's bottom edge lands on, the row under it is already footer colour,
               so no hairline shows at the seam. Keeping --f-bg as the background-color (not a layer) also lets contrast checkers
               that read background-color see the real navy behind the text.
               No border-top: the silhouette's ground replaces the 1 px line of footer A.
   .foot-sky-navy  only re-points the colour tokens footer A reads to the navy set (white text, --navy-muted labels and copyright,
               --navy-line hairline, white links and focus ring); no rule, size or spacing changes, links keep footer A's treatment
               (no underline at rest, underline on hover). --sky-c follows --f-bg, so the city and the footer are one navy shape.
               Contrast on #0a1628: white 17.9:1, --navy-muted #a9b5cc 9.3:1. No gold text: the gold j-dot and check are inside the
               lockup image, which is the logo, not page gold. */
.foot.foot-sky {
  --sky-h: clamp(56px, 7cqi, 120px);
  --sky-overlap: 1px;
  --sky-c: var(--f-bg);
  --sky-above: var(--h-tint);
  border-top: 0;
  background: linear-gradient(var(--sky-above), var(--sky-above)) 0 0 / 100% calc(var(--sky-h) - var(--sky-overlap)) no-repeat var(--f-bg);
}
.foot.foot-sky-navy {
  --f-bg: var(--navy);
  --f-ink: var(--white);
  --f-muted: var(--navy-muted);
  --f-line: var(--navy-line);
  --f-link: var(--white);
  --f-brand: var(--white);
  --f-ring-c: var(--white);
}
.foot-sky .sky {
  display: block;
  height: var(--sky-h);
  background-color: var(--sky-c);
  -webkit-mask: url(img/skyline.svg) 50% 100% / cover no-repeat;
  mask: url(img/skyline.svg) 50% 100% / cover no-repeat;
}
