/* แถบบน + เมนูหลัก ใช้ได้ทุกหน้าโดยไม่ไปทับสไตล์ของธีม
   style.css ดึงไฟล์นี้เข้าไปด้วย ดังนั้นแก้เมนูที่นี่ที่เดียว */

:root {
  --bg:         #120c07;
  --gold:       #d6a64a;
  --gold-hi:    #f6d98f;
  --gold-line:  rgba(214, 166, 74, 0.45);
  --ink:        #f2e6d0;
  --ink-2:      #d4c3a6;
  --muted:      #a8936f;
  --grad-gold:  linear-gradient(180deg, #fbe7b0 0%, #e2b35c 48%, #a8702a 100%);
  --font-head:  "Prompt", "IBM Plex Sans Thai", sans-serif;
  --topbar-h:   64px;
}

html.gemth-has-topbar { scroll-padding-top: var(--topbar-h); }

/* หน้าแลนดิ้งเว้นที่ให้ hero เอง หน้าอื่นดันเนื้อหาลงใต้แถบ */
html.gemth-has-topbar:not(.gemth-landing) body { padding-top: var(--topbar-h); }

.gemth-topbar [hidden] { display: none !important; }

.gemth-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1030;
  height: var(--topbar-h);
  background: linear-gradient(180deg, rgba(10, 6, 3, .9), rgba(10, 6, 3, .68));
  border-bottom: 1px solid rgba(214, 166, 74, .22);
  color: var(--ink);
  font-family: var(--font-head);
  transition: background-color .25s ease, box-shadow .25s ease;
}

.gemth-topbar.gemth-is-scrolled {
  background: rgba(12, 8, 4, .96);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
}

/* แถบของ WordPress สูง 32px (จอเล็ก 46px) เมนูตรึงอยู่ต้องเลื่อนลงมาให้พ้น */
body.admin-bar .gemth-topbar {
  top: var(--wp-admin--admin-bar--height, 32px);
}

@media screen and (max-width: 782px) {
  body.admin-bar .gemth-topbar {
    top: var(--wp-admin--admin-bar--height, 46px);
  }
}

.gemth-topbar .container-xl {
  width: 100%;
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: 12px;
}

@media (min-width: 1400px) {
  .gemth-topbar .container-xl { max-width: 1320px; }
}

.gemth-topbar__inner {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
}

.gemth-topbar ul { list-style: none; margin: 0; padding: 0; }
.gemth-topbar a { text-decoration: none; }

.gemth-brand { display: inline-flex; align-items: center; }
.gemth-brand__logo { height: 42px; width: auto; max-width: none; }

.gemth-topbar__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.gemth-topbar .gemth-btn-gold,
.gemth-topbar .gemth-btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  padding: 12px 22px;
  border-radius: 4px;
  white-space: nowrap;
  cursor: pointer;
  transition: filter .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}

.gemth-topbar .gemth-btn-gold {
  color: #2a1706;
  background: var(--grad-gold);
  border: 1px solid #fbe3a3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 2px 10px rgba(0, 0, 0, .35);
}

.gemth-topbar .gemth-btn-gold:hover,
.gemth-topbar .gemth-btn-gold:focus-visible {
  color: #2a1706;
  filter: brightness(1.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 0 18px rgba(246, 201, 110, .45);
}

.gemth-topbar .gemth-btn-line {
  color: var(--ink);
  background: rgba(10, 6, 3, .35);
  border: 1px solid var(--gold-line);
}

.gemth-topbar .gemth-btn-line:hover,
.gemth-topbar .gemth-btn-line:focus-visible {
  color: var(--gold-hi);
  border-color: var(--gold);
  background: rgba(214, 166, 74, .1);
}

.gemth-topbar .gemth-btn-gold--sm,
.gemth-topbar .gemth-btn-line--sm { font-size: 13px; padding: 9px 16px; }

.gemth-topbar .gemth-btn-sound {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 19px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.gemth-topbar .gemth-btn-sound i { line-height: 1; }
.gemth-topbar .gemth-btn-sound.gemth-is-playing i { animation: ge-note-beat 1.9s ease-in-out infinite; }

.gemth-topbar .gemth-btn-sound.gemth-is-off {
  color: var(--muted);
  border-color: rgba(214, 166, 74, .26);
}

.gemth-topbar .gemth-btn-sound.gemth-is-off::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 -2px 0 rgba(10, 6, 3, .9);
  transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes ge-note-beat {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.14); }
}

.gemth-topbar__nav { display: flex; align-items: center; }
.gemth-topbar__nav[hidden] { display: none; }

.gemth-topnav__burger { display: none; }

.gemth-topnav__list { display: flex; align-items: center; gap: 4px; }
.gemth-topnav__item,
.gemth-topnav--wp .menu-item { position: relative; }

.gemth-topnav__link,
.gemth-topnav--wp > .gemth-topnav__list > li > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease;
}

.gemth-topnav__link:hover,
.gemth-topnav__link:focus-visible,
.gemth-topnav--wp > .gemth-topnav__list > li > a:hover,
.gemth-topnav--wp > .gemth-topnav__list > li > a:focus-visible,
.gemth-topnav--wp .current-menu-item > a,
.gemth-topnav--wp .current-menu-ancestor > a {
  color: var(--gold-hi);
  background: rgba(214, 166, 74, .12);
}

.gemth-topnav__toggle .bi { font-size: .8em; transition: rotate .2s ease; }
.gemth-topnav__toggle[aria-expanded="true"] { color: var(--gold-hi); background: rgba(214, 166, 74, .14); }
.gemth-topnav__toggle[aria-expanded="true"] .bi { rotate: 180deg; }

.gemth-topnav--wp .menu-item-has-children > a::after {
  content: "";
  width: .42em;
  height: .42em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  margin-left: 4px;
}

.gemth-topnav__sub,
.gemth-topnav--wp .sub-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--gold-line);
  border-radius: 5px;
  background: rgba(14, 9, 4, .98);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .6);
  display: none;
  z-index: 2;
}

.gemth-topnav__item.gemth-is-open .gemth-topnav__sub,
.gemth-topnav--wp .menu-item-has-children.gemth-is-open > .sub-menu { display: block; }

@media (min-width: 992px) {
  .gemth-topnav--wp .menu-item-has-children:hover > .sub-menu,
  .gemth-topnav--wp .menu-item-has-children:focus-within > .sub-menu { display: block; }
}

.gemth-topnav__sublink,
.gemth-topnav--wp .sub-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.5;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}

.gemth-topnav__sublink:hover,
.gemth-topnav__sublink:focus-visible,
.gemth-topnav--wp .sub-menu a:hover,
.gemth-topnav--wp .sub-menu a:focus-visible {
  color: var(--gold-hi);
  background: rgba(214, 166, 74, .14);
}

.gemth-topnav[hidden] { display: none !important; }

@media (max-width: 991.98px) {
  .gemth-topnav__burger {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--gold-line);
    border-radius: 4px;
    background: rgba(10, 6, 3, .35);
    color: var(--gold-hi);
    font-size: 20px;
    cursor: pointer;
  }

  .gemth-topbar .gemth-topnav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: 10px 14px 14px;
    border-bottom: 1px solid var(--gold-line);
    background: rgba(12, 8, 4, .98);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .55);
    max-height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
  }

  .gemth-topbar .gemth-topnav.gemth-is-open { display: block; }
  .gemth-topbar .gemth-topnav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .gemth-topbar .gemth-topnav__link,
  .gemth-topbar .gemth-topnav--wp > .gemth-topnav__list > li > a {
    width: 100%;
    justify-content: space-between;
    padding: 11px 12px;
  }

  .gemth-topbar .gemth-topnav__sub,
  .gemth-topbar .gemth-topnav--wp .sub-menu {
    position: static;
    min-width: 0;
    margin: 2px 0 4px 12px;
    border: 0;
    border-left: 1px solid var(--gold-line);
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
}

@media (max-width: 767.98px) {
  :root { --topbar-h: 58px; }
  .gemth-brand__logo { height: 36px; }
  .gemth-topbar__actions { gap: 8px; }
}

@media (max-width: 575.98px) {
  .gemth-topbar .gemth-btn-gold--sm { height: 40px; padding: 0 14px; font-size: 13px; }
  .gemth-topbar .gemth-btn-sound { width: 38px; height: 38px; font-size: 16px; }
  .gemth-topbar .gemth-btn-sound.gemth-is-off::after { width: 23px; }
}
