/**
 * Custom header: announcement bar + sticky main header.
 * Scoped to .tc-announce, #tc-header, .tc-mobile-menu.
 * Overrides sticky-header.css body padding (enqueued after it).
 */

/* ─── Layout tokens ─────────────────────────────────────────── */

:root {
  --tc-announce-height: 40px;
  --tc-header-height: 72px;
  --tc-total-offset: calc(var(--tc-announce-height) + var(--tc-header-height));
  --tc-admin-bar: 0px;
}

body.admin-bar {
  --tc-admin-bar: 32px;
}

@media (max-width: 782px) {
  body.admin-bar {
    --tc-admin-bar: 46px;
  }
}

/* Reset sticky-header.css body padding and scroll offset */
html {
  scroll-padding-top: calc(var(--tc-total-offset) + var(--tc-admin-bar));
}

:target {
  scroll-margin-top: calc(var(--tc-total-offset) + var(--tc-admin-bar));
}

body {
  padding-top: calc(var(--tc-total-offset) + var(--tc-admin-bar));
}

/* Hide Astra's masthead completely */
#masthead.site-header {
  display: none !important;
}

/* ─── Announcement bar ──────────────────────────────────────── */

.tc-announce {
  position: fixed;
  top: var(--tc-admin-bar);
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--tc-announce-height);
  background: linear-gradient(90deg, #0d2a22 0%, #0d1c32 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tc-announce-inner {
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
  padding: 0 16px;
  white-space: nowrap;
}

.tc-announce-inner strong {
  color: #26fedc;
  font-weight: 700;
}

/* ─── Main header ───────────────────────────────────────────── */

#tc-header {
  position: fixed;
  top: calc(var(--tc-announce-height) + var(--tc-admin-bar));
  left: 0;
  right: 0;
  z-index: 999;
  height: var(--tc-header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(13, 28, 50, 0.08);
  box-shadow: 0 1px 2px rgba(13, 28, 50, 0.03);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

#tc-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(13, 28, 50, 0.08);
}

.tc-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1280px, calc(100% - 48px));
  margin-inline: auto;
  height: 100%;
  gap: 32px;
}

/* ─── Logo ──────────────────────────────────────────────────── */

.tc-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.tc-logo:hover {
  text-decoration: none;
}

.tc-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
}

.tc-logo-name {
  font-family: "Noto Sans JP", "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  font-size: 1.125rem;
  color: #0d1c32;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

/* ─── Desktop navigation ────────────────────────────────────── */

.tc-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.tc-nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tc-nav-list li {
  margin: 0;
  padding: 0;
}

.tc-nav-list a {
  display: block;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #0d1c32;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tc-nav-list a:hover {
  background-color: rgba(13, 28, 50, 0.06);
  color: #0d1c32;
  text-decoration: none;
}

.tc-nav-list .current-menu-item > a,
.tc-nav-list .current_page_item > a,
.tc-nav-list .current-menu-ancestor > a {
  background-color: rgba(13, 28, 50, 0.08);
  color: #0d1c32;
  font-weight: 600;
}

/* ─── Header CTA button ─────────────────────────────────────── */

.tc-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.tc-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 22px;
  background: #0d1c32;
  color: #ffffff;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 9999px;
  white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.tc-header-cta:hover {
  background: #152844;
  color: #ffffff;
  transform: translateY(-1px);
  text-decoration: none;
}

/* ─── Mobile hamburger toggle ───────────────────────────────── */

.tc-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.tc-menu-toggle:hover {
  background-color: rgba(13, 28, 50, 0.06);
}

.tc-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 22px;
  pointer-events: none;
}

.tc-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: #0d1c32;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.tc-menu-toggle.is-open .tc-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.tc-menu-toggle.is-open .tc-hamburger span:nth-child(2) {
  opacity: 0;
}

.tc-menu-toggle.is-open .tc-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Mobile menu dropdown ──────────────────────────────────── */

.tc-mobile-menu {
  position: fixed;
  top: calc(var(--tc-total-offset) + var(--tc-admin-bar));
  left: 0;
  right: 0;
  z-index: 998;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(13, 28, 50, 0.08);
  box-shadow: 0 8px 32px rgba(13, 28, 50, 0.12);
  max-height: calc(100vh - var(--tc-total-offset) - var(--tc-admin-bar));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tc-mobile-menu[hidden] {
  display: none;
}

.tc-mobile-menu-inner {
  width: min(1280px, calc(100% - 32px));
  margin-inline: auto;
  padding: 20px 0 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tc-mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.tc-mobile-nav-list li {
  margin: 0;
  padding: 0;
}

.tc-mobile-nav-list a {
  display: block;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: #0d1c32;
  text-decoration: none;
  padding: 14px 4px;
  border-bottom: 1px solid rgba(13, 28, 50, 0.06);
  transition: color 0.2s ease;
}

.tc-mobile-nav-list a:hover {
  color: #006b5b;
  text-decoration: none;
}

.tc-mobile-nav-list .current-menu-item > a,
.tc-mobile-nav-list .current_page_item > a {
  color: #006b5b;
  font-weight: 600;
}

.tc-mobile-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  padding: 14px 24px;
  background: #0d1c32;
  color: #ffffff;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 9999px;
  transition: background-color 0.2s ease;
}

.tc-mobile-cta:hover {
  background: #152844;
  color: #ffffff;
  text-decoration: none;
}

/* ─── Responsive: tablet and mobile ────────────────────────── */

@media (max-width: 921px) {
  :root {
    --tc-header-height: 64px;
  }

  .tc-nav,
  .tc-header-cta {
    display: none;
  }

  .tc-menu-toggle {
    display: flex;
  }

  .tc-header-inner {
    width: min(1280px, calc(100% - 32px));
    gap: 16px;
  }
}

/* 390px: allow announcement bar to wrap */
@media (max-width: 480px) {
  :root {
    --tc-announce-height: 52px;
  }

  .tc-announce-inner {
    font-size: 0.75rem;
    white-space: normal;
    line-height: 1.45;
    padding: 6px 16px;
  }
}
