/* ===========================
   Layout — Header, Footer, Nav
   =========================== */

/* === Header === */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  z-index: var(--z-header);
  transition: background 0.3s, box-shadow 0.3s;
}
.site-header--transparent { background: transparent; }
.site-header--transparent.is-scrolled,
.site-header:not(.site-header--transparent) {
  background: var(--color-white);
  box-shadow: 0 1px 0 var(--color-border-light);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--content-padding);
}
.site-header__logo img {
  height: 28px;
  width: auto;
}
.site-header--transparent:not(.is-scrolled) .site-header__logo img {
  filter: brightness(0) invert(1);
}

/* Logo placeholder */
.site-header__logo-text {
  font-family: var(--font-english);
  font-weight: var(--fw-semibold);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: var(--color-text);
}
.site-header--transparent:not(.is-scrolled) .site-header__logo-text {
  color: var(--color-white);
}

/* Header Nav (PC) */
.site-header__nav { display: none; }
.header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.header-nav__link {
  font-size: var(--fs-small);
  font-weight: var(--fw-regular);
  color: var(--color-text);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
}
.header-nav__link::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.2s;
}
.header-nav__link--cta {
  padding: 8px 20px;
  border: 1px solid var(--color-text);
  font-weight: var(--fw-medium);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.header-nav__link--cta::after { display: none; }
.site-header--transparent:not(.is-scrolled) .header-nav__link { color: var(--color-white); }
.site-header--transparent:not(.is-scrolled) .header-nav__link--cta { border-color: var(--color-white); }

@media (any-hover: hover) {
  .header-nav__link:hover::after { width: 100%; }
  .header-nav__link--cta:hover {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
  }
  .site-header--transparent:not(.is-scrolled) .header-nav__link--cta:hover {
    background: var(--color-white);
    color: var(--color-primary);
  }
}

/* Header Dropdown */
.header-nav__item--has-dropdown {
  position: relative;
}
.header-nav__dropdown {
  position: absolute;
  top: 100%;
  left: -16px;
  min-width: 200px;
  padding: 12px 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border-light);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 10;
  list-style: none;
}
.header-nav__item--has-dropdown:hover .header-nav__dropdown,
.header-nav__item--has-dropdown:focus-within .header-nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.header-nav__dropdown li {
  padding: 0;
}
.header-nav__dropdown a {
  display: block;
  padding: 8px 24px;
  font-size: var(--fs-small);
  color: var(--color-text-sub);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
@media (any-hover: hover) {
  .header-nav__dropdown a:hover {
    background: var(--color-bg-alt);
    color: var(--color-text);
  }
}
/* Transparent header: dropdown stays white bg */
.site-header--transparent:not(.is-scrolled) .header-nav__dropdown {
  background: var(--color-bg);
  border-color: var(--color-border-light);
}
.site-header--transparent:not(.is-scrolled) .header-nav__dropdown a {
  color: var(--color-text-sub);
}

/* Hamburger */
.site-header__menu-btn {
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}
.site-header__menu-icon {
  width: 24px; height: 16px;
  position: relative;
}
.site-header__menu-icon span {
  display: block;
  position: absolute;
  left: 0;
  width: 100%; height: 2px;
  background: var(--color-text);
  transition: transform 0.3s, opacity 0.3s, top 0.3s;
  transform-origin: center;
}
.site-header__menu-icon span:nth-child(1) { top: 0; }
.site-header__menu-icon span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.site-header__menu-icon span:nth-child(3) { top: 100%; transform: translateY(-100%); }

.site-header--transparent:not(.is-scrolled) .site-header__menu-icon span {
  background: var(--color-white);
}

/* Open state → X */
.site-header__menu-btn[aria-expanded="true"] .site-header__menu-icon span {
  background: var(--color-white);
}
.site-header__menu-btn[aria-expanded="true"] .site-header__menu-icon span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}
.site-header__menu-btn[aria-expanded="true"] .site-header__menu-icon span:nth-child(2) {
  opacity: 0;
}
.site-header__menu-btn[aria-expanded="true"] .site-header__menu-icon span:nth-child(3) {
  top: 50%;
  transform: translateY(-50%) rotate(-45deg);
}

/* === Fullscreen Menu === */

.fullscreen-menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu-overlay);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.fullscreen-menu.is-open {
  opacity: 1;
  pointer-events: auto;
}
.fullscreen-menu__bg {
  position: absolute;
  inset: 0;
  background: var(--color-theme);
}
.fullscreen-menu__nav {
  position: relative;
  z-index: 1;
  text-align: left;
  width: min(560px, 85vw);
}
.fullscreen-menu__columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
}
.fullscreen-menu__list { padding: 0; }
.fullscreen-menu__item { margin-bottom: 16px; }
.fullscreen-menu__link {
  display: block;
  text-decoration: none;
  color: var(--color-white);
  padding: 4px 0;
  transition: opacity 0.2s;
}
.fullscreen-menu__en {
  display: block;
  font-family: var(--font-english);
  font-weight: var(--fw-light);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  letter-spacing: 0.08em;
  line-height: 1.2;
}
/* FB-02: Hide JP labels on main menu items (keep only on sub-links) */
.fullscreen-menu__jp {
  display: none;
}
/* FB-02: Sub-menu items — improved visibility */
.fullscreen-menu__item--sub { margin-bottom: 8px; margin-left: 20px; }
.fullscreen-menu__item--sub::before {
  content: "—";
  color: rgba(255, 255, 255, 0.35);
  margin-right: 8px;
  font-size: 0.75rem;
}
.fullscreen-menu__item--sub {
  display: flex;
  align-items: center;
}
.fullscreen-menu__link--sub { padding: 2px 0; }
.fullscreen-menu__link--sub .fullscreen-menu__jp {
  display: inline;
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  font-weight: var(--fw-regular);
  color: rgba(255, 255, 255, 0.85);
  margin-left: 0;
  letter-spacing: 0.08em;
}
.fullscreen-menu__cta {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.fullscreen-menu__footer {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 1;
  width: min(560px, 85vw);
}
.fullscreen-menu__address {
  font-size: var(--fs-caption);
  color: rgba(255, 255, 255, 0.35);
  text-align: left;
}

@media (any-hover: hover) {
  .fullscreen-menu__link:hover { opacity: 0.7; }
}

.fullscreen-menu.is-open .fullscreen-menu__item,
.fullscreen-menu.is-open .fullscreen-menu__cta {
  animation: menuFadeIn 0.4s ease-out forwards;
  opacity: 0;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Footer === */

.site-footer {
  background: var(--color-primary);
  color: var(--color-on-dark);
  padding: clamp(60px, 8vw, 100px) 0 40px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}
.site-footer__logo-text {
  font-family: var(--font-english);
  font-weight: var(--fw-semibold);
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--color-white);
  margin-bottom: 16px;
}
.site-footer__tagline {
  font-size: var(--fs-caption);
  color: var(--color-on-dark-muted);
  line-height: var(--lh-body);
}
.site-footer__heading {
  font-family: var(--font-english);
  font-size: var(--fs-caption);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-on-dark-muted);
  margin-bottom: 16px;
}
.site-footer__links li { margin-bottom: 8px; }
.site-footer__links a {
  font-size: var(--fs-small);
  color: var(--color-on-dark-sub);
  text-decoration: none;
  transition: color 0.2s;
}
.site-footer__address {
  font-size: var(--fs-small);
  color: var(--color-on-dark-sub);
  line-height: var(--lh-body);
}
.site-footer__bottom {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.site-footer__copyright {
  font-size: var(--fs-caption);
  color: var(--color-on-dark-muted);
}

@media (any-hover: hover) {
  .site-footer__links a:hover { color: var(--color-white); }
}

/* === Page Header (subpages) === */

.page-header {
  position: relative;
  margin-top: var(--header-height);
  padding: clamp(60px, 10vw, 120px) 0 clamp(40px, 6vw, 80px);
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border-light);
  overflow: hidden;
}
.page-header__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.page-header--has-image {
  background: none;
  border-bottom: none;
}
.page-header--has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
}
.page-header--has-image .container {
  position: relative;
  z-index: 2;
}
.page-header__title { text-align: center; }
.page-header__en {
  display: block;
  font-family: var(--font-english);
  font-weight: var(--fw-regular);
  font-size: var(--fs-page-title);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text);
  line-height: 1.1;
}
.page-header--has-image .page-header__en { color: var(--color-white); }
.page-header__jp {
  display: block;
  font-size: var(--fs-small);
  font-weight: var(--fw-light);
  color: var(--color-text-light);
  margin-top: 8px;
  letter-spacing: var(--ls-body);
}
.page-header--has-image .page-header__jp { color: rgba(255, 255, 255, 0.8); }

/* Breadcrumb */
.breadcrumb { margin-top: 24px; text-align: center; }
.breadcrumb__list {
  display: flex;
  justify-content: center;
  font-size: var(--fs-caption);
  color: var(--color-text-light);
}
.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  margin: 0 8px;
  color: var(--color-border);
}
.breadcrumb__item a {
  color: var(--color-text-light);
  text-decoration: none;
}
@media (any-hover: hover) {
  .breadcrumb__item a:hover {
    color: var(--color-theme);
    text-decoration: underline;
  }
}
.page-header--has-image .breadcrumb {
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 12px;
  border-radius: 4px;
  display: inline-block;
}
.page-header--has-image .breadcrumb__list,
.page-header--has-image .breadcrumb__item a,
.page-header--has-image .breadcrumb__item + .breadcrumb__item::before {
  color: rgba(255, 255, 255, 0.8);
}
.page-header--has-image .breadcrumb__item a:hover {
  color: var(--color-white);
}

/* === Contact Sidebar (benchmark: fixed right edge) === */

.contact-sidebar {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  writing-mode: vertical-rl;
  background: var(--color-black);
  color: var(--color-white);
  text-decoration: none;
  padding: 20px 10px;
  font-family: var(--font-english);
  font-size: 0.625rem;
  font-weight: var(--fw-medium);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}
.contact-sidebar__icon {
  writing-mode: horizontal-tb;
  width: 14px;
  height: 14px;
}
.contact-sidebar__icon svg {
  width: 100%;
  height: 100%;
}
.contact-sidebar__arrow {
  writing-mode: horizontal-tb;
  font-size: 1rem;
  line-height: 1;
}
@media (any-hover: hover) {
  .contact-sidebar:hover {
    background: var(--color-primary-mid);
  }
}

/* === SP Floating CTA (replaces PC sidebar on mobile) === */

.sp-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--color-primary);
  padding: 10px 16px;
  transform: translateY(100%);
  transition: transform 0.3s;
}
.sp-cta.is-visible {
  transform: translateY(0);
}
.sp-cta__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--color-white);
  color: var(--color-primary);
  text-decoration: none;
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-body);
}
.sp-cta__link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* === Page Top Button === */

.page-top {
  position: fixed;
  bottom: 32px; right: 32px;
  width: 48px; height: 48px;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 50;
}
.page-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.page-top svg { width: 20px; height: 20px; }
