/*
  Sarocha Law — shared header, mobile menu, sticky contact bar and footer for
  inner pages (blog, area pages, about, policies). Mirrors the homepage's
  dark-luxe header/sticky bar/footer so every page reads as one site.
  Paired with /assets/js/site-chrome.js. Class names are prefixed sc- so the
  pages' older inline header/footer rules never match; descendant rules use
  two classes so element selectors like `header a:first-child` can't win.
*/

/* ---------- header ---------- */
.sc-header {
  position: sticky;
  top: 0;
  z-index: 70;
  width: auto;
  margin: 0;
  padding: 0;
  display: block;
  border: 0;
  border-bottom: 1px solid rgba(227, 203, 149, 0.16);
  background: rgba(10, 21, 38, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #f7f3ec;
  font-family: "IBM Plex Sans Thai", "Noto Sans Thai", Tahoma, sans-serif;
  line-height: 1.5;
}

.sc-header .sc-wrap {
  width: min(1200px, calc(100vw - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sc-header .sc-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  color: #f7f3ec;
  font-size: inherit;
  font-weight: 400;
  text-decoration: none;
}

.sc-header .sc-brand img {
  display: block;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
}

.sc-header .sc-brand span {
  display: grid;
  line-height: 1.2;
}

.sc-header .sc-brand strong {
  color: #f7f3ec;
  font-family: "Anuphan", "IBM Plex Sans Thai", Tahoma, sans-serif;
  font-size: 17px;
  font-weight: 700;
}

.sc-header .sc-brand small {
  color: rgba(227, 203, 149, 0.8);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.sc-header .sc-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.sc-header .sc-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: rgba(247, 243, 236, 0.82);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.sc-header .sc-nav a:hover,
.sc-header .sc-nav a[aria-current="page"] {
  color: #fff;
  background: rgba(227, 203, 149, 0.1);
}

.sc-header .sc-nav .sc-nav-contact,
.sc-header .sc-nav .sc-nav-extra {
  display: none;
}

.sc-header .sc-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sc-header .sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.sc-header .sc-btn-call {
  border: 1px solid rgba(227, 203, 149, 0.55);
  color: #e3cb95;
}

.sc-header .sc-btn-call:hover {
  background: rgba(227, 203, 149, 0.1);
}

.sc-header .sc-btn-line {
  background: #0b7a53;
  color: #fff;
}

.sc-header .sc-btn-line:hover {
  background: #086a49;
}

.sc-header .sc-menu {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(247, 243, 236, 0.24);
  border-radius: 12px;
  background: transparent;
  color: #f7f3ec;
  cursor: pointer;
}

.sc-menu-lines,
.sc-menu-lines::before,
.sc-menu-lines::after {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.sc-menu-lines::before,
.sc-menu-lines::after {
  content: "";
}

.sc-menu-lines::before {
  transform: translateY(-6px);
}

.sc-menu-lines::after {
  transform: translateY(4px);
}

.sc-menu-open .sc-menu-lines {
  background: transparent;
}

.sc-menu-open .sc-menu-lines::before {
  background: currentColor;
  transform: translateY(0) rotate(45deg);
}

.sc-menu-open .sc-menu-lines::after {
  background: currentColor;
  transform: translateY(-2px) rotate(-45deg);
}

.sc-header :focus-visible,
.sc-sticky :focus-visible,
.sc-footer :focus-visible {
  outline: 2px solid rgba(227, 203, 149, 0.9);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .sc-header .sc-actions .sc-btn-call {
    display: none;
  }

  .sc-header .sc-nav a {
    padding: 0 9px;
  }
}

/* ---------- mobile / tablet menu ---------- */
@media (max-width: 980px) {
  .sc-header .sc-wrap {
    min-height: 60px;
  }

  .sc-header .sc-actions .sc-btn {
    display: none;
  }

  .sc-header .sc-menu {
    display: inline-grid;
  }

  .sc-header .sc-brand img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .sc-header .sc-brand strong {
    font-size: 15px;
  }

  /* The header's backdrop-filter makes it the containing block for this
     fixed panel, so it is sized from the viewport explicitly. */
  .sc-header .sc-nav {
    position: fixed;
    left: 0;
    right: 0;
    top: 60px;
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
    display: grid;
    align-content: start;
    gap: 0;
    padding: 12px 20px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #0a1526;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-12px);
    transition: transform 180ms ease, opacity 180ms ease, visibility 0s linear 180ms;
  }

  .sc-menu-open .sc-header .sc-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: transform 180ms ease, opacity 180ms ease, visibility 0s linear 0s;
  }

  .sc-header .sc-nav a {
    min-height: 54px;
    padding: 0;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 16px;
  }

  .sc-header .sc-nav a:hover,
  .sc-header .sc-nav a[aria-current="page"] {
    background: transparent;
    color: #e3cb95;
  }

  .sc-header .sc-nav .sc-nav-contact {
    display: flex;
  }

  .sc-header .sc-nav .sc-nav-extra {
    display: grid;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .sc-header .sc-nav-cta {
    display: grid;
    gap: 10px;
    margin-top: 18px;
  }

  .sc-header .sc-nav .sc-nav-cta a {
    justify-content: center;
    min-height: 52px;
    padding: 0 16px;
    border: 0;
    border-radius: 14px;
    font-weight: 600;
  }

  .sc-header .sc-nav .sc-nav-cta .sc-nav-line {
    background: #0b7a53;
    color: #fff;
  }

  .sc-header .sc-nav .sc-nav-cta .sc-nav-call {
    border: 1px solid rgba(227, 203, 149, 0.5);
    color: #e3cb95;
  }

  .sc-header .sc-nav-label {
    margin: 26px 0 2px;
    color: rgba(227, 203, 149, 0.78);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
  }

  body.sc-menu-open {
    overflow: hidden;
  }

  /* The menu has its own LINE/call buttons; don't stack the bar on top. */
  .sc-menu-open .sc-sticky {
    display: none;
  }
}

/* ---------- sticky contact bar (phones / tablets) ---------- */
.sc-sticky {
  display: none;
}

@media (max-width: 820px) {
  body {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }

  .sc-sticky {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 12px));
    z-index: 80;
    max-width: 560px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    padding: 9px;
    border: 1px solid rgba(227, 203, 149, 0.22);
    border-radius: 20px;
    background: rgba(10, 21, 38, 0.94);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 44px rgba(10, 21, 38, 0.4);
    font-family: "IBM Plex Sans Thai", "Noto Sans Thai", Tahoma, sans-serif;
  }

  .sc-sticky .sc-sticky-line,
  .sc-sticky .sc-sticky-call,
  .sc-sticky .sc-sticky-copy {
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border-radius: 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
  }

  .sc-sticky .sc-sticky-line {
    border: 0;
    background: #0b7a53;
    color: #fff;
  }

  .sc-sticky .sc-sticky-call {
    padding: 0 16px;
    border: 1px solid rgba(227, 203, 149, 0.45);
    background: transparent;
    color: #e3cb95;
  }

  .sc-sticky .sc-sticky-copy {
    padding: 0 14px;
    border: 1px solid rgba(247, 243, 236, 0.2);
    background: transparent;
    color: #f7f3ec;
    font-size: 13px;
    font-weight: 600;
  }

  .sc-sticky .lbl-done,
  .sc-sticky .is-copied .lbl-default {
    display: none;
  }

  .sc-sticky .is-copied .lbl-done {
    display: inline;
  }

  /* Pages' back-to-top button sits above the bar instead of on it. */
  .back-to-top {
    right: 16px !important;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ---------- footer ---------- */
.sc-footer {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 48px 0 40px;
  border: 0;
  background: #07111f;
  color: rgba(247, 243, 236, 0.72);
  font-family: "IBM Plex Sans Thai", "Noto Sans Thai", Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

.sc-footer .sc-footer-inner {
  width: min(1200px, calc(100vw - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.5fr) minmax(0, 1fr);
  gap: 48px;
}

.sc-footer .sc-footer-brand img {
  display: block;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 10px;
}

.sc-footer .sc-footer-brand strong {
  display: block;
  color: #f7f3ec;
  font-size: 17px;
}

.sc-footer .sc-footer-brand > span {
  color: rgba(247, 243, 236, 0.6);
  font-size: 14px;
}

.sc-footer .sc-footer-links,
.sc-footer .sc-footer-policy {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
}

.sc-footer .sc-footer-links {
  margin-top: 14px;
}

.sc-footer .sc-footer-links a,
.sc-footer .sc-footer-policy a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: rgba(247, 243, 236, 0.9);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
}

.sc-footer .sc-footer-links a:hover,
.sc-footer .sc-footer-policy a:hover {
  color: #e3cb95;
}

.sc-footer .sc-footer-legal p {
  margin: 0 0 12px;
  color: rgba(247, 243, 236, 0.66);
  font-size: 14px;
}

.sc-footer .sc-footer-policy {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(247, 243, 236, 0.14);
}

.sc-footer .sc-footer-policy a {
  color: rgba(247, 243, 236, 0.72);
  font-size: 14px;
  font-weight: 500;
}

.sc-footer .sc-footer-legal .sc-footer-copy {
  margin-top: 8px;
  color: rgba(247, 243, 236, 0.56);
  font-size: 13px;
}

@media (max-width: 820px) {
  .sc-footer {
    padding: 36px 0 28px;
  }

  .sc-footer .sc-footer-inner {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sc-header .sc-nav,
  .sc-menu-lines,
  .sc-menu-lines::before,
  .sc-menu-lines::after {
    transition: none;
  }
}
