/* Shared site header + footer for the redesigned pages.
   Links and footer details mirror index.html. Used with JS/site-chrome.js.
   Class names are prefixed g2m- so they never clash with page styles. */

.g2m-header,
.g2m-footer {
  --g2m-orange: #fa7436;
  --g2m-orange-dark: #f05323;
  --g2m-ink: #16212b;
  --g2m-line: #e7eaee;
  font-family: "Poppins", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.g2m-header *,
.g2m-footer * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.g2m-header a,
.g2m-footer a {
  color: inherit;
  text-decoration: none;
}

.g2m-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.g2m-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400;
  color: #fff;
  transition: background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

/* Tour pages: sits over the hero and scrolls away (their own section menu sticks instead) */
.g2m-header--overlay {
  position: absolute;
}

.g2m-header.solid {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--g2m-line);
  color: var(--g2m-ink);
}

.g2m-header .g2m-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 76px;
}

.g2m-logo img {
  display: block;
  height: 44px;
  width: auto;
}

/* the logo has white lettering: give it a dark pill on the white header */
.g2m-header.solid .g2m-logo {
  background: var(--g2m-ink);
  border-radius: 12px;
  padding: 4px 10px;
}

.g2m-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.g2m-links a {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.92;
  transition: color 0.2s, opacity 0.2s;
}

.g2m-links a:hover,
.g2m-links a[aria-current="page"] {
  opacity: 1;
  color: var(--g2m-orange);
}

.g2m-lang {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  background: none;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  opacity: 0.9;
}

.g2m-lang:hover {
  color: var(--g2m-orange);
}

.g2m-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--g2m-orange);
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
}

.g2m-cta:hover {
  background: var(--g2m-orange-dark);
  transform: translateY(-2px);
}

.g2m-menu {
  display: none;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  place-items: center;
  border-radius: 12px;
  background: none;
  border: none;
  color: inherit;
  font-size: 24px;
  cursor: pointer;
  position: relative;
  z-index: 2;
}

/* ---------- Footer ---------- */

.g2m-footer {
  background: var(--g2m-ink);
  color: rgba(255, 255, 255, 0.72);
  padding: 72px 0 32px;
  font-size: 14px;
  line-height: 1.65;
}

.g2m-footer-top {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.4fr;
  gap: 40px;
  padding-bottom: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.g2m-footer-brand img {
  display: block;
  height: 46px;
  width: auto;
  margin-bottom: 16px;
}

.g2m-footer-brand p {
  margin-bottom: 18px;
}

.g2m-social {
  display: flex;
  gap: 12px;
}

.g2m-social a {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s;
}

.g2m-social a:hover {
  background: var(--g2m-orange);
  color: #fff;
}

.g2m-footer h4 {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

.g2m-footer ul {
  list-style: none;
  display: grid;
  gap: 9px;
}

.g2m-footer a:hover {
  color: var(--g2m-orange);
}

.g2m-footer-contact li {
  display: flex;
  gap: 10px;
}

.g2m-footer-contact i {
  margin-top: 4px;
  color: var(--g2m-orange);
  width: 14px;
  flex-shrink: 0;
}

.g2m-footer-cta {
  display: inline-block;
  margin-top: 16px;
  padding: 8px 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  font-weight: 600;
  color: #fff !important;
  transition: background 0.2s, border-color 0.2s;
}

.g2m-footer-cta:hover {
  background: var(--g2m-orange);
  border-color: var(--g2m-orange);
}

.g2m-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .g2m-links {
    gap: 16px;
  }

  .g2m-footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 960px) {
  .g2m-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    padding: 90px 28px;
    background: var(--g2m-ink);
    color: #fff;
    max-width: 85vw;
    overflow-y: auto;
    transform: translateX(100%);
    /* hidden when closed: no sideways scroll, and keyboard / screen readers skip it */
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
    z-index: 1;
  }

  .g2m-links.open {
    transform: none;
    visibility: visible;
    transition: transform 0.3s ease, visibility 0s;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.3);
  }

  .g2m-links a {
    display: inline-block;
    padding: 6px 0;
  }


  .g2m-links a {
    font-size: 16px;
  }

  .g2m-menu {
    display: grid;
  }

  .g2m-links.open ~ .g2m-menu {
    color: #fff;
  }

  .g2m-cta {
    display: none;
  }
}

@media (max-width: 640px) {
  .g2m-wrap {
    padding: 0 16px;
  }

  .g2m-header .g2m-wrap {
    height: 66px;
  }

  .g2m-logo img {
    height: 38px;
  }

  .g2m-footer-top {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .g2m-header,
  .g2m-links {
    transition: none;
  }
}

/* Older pages: always-solid header that takes its own space at the top
   (their layouts weren't built for a header floating over the hero) */
.g2m-header.g2m-header--solid {
  position: sticky;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--g2m-line);
  color: var(--g2m-ink);
}

.g2m-header--solid .g2m-logo {
  background: var(--g2m-ink);
  border-radius: 12px;
  padding: 4px 10px;
}

/* the header's list must not pick up old pages' generic ul/li/a styles */
.g2m-header .g2m-links li,
.g2m-footer li {
  list-style: none;
  margin: 0;
  padding: 0;
  float: none;
  display: list-item;
}

.g2m-header .g2m-links li {
  display: block;
}

/* Keyboard focus: a clear ring on every link and button in the header and footer */
.g2m-header a:focus-visible,
.g2m-header button:focus-visible,
.g2m-footer a:focus-visible,
.g2m-footer button:focus-visible {
  outline: 3px solid var(--g2m-orange);
  outline-offset: 3px;
  border-radius: 8px;
}

/* Skip link: first thing keyboard users reach, jumps over the header */
.g2m-skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--g2m-orange, #fa7436);
  color: #fff;
  font: 600 14px/1.2 "Poppins", system-ui, sans-serif;
  text-decoration: none;
}
.g2m-skip:focus {
  top: 12px;
}

/* Phone / tablet: a blurred header would trap the fixed menu inside the header bar
   (kept at the end so it wins over the solid-header rule above) */
@media (max-width: 960px) {
  .g2m-header.g2m-header--solid {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #fff;
  }
}

/* Large desktop screens: header and footer line up with the wider page */
@media (min-width: 1800px) {
  .g2m-wrap {
    max-width: 1440px;
  }
}
@media (min-width: 2400px) {
  .g2m-wrap {
    max-width: 1680px;
  }
}
