@charset "UTF-8";

/* =================================================================
   header.css - ヘッダー＆ナビゲーション（F+ ナチュラル）
   ================================================================= */

/* ----- Header ----- */
.header {
  background-color: rgba(247, 241, 228, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.header__logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex-shrink: 0;
  text-decoration: none;
}

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

.header__logo-corp {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  padding-left: 2px;
}

.header__right {
  display: none;
  align-items: center;
  gap: var(--space-lg);
}

.header__contact {
  text-align: right;
}

.header__address {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.header__tel {
  font-family: var(--font-round);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-wood-dark);
}

.header__tel a {
  text-decoration: none;
  color: inherit;
}

.header__cta,
.header__cta-sub {
  white-space: nowrap;
}

/* ----- Hamburger Button ----- */
.header__hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  position: relative;
  z-index: 200;
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  background: var(--color-bg-white);
}

.header__hamburger:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.header__hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-wood-dark);
  border-radius: 1px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

/* Hamburger open state */
.header__hamburger[aria-expanded="true"] .header__hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header__hamburger[aria-expanded="true"] .header__hamburger-line:nth-child(2) {
  opacity: 0;
}

.header__hamburger[aria-expanded="true"] .header__hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ----- Navigation ----- */
.nav {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border-light);
}

/* Overlay (mobile only) */
.nav__overlay {
  display: none;
}

.nav__list {
  display: flex;
  justify-content: center;
}

.nav__item {
  flex: 1;
}

.nav__link {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 var(--space-sm);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  transition: color var(--transition-fast), background-color var(--transition-fast);
  position: relative;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%) scaleX(0);
  width: 40%;
  height: 2px;
  border-radius: 2px;
  background: var(--color-ajisai);
  transition: transform var(--transition-fast);
}

.nav__link:hover,
.nav__link:focus-visible {
  color: var(--color-text);
  background: none;
}

.nav__link:hover::after,
.nav__link:focus-visible::after {
  transform: translateX(-50%) scaleX(1);
}

.nav__link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

/* 現在ページ表示（方向感覚・WCAG 2.4.8）。下線は常時表示し行動色の緑に統一 */
.nav__link[aria-current="page"] {
  color: var(--color-accent);
  font-weight: 600;
}

.nav__link[aria-current="page"]::after {
  transform: translateX(-50%) scaleX(1);
  background: var(--color-accent);
}

/* =================================================================
   Responsive: Tablet+ (768px)
   ================================================================= */
@media (min-width: 768px) {
  .nav__item--mobile-only {
    display: none;
  }

  .header__inner {
    height: 88px;
  }

  .header__right {
    display: flex;
  }

  .header__hamburger {
    display: none;
  }

  .nav__list {
    max-width: var(--width-container);
    margin: 0 auto;
  }
}

/* =================================================================
   Mobile drawer (max-width: 767px)
   ================================================================= */
.nav__close {
  display: none;
}

@media (max-width: 767px) {
  .header__inner {
    height: 64px;
  }

  .header__logo-img {
    height: 34px;
  }

  .header__logo-corp {
    font-size: 0.58rem;
  }

  /* Navigation becomes drawer on mobile */
  .nav {
    background: none;
    border-bottom: none;
  }

  /* Overlay */
  .nav__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(var(--color-wood-dark-rgb), 0.4);
    z-index: 150;
    opacity: 0;
    transition: opacity var(--transition-base);
  }

  /* Drawer panel */
  .nav__drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(82%, 300px);
    height: 100vh;
    height: 100dvh;
    background-color: var(--color-bg);
    z-index: 160;
    transform: translateX(100%);
    transition: transform var(--transition-base);
    overflow-y: auto;
    padding-top: 80px;
    box-shadow: -12px 0 40px -16px rgba(var(--color-wood-dark-rgb), 0.4);
  }

  /* ドロワー内の明示的な「とじる」ボタン（高齢者に×の在り処を分かりやすく） */
  .nav__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    min-width: 44px;
    min-height: 44px;
    padding: 0 0.75em;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-full);
    background: var(--color-bg-white);
    color: var(--color-wood-dark);
    font-size: 0.95rem;
    line-height: 1;
  }

  .nav__close:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
  }

  .nav__list {
    flex-direction: column;
  }

  .nav__drawer .nav__link {
    font-family: var(--font-body);
    color: var(--color-text);
    height: auto;
    padding: var(--space-md) var(--space-lg);
    justify-content: flex-start;
    border-bottom: 1px dashed var(--color-border-light);
    font-size: 1.1rem;
  }

  .nav__drawer .nav__link::after {
    display: none;
  }

  .nav__drawer .nav__link:hover {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
  }

  .nav__drawer .nav__link[aria-current="page"]:not(.nav__link--highlight):not(.nav__link--cta) {
    color: var(--color-accent);
    font-weight: 700;
    border-left: 3px solid var(--color-accent);
    padding-left: calc(var(--space-lg) - 3px);
    background-color: var(--color-primary-light);
  }

  .nav__drawer .nav__link--highlight {
    color: var(--color-primary-dark);
    border: 2px solid var(--color-primary);
    background-color: transparent;
    margin: var(--space-md) var(--space-lg) 0;
    border-radius: var(--radius-full);
    justify-content: center;
  }

  .nav__drawer .nav__link--highlight:hover {
    background-color: var(--color-primary);
    color: #fff;
  }

  .nav__drawer .nav__link--cta {
    background-color: var(--color-accent);
    color: #fff;
    margin: var(--space-md) var(--space-lg);
    border-radius: var(--radius-full);
    justify-content: center;
    border-bottom: none;
  }

  .nav__drawer .nav__link--cta:hover {
    background-color: var(--color-accent-hover);
    color: #fff;
  }

  /* Open state (toggled by JS) */
  .nav.is-open .nav__overlay {
    display: block;
    opacity: 1;
  }

  .nav.is-open .nav__drawer {
    transform: translateX(0);
  }
}
