/* ==========================================================================
   Global Font Unification - Yu Gothic
   ========================================================================== */
body,
body * {
  font-family: "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif !important;
}

/* Global Header V2 - Simplified and Standardized (Fixed Header) */
#global-header-v2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background-color: #fff;
  z-index: 2147483647 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
}

.gh-container {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  position: relative !important;
  margin: 0 auto !important;
  /* Center the container */
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 40px !important;
  box-sizing: border-box !important;
}

/* Logo Area */
.gh-logo-area {
  display: flex !important;
  align-items: center !important;
  /* Left/Right margins handled by container width */
}

.gh-logo-link {
  display: flex !important;
  align-items: center !important;
  text-decoration: none !important;
  gap: 10px !important;
}

.gh-logo {
  width: auto !important;
  height: 60px !important;
  object-fit: contain !important;
}

.gh-title {
  color: #525252 !important;
  font-family: "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif !important;
  font-size: 26px !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  padding-top: 4px !important;
  /* Optical alignment */
}

/* Burger Menu */
.gh-burger {
  cursor: pointer !important;
  width: 37px !important;
  height: 24px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  /* Removed absolute positioning for responsiveness */
  position: relative;
}

.gh-burger span {
  display: block !important;
  width: 100% !important;
  height: 4px !important;
  background-color: #525252 !important;
  border-radius: 4px !important;
  transition: all 0.3s ease !important;
}

/* PC hover effect: turn into a green "X" */
@media screen and (min-width: 769px) {
  .gh-burger:hover span {
    background-color: var(--fun-green, #008239) !important;
  }

  .gh-burger:hover span:nth-child(1) {
    transform: translateY(10px) rotate(-45deg);
  }

  .gh-burger:hover span:nth-child(2) {
    opacity: 0 !important;
  }

  .gh-burger:hover span:nth-child(3) {
    transform: translateY(-10px) rotate(45deg);
  }
}

/* Open state: turn into a green "X" for ALL screens (including SP) */
.gh-burger.open span {
  background-color: var(--fun-green, #008239) !important;
}

.gh-burger.open span:nth-child(1) {
  transform: translateY(10px) rotate(-45deg);
}

.gh-burger.open span:nth-child(2) {
  opacity: 0 !important;
}

.gh-burger.open span:nth-child(3) {
  transform: translateY(-10px) rotate(45deg);
}

/* Hide old header container if it exists */
#common-header-container {
  display: none !important;
}

/* Unified Hero Section (staff-title-section) */
.staff-title-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 288px;
  flex-shrink: 0;
  background-image: url('../img/cardboard-texture_200px.png'), url('../img/file---35-1x-png-1@1x.png');
  background-position: left top, center;
  background-size: auto, cover;
  background-repeat: repeat, no-repeat;
  background-blend-mode: multiply;
  margin-bottom: 80px;
  padding-top: 80px;
  box-sizing: border-box;
  margin-top: -80px;
  border-radius: 0 0 64px 64px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.staff-title-text {
  font-family: "Yu Gothic", "YuGothic", "Meiryo", sans-serif;
  font-weight: bold;
  font-size: 44px;
  color: #000000;
  text-align: center;
  background-color: rgba(255, 255, 255, 0);
  line-height: 1.2;
  margin: 0;
}

/* Specific Layout: Title and Subtitle in column with gap */
.title-row-layout {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 0 !important;
}

.title-row-layout .hero-subtitle {
  font-family: inherit;
  font-weight: bold;
  font-size: 26px !important;
  color: #000000;
  text-align: center;
  margin-top: 42px !important;
  line-height: 1.4;
}

@media screen and (max-width: 768px) {
  .title-row-layout .hero-subtitle {
    font-size: 20px !important;
    /* Reduced from 26px for better mobile balance */
    margin-top: 42px !important;
    padding: 0 20px;
    box-sizing: border-box;
  }
}

/* Common Footer Container - ensure consistent styling across all pages */
#common-footer-container {
  background-color: var(--fun-green);
  height: 161px;
  position: relative;
  width: 100%;
}

/* Common Footer Base Styles (Applies to the injection point) */
#common-footer-container {
  background-color: #008239;
  background-image: url(../img/cardboard-texture_200px.png);
  background-repeat: repeat;
  background-blend-mode: multiply;
  height: 161px;
  position: relative;
  width: 100%;
  overflow: hidden;
  color: #ffffff;
}

/* Common Footer Internal Styles */
.common-footer-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: clamp(10px, 0.78vw, 15px) !important;
}

.common-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1145px;
  padding: 0 20px;
  margin: 0 auto;
  box-sizing: border-box;
}

.cf-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.common-footer-image {
  height: clamp(45px, 3.54vw, 68px);
  width: auto;
  object-fit: contain;
}

.common-footer-address {
  letter-spacing: 0;
  line-height: 1.5;
  white-space: nowrap;
  flex-shrink: 0;
}

.common-footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.cf-privacy-wrap {
  text-decoration: none;
  color: inherit;
}

.common-footer-copyright {
  letter-spacing: 0;
  line-height: normal;
  white-space: nowrap;
}

.common-footer-privacy-link {
  cursor: pointer;
  letter-spacing: 0;
  line-height: normal;
  white-space: nowrap;
  text-decoration: none;
  font-size: inherit !important;
}

/* Hamburger Overlay - Full screen transparent background */
.hamburger-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 9999;
  opacity: 0;
}

.hamburger-overlay.animate-appear {
  display: block;
  animation: fadeIn 0.3s ease-in-out forwards;
}

.hamburger-overlay.animate-disappear {
  display: block;
  animation: fadeOut 0.3s ease-in-out forwards;
  pointer-events: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* Hamburger Dropdown Menu - Positioned dynamically via JS */
.hamburger-dropdown {
  position: absolute;
  top: auto;
  /* Set via JS */
  right: auto;
  /* Set via JS */
  background-color: white;
  padding: 35px 30px 25px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 25px;
  min-width: 200px;
  z-index: 2147483647;
}

.hamburger-menu-item {
  display: block;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.2;
  transition: opacity 0.2s;
}

.hamburger-menu-item:hover {
  opacity: 0.7;
}

/* Force vertical scrollbar to prevent layout shift */
/* html {
  overflow-y: scroll !important;
} */

/* ===========================================
   Responsive Styles for Global Header
   =========================================== */

/* Tablet (max-width: 1024px) */
@media screen and (max-width: 1024px) {
  #global-header-v2 {
    width: 100% !important;
  }

  .gh-container {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
  }

  .common-footer-inner {
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
  }
}

/* Smartphone (max-width: 768px) */
@media screen and (max-width: 768px) {
  #global-header-v2 {
    height: 60px !important;
  }

  .gh-logo {
    height: 45px !important;
  }

  .staff-title-section {
    height: 260px;
    padding-top: 60px;
    margin-top: -60px;
    margin-bottom: 40px;
    border-radius: 0 0 32px 32px;
  }

  .staff-title-text {
    font-size: 30px;
    margin-bottom: 0;
    margin-top: 0;
  }

  .gh-container {
    padding: 0 12px !important;
  }

  .gh-title {
    font-size: 20px !important;
  }

  .gh-burger {
    width: 30px !important;
    height: 20px !important;
  }

  .gh-burger span {
    height: 3px !important;
  }

  .gh-burger.open span:nth-child(1) {
    transform: translateY(8.5px) rotate(-45deg);
  }

  .gh-burger.open span:nth-child(3) {
    transform: translateY(-8.5px) rotate(45deg);
  }

  /* Fix for mobile scaling alignment */
  .sp-view .container-center-horizontal {
    justify-content: flex-start !important;
    align-items: flex-start !important;
  }

  /* Common Footer Mobile Setup */
  #common-footer-container {
    height: auto !important;
  }

  .common-footer-container {
    height: auto !important;
    padding: 30px 16px;
  }

  .common-footer-inner {
    flex-direction: column;
    gap: 20px;
    align-items: center;
    text-align: center;
  }

  .common-footer-address {
    font-size: 13.5px !important;
    /* Unified size */
    line-height: 1.6 !important;
  }

  .footer-tel-fax-br {
    display: none !important;
  }

  .footer-fax-text {
    margin-left: 10px;
  }

  .common-footer-copyright,
  .common-footer-privacy-link {
    font-size: 12px !important;
    /* Unified size */
  }

  .common-footer-right {
    align-items: center;
    gap: 8px;
  }
}