/* ヘッダー */
.header {
    background-image: url('../images/top/top-hero-image.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    isolation: isolate;
}

.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: -1;
    pointer-events: none;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    position: relative;
    z-index: 1;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-link {
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.logo-image {
    height: 40px; /* 8の倍数に調整 */
    width: auto;
    object-fit: contain;
    display: block; /* 余分なスペースを削除 */
}

.nav-list {
    display: none;
    list-style: none;
    gap: 24px;
}

.nav-link {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: color 0.2s;
}

.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle,
.nav-dropdown-toggle:focus {
    color: var(--primary-color);
    outline: none;
}

.nav-dropdown-menu {
    list-style: none;
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding: 12px;
    background-color: var(--gray-50);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.nav-dropdown.open > .nav-dropdown-menu {
    display: flex;
}

.nav-dropdown-menu .nav-link {
    display: block;
    font-weight: 500;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    width: 24px;
    height: 2px;
    background-color: var(--gray-700);
    transition: all 0.3s;
    transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* モバイルメニュー */
.nav {
    position: fixed;
    /* top は JavaScript で動的に設定 */
    right: -100%;
    width: 280px;
    max-width: 80vw;
    /* height は JavaScript で動的に設定 */
    background-color: var(--white);
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    padding: 24px 16px;
    transition: right 0.3s ease-out;
    z-index: 99;
    overflow-y: auto;
}

.nav.active {
    right: 0;
}

.nav.active .nav-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* メニューオーバーレイ */
.nav-overlay {
    display: none;
    position: fixed;
    /* top は JavaScript で動的に設定 */
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}
