﻿@charset "UTF-8";

/* ==========================================================
   NAVIGATION MODULE
   PC navigation / mobile drawer / submenu
   Load after styles-core.css
========================================================== */

/* PCナビゲーション */
nav {
  width: 100%;
  margin-top: 1rem;
}

nav > ul {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

nav li {
  position: relative;
  margin: 0;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
}

.menu-item {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  height: 75px;
  padding: 5px 0;
  overflow: hidden;
}

.menu-item.has-submenu {
  overflow: visible;
}

nav > ul > li > a {
  position: relative;
  display: block;
  padding: 0.5rem 1rem;
  overflow: hidden;
  border-radius: 20px;
  font-weight: 500;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.menu-image {
  width: 180px;
  height: 65px;
  padding: 2px 5px;
  object-fit: contain;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.menu-item:hover .menu-image {
  transform: translateY(-3px) scale(1.04);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.menu-item:active .menu-image {
  transform: translateY(1px) scale(0.98);
}

/* PCサブメニュー */
.submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 1100;
  display: none;
  min-width: 190px;
  margin: 0;
  padding: 0.5rem 0;
  transform: translateX(-50%);
  border: 1px solid rgba(93, 64, 55, 0.1);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  list-style: none;
}

.submenu li,
.submenu a {
  display: block;
  width: 100%;
}

.submenu a {
  padding: 0.65rem 1rem;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.submenu a:hover,
.submenu a:focus-visible {
  background: #e6fff3;
  color: #007644;
  outline: none;
}

@media (min-width: 769px) {
  .has-submenu:hover > .submenu,
  .has-submenu:focus-within > .submenu {
    display: block;
  }
}

/* スマホメニューボタン */
.mobile-menu-btn {
  display: none;
}

@media (max-width: 768px) {
  body.menu-open {
    overflow: hidden;
  }

  .mobile-menu-btn {
    position: absolute;
    top: 0.65rem;
    right: 1rem;
    z-index: 1300;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--pastel-blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }

  .mobile-menu-btn:active {
    transform: scale(0.96);
  }

  .mobile-menu-btn:focus-visible {
    outline: 3px solid #007644;
    outline-offset: 3px;
  }

  .mobile-menu-btn img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    transition: transform 0.3s ease;
  }

  .mobile-menu-btn[aria-expanded="true"] {
    background: var(--pastel-mint);
  }

  .mobile-menu-btn[aria-expanded="true"] img {
    transform: rotate(90deg);
  }

  /* Mobile drawer */
  nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    z-index: 1200;
    display: block;
    width: min(88vw, 390px);
    height: 100dvh;
    margin: 0;
    padding: 4.4rem 0.75rem 1.25rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f4fffc;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.16);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 0.32s ease, visibility 0.32s;
  }

  nav::before {
    content: "MENU";
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: #007644;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.16em;
  }

  nav.active {
    transform: translateX(0);
    visibility: visible;
  }

  /* Screen overlay */
  .menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1150;
    display: block;
    border: 0;
    background: rgba(32, 45, 40, 0.42);
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    transition: opacity 0.3s ease, visibility 0.3s;
  }

  .menu-overlay.is-visible {
    opacity: 1;
    visibility: visible;
  }

  nav > ul {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    margin: 0;
    padding: 0;
    white-space: normal;
  }

  .menu-item {
    display: block;
    width: 100%;
    height: auto;
    padding: 0;
    overflow: visible;
    border: 1px solid rgba(0, 118, 68, 0.14);
    border-radius: 10px;
    background: #fff;
  }

  nav > ul > li > a {
    display: flex;
    align-items: center;
    min-height: 50px;
    width: 100%;
    padding: 0.35rem 3rem 0.35rem 0.7rem;
    border-radius: 10px;
  }

  nav ul li .menu-image,
  .menu-image {
    width: auto;
    max-width: 190px;
    height: 34px;
    padding: 0;
    object-fit: contain;
  }

  /* Arrow for expandable parent */
  .has-submenu > a::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 10px;
    height: 10px;
    border-right: 2px solid #007644;
    border-bottom: 2px solid #007644;
    transform: translateY(-65%) rotate(45deg);
    transition: transform 0.25s ease;
  }

  .has-submenu.open > a::after {
    transform: translateY(-35%) rotate(225deg);
  }

  .has-submenu.open {
    border-color: rgba(0, 118, 68, 0.3);
    background: #f8fffc;
  }

  .has-submenu.open > a {
    background: #effff7;
  }

  /* Mobile submenu */
  .submenu {
    position: static;
    display: block;
    min-width: 0;
    width: 100%;
    max-height: 0;
    margin: 0;
    padding: 0;
    transform: none;
    overflow: hidden;
    border: 0;
    border-radius: 0 0 10px 10px;
    background: #e6fff3;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0.3s;
  }

  .has-submenu.open > .submenu {
    max-height: 420px;
    padding: 0.2rem 0 0.35rem;
    opacity: 1;
    visibility: visible;
  }

  .submenu li {
    margin: 0;
    padding: 0;
  }

  .submenu a {
    min-height: 42px;
    padding: 0.55rem 1rem 0.55rem 1.35rem;
    border-top: 1px dotted rgba(0, 118, 68, 0.22);
    white-space: normal;
    text-align: left;
  }

  .submenu li:first-child a {
    border-top: 0;
  }

  .submenu a:active {
    background: var(--pastel-mint);
  }
}

@media (max-width: 480px) {
  nav {
    width: 92vw;
  }

  .mobile-menu-btn {
    top: 0.25rem;
    right: 0.65rem;
    width: 48px;
    height: 48px;
  }

  nav ul li .menu-image,
  .menu-image {
    max-width: 170px;
    height: 32px;
  }
}

@media (min-width: 769px) and (max-width: 1200px) {
  .menu-image {
    width: 140px;
    height: 58px;
  }

  nav > ul {
    gap: 0.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  nav,
  .menu-overlay,
  .mobile-menu-btn img,
  .has-submenu > a::after,
  .submenu,
  .menu-image {
    transition: none !important;
  }
}
